CVE-2026-40892: Stack buffer overflow in PJSIP pjsip_auth_create_digest2()
- Vendor
- Pjsip
CVE-2026-40892 is a stack-based buffer overflow in PJSIP, a free and open source multimedia communication library written in C, affecting version 2.16 and earlier. The flaw is in pjsip_auth_create_digest2() when the library is configured to use pre-computed digest credentials via PJSIP_CRED_DATA_DIGEST. In the vulnerable code path, credential data is copied using cred_info->data.slen as the copy length without enforcing an upper bound. Because the destination buffer, ha1, is a fixed-size 128-byte stack buffer, an oversized credential length can overflow the stack buffer when data.slen exceeds the expected digest string length.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can corrupt stack memory in the context of the vulnerable process. Based on the provided CVSS v4.0 metadata, the issue is network exploitable, requires low attack complexity, no privileges, and no user interaction, and can have high impact on confidentiality, integrity, and availability. In practical terms, exploitation may lead to process crash or denial of service, and depending on surrounding memory layout, compiler protections, and exploitability conditions, may also enable arbitrary code execution or other severe memory-corruption outcomes.
Mitigation
If you can’t patch tonight, do this now.
If immediate patching is not possible, avoid using pre-computed digest credentials through PJSIP_CRED_DATA_DIGEST in affected versions, or ensure any supplied digest credential data is strictly validated so its length cannot exceed the expected digest string size before it reaches pjsip_auth_create_digest2(). Reduce exposure of network-reachable services built on affected PJSIP deployments where untrusted or externally influenced authentication material may be processed. Standard hardening measures such as stack protections may reduce reliability of exploitation but should not be treated as a substitute for patching.
Remediation
Patch, then assume compromise.
Upgrade to a fixed PJSIP release newer than 2.16 that corrects the missing bounds check in pjsip_auth_create_digest2(). The vulnerable code should validate cred_info->data.slen against the maximum valid digest length before copying into the fixed-size ha1 buffer, or replace the fixed-size stack buffer handling with a bounded or dynamically sized copy strategy. The provided references indicate a fix is associated with GitHub commit c82123ea6f3c3652bbc9ebd5e9e658c301451687 and advisory GHSA-2wcg-w3c4-48r7.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2026-40892 exploited in the wild?
- As of Sep 25, 2026, Mallory has no reports of CVE-2026-40892 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-40892?
- As of Sep 25, 2026, Mallory has found no public exploit for CVE-2026-40892.
- Is there a patch for CVE-2026-40892?
- Upgrade to a fixed PJSIP release newer than 2.16 that corrects the missing bounds check in pjsip_auth_create_digest2(). The vulnerable code should validate cred_info->data.slen against the maximum valid digest length before copying into the fixed-size ha1 buffer, or replace the fixed-size stack buffer handling with a bounded or dynamically sized copy strategy.
- What products are affected by CVE-2026-40892?
- Pjsip.
- How severe is CVE-2026-40892?
- CVE-2026-40892 has a CVSS v4 score of 8.1 (High) and an EPSS score of 0.42% (37th percentile) as of Sep 25, 2026.
Recent activity
2 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.