{"id":"CVE-2021-37706","published":"2021-12-22T00:00:00Z","modified":"2025-11-04T16:09:17Z","title":"Potential integer underflow upon receiving STUN message in PJSIP","vendor":"pjsip","product":"pjproject","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.3,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.04924,"percentile":0.92329,"provenance":"source"},"cwes":[{"id":"CWE-191","name":"Integer Underflow (Wrap or Wraparound)"}],"references":[{"url":"https://github.com/pjsip/pjproject/security/advisories/GHSA-2qpg-f6wf-w984","tags":[]},{"url":"https://github.com/pjsip/pjproject/commit/15663e3f37091069b8c98a7fce680dc04bc8e865","tags":[]},{"url":"http://seclists.org/fulldisclosure/2022/Mar/0","tags":["mailing-list"]},{"url":"http://packetstormsecurity.com/files/166225/Asterisk-Project-Security-Advisory-AST-2022-004.html","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/03/msg00035.html","tags":["mailing-list"]},{"url":"https://security.gentoo.org/glsa/202210-37","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/11/msg00021.html","tags":["mailing-list"]},{"url":"https://www.debian.org/security/2022/dsa-5285","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/08/msg00038.html","tags":["mailing-list"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00030.html","tags":[]}],"priority":{"score":28.6,"factors":[{"name":"EPSS percentile","points":18.47},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.11}]},"vendorSlug":"pjsip","affectedVersions":[{"vendor":"pjsip","product":"pjproject","versions":["<= 2.11.1"]}],"summary":{"text":"The flaw is an integer underflow in the STUN message handling of pjproject (PJSIP), a multimedia communication library, triggered when an incoming STUN message contains an ERROR-CODE attribute whose header length is subtracted without being checked first. An attacker positioned within the victim's network who can send a specially crafted UDP STUN message, without needing credentials or user interaction, could potentially execute arbitrary code on the affected machine.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:29:02Z"},"euvd":{"id":"EUVD-2021-24195","exploited":false,"provenance":"source"},"exploitRefs":["http://packetstormsecurity.com/files/166225/Asterisk-Project-Security-Advisory-AST-2022-004.html"],"lineage":{"familyId":"fam-pjsip-pjproject-cve-2021-37706","children":[{"from":"CVE-2021-37706","to":"CVE-2022-23537","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["pjnath/src/pjnath/stun_msg.c"],"commits":["https://github.com/pjsip/pjproject/commit/15663e3f37091069b8c98a7fce680dc04bc8e865","https://github.com/pjsip/pjproject/commit/d8440f4d711a654b511f50f79c0445b26f9dd1e1"],"basis":"rarely changed file"}]},{"from":"CVE-2021-37706","to":"CVE-2022-23547","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["pjnath/src/pjnath/stun_msg.c"],"commits":["https://github.com/pjsip/pjproject/commit/15663e3f37091069b8c98a7fce680dc04bc8e865","https://github.com/pjsip/pjproject/commit/bc4812d31a67d5e2f973fbfaf950d6118226cf36"],"basis":"shared function","functions":["decode_errcode_attr"]}]}]}}