{"id":"CVE-2026-57187","summary":"Asterisk: Heap-use-after-free in Asterisk PJSIP TCP/SDP handling when TCP connection closes during SDP processing","details":"Asterisk is an open source private branch exchange and telephony toolkit. Prior to Asterisk 20.20.1, 21.12.3, 22.10.1, 23.4.1 and Certified Asterisk 20.7-cert11, 22.8-cert3, an authenticated attacker may cause a heap-use-after-free in `PJSIP TCP/SDP` handling by sending a `SIP INVITE` over a connection-oriented transport and disconnecting before Asterisk responds with the `200 OK`. So far, the crash has only been reproduced when Asterisk is built with `Address Sanitizer`, which detects the issue. `Address Sanitizer` is a development tool with significant performance overhead and, according to the maintainer, is not used in production systems. This issue is fixed in Asterisk 20.20.1, 21.12.3, 22.10.1, 23.4.1 and Certified Asterisk 20.7-cert11, 22.8-cert3.","aliases":["GHSA-g8q2-p36q-94f6"],"modified":"2026-11-11T13:30:27.873411104Z","published":"2026-10-26T19:31:52.937Z","database_specific":{"cwe_ids":["CWE-416","CWE-664"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/57xxx/CVE-2026-57187.json","cna_assigner":"GitHub_M"},"references":[{"type":"WEB","url":"https://github.com/asterisk/asterisk/releases/tag/20.20.1"},{"type":"WEB","url":"https://github.com/asterisk/asterisk/releases/tag/21.12.3"},{"type":"WEB","url":"https://github.com/asterisk/asterisk/releases/tag/22.10.1"},{"type":"WEB","url":"https://github.com/asterisk/asterisk/releases/tag/23.4.1"},{"type":"WEB","url":"https://github.com/asterisk/asterisk/releases/tag/certified-20.7-cert11"},{"type":"WEB","url":"https://github.com/asterisk/asterisk/releases/tag/certified-22.8-cert3"},{"type":"WEB","url":"https://github.com/asterisk/asterisk/tree/24.0.0-pre1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/57xxx/CVE-2026-57187.json"},{"type":"ADVISORY","url":"https://github.com/asterisk/asterisk/security/advisories/GHSA-g8q2-p36q-94f6"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-57187"},{"type":"FIX","url":"https://github.com/asterisk/asterisk/commit/0f076168e0be31ebee37762192d0ee049e9c0d42"},{"type":"FIX","url":"https://github.com/asterisk/asterisk/commit/27b9544b32f059a4f614169243eaa7559f622aa0"},{"type":"FIX","url":"https://github.com/asterisk/asterisk/commit/6e1f4df744369d66ea6f412e355d819b2a7bf26c"},{"type":"FIX","url":"https://github.com/asterisk/asterisk/commit/9e0386c6d259f0c7499d52499d9891bee8a494fa"},{"type":"FIX","url":"https://github.com/asterisk/asterisk/commit/b7ba85458796ef54b471017287c7806095dbda76"},{"type":"FIX","url":"https://github.com/asterisk/asterisk/commit/d4e30005940f86942745bcc64f34748d69870247"},{"type":"FIX","url":"https://github.com/asterisk/asterisk/commit/f1e47621472bb3d8ad71f32823f5ca986e008437"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/asterisk/asterisk","events":[{"introduced":"0"},{"fixed":"1f072600089c8321b8c4141f431742b06cae1c66"},{"fixed":"19ea385cecb1b9403e3d924bcb3d770a04d50b49"},{"introduced":"68349125a8a825b0995b4ab1343c61bdb2ad33e5"},{"fixed":"b9fda9d45703e9dbae5542300bb1f11a1abe2f37"},{"introduced":"31b8dc09238d916be18d93dc7dda30711e636c17"},{"fixed":"f0e408a7b0d829c85bf15fa4b487870a50cb3000"},{"introduced":"ca5335d90ea8dc26fa2ea189f9621b1d8a4a3513"},{"fixed":"9c6d578ea138e2a5df3bbc261b82a94424d6ce53"},{"introduced":"5da1497b742194b535f13e155b87bd698772a4b6"},{"fixed":"3c1105ea3c80209b5420565d125dc2163eba436a"},{"fixed":"0f076168e0be31ebee37762192d0ee049e9c0d42"},{"fixed":"27b9544b32f059a4f614169243eaa7559f622aa0"},{"fixed":"6e1f4df744369d66ea6f412e355d819b2a7bf26c"},{"fixed":"9e0386c6d259f0c7499d52499d9891bee8a494fa"},{"fixed":"b7ba85458796ef54b471017287c7806095dbda76"},{"fixed":"d4e30005940f86942745bcc64f34748d69870247"},{"fixed":"f1e47621472bb3d8ad71f32823f5ca986e008437"}],"database_specific":{"extracted_events":[{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"0"},{"fixed":"20.20.1"}]},{"range":[{"introduced":"0"},{"fixed":"20.7-cert11"}],"source":"AFFECTED_FIELD","strategy":"StringRangeExpression"},{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"21.0.0-pre1"},{"fixed":"21.12.3"}]},{"range":[{"introduced":"22.0.0-pre1"},{"fixed":"22.10.1"}],"source":"AFFECTED_FIELD","strategy":"StringRangeExpression"},{"range":[{"introduced":"23.0.0-pre1"},{"fixed":"23.4.1"}],"source":"AFFECTED_FIELD","strategy":"StringRangeExpression"},{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"22.8-cert1-pre1"},{"fixed":"22.8-cert3"}]},{"source":"REFERENCES_COMMIT","range":[{"fixed":"0f076168e0be31ebee37762192d0ee049e9c0d42"}]},{"source":"REFERENCES_COMMIT","range":[{"fixed":"27b9544b32f059a4f614169243eaa7559f622aa0"}]},{"source":"REFERENCES_COMMIT","range":[{"fixed":"6e1f4df744369d66ea6f412e355d819b2a7bf26c"}]},{"range":[{"fixed":"9e0386c6d259f0c7499d52499d9891bee8a494fa"}],"source":"REFERENCES_COMMIT"},{"range":[{"fixed":"b7ba85458796ef54b471017287c7806095dbda76"}],"source":"REFERENCES_COMMIT"},{"range":[{"fixed":"d4e30005940f86942745bcc64f34748d69870247"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_COMMIT","range":[{"fixed":"f1e47621472bb3d8ad71f32823f5ca986e008437"}]},{"source":"REFERENCES_TAG","original_tag":"20.20.1","range":[{"fixed":"1f072600089c8321b8c4141f431742b06cae1c66"}]},{"range":[{"fixed":"b9fda9d45703e9dbae5542300bb1f11a1abe2f37"}],"source":"REFERENCES_TAG","original_tag":"21.12.3"},{"original_tag":"22.10.1","range":[{"fixed":"f0e408a7b0d829c85bf15fa4b487870a50cb3000"}],"source":"REFERENCES_TAG"},{"original_tag":"23.4.1","range":[{"fixed":"9c6d578ea138e2a5df3bbc261b82a94424d6ce53"}],"source":"REFERENCES_TAG"},{"source":"REFERENCES_TAG","original_tag":"certified-20.7-cert11","range":[{"fixed":"19ea385cecb1b9403e3d924bcb3d770a04d50b49"}]},{"range":[{"fixed":"3c1105ea3c80209b5420565d125dc2163eba436a"}],"source":"REFERENCES_TAG","original_tag":"certified-22.8-cert3"}]}}],"versions":["23.4.0","22.10.0","20.20.0","certified-22.8-cert2","certified-20.7-cert10","21.12.2","23.4.0-rc1","22.10.0-rc1","20.20.0-rc1","23.3.0","22.9.0","20.19.0","23.3.0-rc2","22.9.0-rc2","20.19.0-rc2","23.3.0-rc1","22.9.0-rc1","20.19.0-rc1","certified-22.8-cert1-pre1","22.8.2","23.2.2","20.18.2","certified-22.8-cert1","certified-20.7-cert9","21.12.1","certified-22.8-cert1-rc1","certified-20.7-cert8","23.2.1","21.12.0","20.18.1","23.2.0","20.18.0","20.18.0-rc1","23.2.0-rc1","23.1.0","20.17.0","certified-20.7-cert7","21.12.0-rc2","23.1.0-rc2","20.17.0-rc2","23.1.0-rc1","21.12.0-rc1","20.17.0-rc1","23.0.0","21.11.0","20.16.0","23.0.0-rc2","21.11.0-rc2","20.16.0-rc2","23.0.0-rc1","21.11.0-rc1","20.16.0-rc1","20.15.0","20.15.0-rc3","20.15.0-rc1","20.15.0-rc2","20.15.1","20.15.2","20.14.0","21.10.0","21.10.0-rc3","21.10.0-rc1","21.10.0-rc2","21.10.1","21.10.2","21.9.0","23.0.0-pre1","certified-20.7-cert6","certified-20.7-cert5","certified-20.7-cert4","21.9.0-rc1","20.14.0-rc1","21.8.0","20.13.0","21.8.0-rc1","20.13.0-rc1","21.7.0","20.12.0","21.7.0-rc2","20.12.0-rc2","21.7.0-rc1","20.12.0-rc1","21.6.1","20.11.1","21.6.0","certified-20.7-cert3","20.11.0","21.6.0-rc1","20.11.0-rc1","21.5.0","20.10.0","20.10.0-rc2","21.5.0-rc2","21.5.0-rc1","20.10.0-rc1","21.4.3","20.9.3","certified-20.7-cert2","21.4.2","20.9.2","21.4.1","20.9.1","certified-20.7-cert1","20.9.0","21.4.0","21.4.0-rc1","20.9.0-rc1","certified-20.7-cert1-rc2","21.3.1","20.8.1","21.3.0","20.8.0","21.3.0-rc1","20.8.0-rc1","certified-20.7-cert1-rc1","certified-20.7-cert1-pre1","20.7.0","21.2.0","21.2.0-rc2","20.7.0-rc2","20.7.0-rc1","21.2.0-rc1","21.1.0","20.6.0","21.1.0-rc2","20.6.0-rc2","21.1.0-rc1","20.6.0-rc1","21.0.2","20.5.2","20.5.1","21.0.1","21.0.0","20.5.0","21.0.0-rc1","20.5.0-rc1","21.0.0-pre1","20.4.0","20.4.0-rc2","20.4.0-rc1","20.3.1","20.3.0","20.3.0-rc1","20.2.1","20.2.0","20.2.0-rc1"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-57187.json","vanir_signatures":[{"digest":{"threshold":0.9,"line_hashes":["57739710013209646724659567865935723775","11619482291465365549573173894402826972","334420632267805550800191985719009374418","29247763499052345679128662698303332842","189445437168597434786400217613933453175","40772550859417493016699466549054923624","261647870369005693440956891928215601668"]},"id":"CVE-2026-57187-0b43bead","signature_type":"Line","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/d4e30005940f86942745bcc64f34748d69870247","target":{"file":"res/res_pjsip/pjsip_message_filter.c"},"deprecated":false},{"signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/f1e47621472bb3d8ad71f32823f5ca986e008437","target":{"file":"res/res_pjsip/pjsip_message_filter.c","function":"filter_on_tx_message"},"deprecated":false,"digest":{"function_hash":"185663347725597506238232875050082083140","length":4129},"id":"CVE-2026-57187-2c833c51","signature_type":"Function"},{"signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/b7ba85458796ef54b471017287c7806095dbda76","target":{"file":"res/res_pjsip/pjsip_message_filter.c"},"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["57739710013209646724659567865935723775","11619482291465365549573173894402826972","334420632267805550800191985719009374418","29247763499052345679128662698303332842","189445437168597434786400217613933453175","40772550859417493016699466549054923624","261647870369005693440956891928215601668"]},"id":"CVE-2026-57187-3cfe7e46","signature_type":"Line"},{"signature_type":"Function","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/0f076168e0be31ebee37762192d0ee049e9c0d42","target":{"file":"res/res_pjsip/pjsip_message_filter.c","function":"filter_on_tx_message"},"deprecated":false,"digest":{"function_hash":"185663347725597506238232875050082083140","length":4129},"id":"CVE-2026-57187-4246c26d"},{"digest":{"function_hash":"185663347725597506238232875050082083140","length":4129},"id":"CVE-2026-57187-53c39f92","signature_type":"Function","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/27b9544b32f059a4f614169243eaa7559f622aa0","target":{"file":"res/res_pjsip/pjsip_message_filter.c","function":"filter_on_tx_message"},"deprecated":false},{"source":"https://github.com/asterisk/asterisk/commit/27b9544b32f059a4f614169243eaa7559f622aa0","target":{"file":"res/res_pjsip/pjsip_message_filter.c"},"deprecated":false,"digest":{"line_hashes":["57739710013209646724659567865935723775","11619482291465365549573173894402826972","334420632267805550800191985719009374418","29247763499052345679128662698303332842","189445437168597434786400217613933453175","40772550859417493016699466549054923624","261647870369005693440956891928215601668"],"threshold":0.9},"id":"CVE-2026-57187-69636ebb","signature_type":"Line","signature_version":"v1"},{"signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/d4e30005940f86942745bcc64f34748d69870247","target":{"function":"filter_on_tx_message","file":"res/res_pjsip/pjsip_message_filter.c"},"deprecated":false,"digest":{"function_hash":"185663347725597506238232875050082083140","length":4129},"id":"CVE-2026-57187-6f7e17f9","signature_type":"Function"},{"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["57739710013209646724659567865935723775","11619482291465365549573173894402826972","334420632267805550800191985719009374418","29247763499052345679128662698303332842","189445437168597434786400217613933453175","40772550859417493016699466549054923624","261647870369005693440956891928215601668"]},"id":"CVE-2026-57187-8f6d708c","signature_type":"Line","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/6e1f4df744369d66ea6f412e355d819b2a7bf26c","target":{"file":"res/res_pjsip/pjsip_message_filter.c"}},{"signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/6e1f4df744369d66ea6f412e355d819b2a7bf26c","target":{"file":"res/res_pjsip/pjsip_message_filter.c","function":"filter_on_tx_message"},"deprecated":false,"digest":{"function_hash":"185663347725597506238232875050082083140","length":4129},"id":"CVE-2026-57187-9f6427e3","signature_type":"Function"},{"deprecated":false,"digest":{"line_hashes":["57739710013209646724659567865935723775","11619482291465365549573173894402826972","334420632267805550800191985719009374418","29247763499052345679128662698303332842","189445437168597434786400217613933453175","40772550859417493016699466549054923624","261647870369005693440956891928215601668"],"threshold":0.9},"id":"CVE-2026-57187-9fd7b847","signature_type":"Line","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/9e0386c6d259f0c7499d52499d9891bee8a494fa","target":{"file":"res/res_pjsip/pjsip_message_filter.c"}},{"id":"CVE-2026-57187-cfdd3817","signature_type":"Function","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/b7ba85458796ef54b471017287c7806095dbda76","target":{"function":"filter_on_tx_message","file":"res/res_pjsip/pjsip_message_filter.c"},"deprecated":false,"digest":{"length":4129,"function_hash":"185663347725597506238232875050082083140"}},{"target":{"file":"res/res_pjsip/pjsip_message_filter.c"},"deprecated":false,"digest":{"line_hashes":["57739710013209646724659567865935723775","11619482291465365549573173894402826972","334420632267805550800191985719009374418","29247763499052345679128662698303332842","189445437168597434786400217613933453175","40772550859417493016699466549054923624","261647870369005693440956891928215601668"],"threshold":0.9},"id":"CVE-2026-57187-ee3bde1a","signature_type":"Line","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/0f076168e0be31ebee37762192d0ee049e9c0d42"},{"id":"CVE-2026-57187-fa0a4aca","signature_type":"Line","signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/f1e47621472bb3d8ad71f32823f5ca986e008437","target":{"file":"res/res_pjsip/pjsip_message_filter.c"},"deprecated":false,"digest":{"line_hashes":["57739710013209646724659567865935723775","11619482291465365549573173894402826972","334420632267805550800191985719009374418","29247763499052345679128662698303332842","189445437168597434786400217613933453175","40772550859417493016699466549054923624","261647870369005693440956891928215601668"],"threshold":0.9}},{"signature_version":"v1","source":"https://github.com/asterisk/asterisk/commit/9e0386c6d259f0c7499d52499d9891bee8a494fa","target":{"file":"res/res_pjsip/pjsip_message_filter.c","function":"filter_on_tx_message"},"deprecated":false,"digest":{"function_hash":"185663347725597506238232875050082083140","length":4129},"id":"CVE-2026-57187-ff0b55b2","signature_type":"Function"}],"vanir_signatures_modified":"2026-11-11T13:30:27Z"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"}]}