What’s Vulnerable › Vulnerabilities
CVE-2021-37706: Potential integer underflow upon receiving STUN message in PJSIP
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 4.9% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2021-12-22 · updated 2026-06-17
- Weakness: CWE-191
Description
PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. In affected versions if the incoming STUN message contains an ERROR-CODE attribute, the header length is not checked before performing a subtraction operation, potentially resulting in an integer underflow scenario. This issue affects all users that use STUN. A malicious actor located within the victim’s network may forge and send a specially crafted UDP (STUN) message that could remotely execute arbitrary code on the victim’s machine. Users are advised to upgrade as soon as possible. There are no known workarounds.
Affected products
- asterisk Certified Asterisk: before 16.8.0; 16.8.0, 16.8.0-cert1, 16.8.0-cert10, 16.8.0-cert11, 16.8.0-cert12, 16.8.0-cert2 (+7) — fixed in 16.8.0
- Debian Linux: 9.0, 10.0
- asterisk: from 16.0.0 before 16.24.1; from 18.0.0 before 18.10.1; from 19.0.0 before 19.2.1 — fixed in 16.24.1, 18.10.1, 19.2.1
- teluu pjsip: through 2.11.1
How to fix
Upgrade to a fixed version: asterisk Certified Asterisk 16.8.0; asterisk 16.24.1, 18.10.1, 19.2.1. Check the vendor advisory for mitigations.
References
- http://packetstormsecurity.com/files/166225/Asterisk-Project-Security-Advisory-AST-2022-004.html
- http://seclists.org/fulldisclosure/2022/Mar/0
- https://github.com/pjsip/pjproject/commit/15663e3f37091069b8c98a7fce680dc04bc8e865
- https://github.com/pjsip/pjproject/security/advisories/GHSA-2qpg-f6wf-w984
- https://lists.debian.org/debian-lts-announce/2022/03/msg00035.html
- https://lists.debian.org/debian-lts-announce/2022/11/msg00021.html
- https://lists.debian.org/debian-lts-announce/2023/08/msg00038.html
- https://security.gentoo.org/glsa/202210-37
- https://www.debian.org/security/2022/dsa-5285
- http://packetstormsecurity.com/files/166225/Asterisk-Project-Security-Advisory-AST-2022-004.html
- http://seclists.org/fulldisclosure/2022/Mar/0
- https://github.com/pjsip/pjproject/commit/15663e3f37091069b8c98a7fce680dc04bc8e865
Get alerted when CVE-2021-37706 or the next vulnerability affects your stack