PJSIP / PJNATH ICE Session Stack Buffer Overflow via SDP ice-ufrag (CVE-2026-25994)
by V.Nos / BinSmasher Team (VABISMO) · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-25994
- Category
- network
- Affected product
- PJSIP / PJNATH (ICE implementation used by pjsua and SIP/VoIP stacks)
- Affected versions
- <= 2.16 (fixed in 2.17)
- Disclosed
- 2026-07-05
- Patch status
- patched
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-04 |
| Author / Researcher | V.Nos / BinSmasher Team (VABISMO) |
| CVE / Advisory | CVE-2026-25994 |
| Category | network |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | pjsip, pjnath, ice, sip, voip, stack-overflow, dos, sdp, buffer-overflow |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | PJSIP / PJNATH (ICE implementation used by pjsua and SIP/VoIP stacks) |
| Versions Affected | <= 2.16 (fixed in 2.17) |
| Language / Platform | Python 3 (socket-based SIP INVITE sender) targeting a Linux/pjsua host |
| Authentication Required | No |
| Network Access Required | Yes (UDP SIP signaling) |
Summary
CVE-2026-25994 is a stack-based buffer overflow in PJNATH’s ICE (Interactive Connectivity Establishment) session handling, specifically in pj_ice_sess_create_check_list() in pjnath/src/pjnath/ice_session.c. When constructing the ICE username, the code copies the remote ice-ufrag SDP attribute into a fixed 128-byte stack buffer using pj_strcpy/pj_strcat without any length validation. An attacker who can send a SIP INVITE with an SDP body containing an oversized a=ice-ufrag: value can overflow the stack, corrupting the return address, stack frame, and canary/alignment data. The included PoC sends a crafted UDP SIP INVITE with a 520-byte ice-ufrag (chosen for reliability) to a target running pjsua with ICE enabled, and detects a crash via response timeout.
Vulnerability Details
Root Cause
pj_ice_sess_create_check_list() copies the attacker-controlled rem_ufrag (taken directly from the SDP a=ice-ufrag: attribute) into a 128-byte stack buffer with no bounds checking before concatenating it with a separator and the local ufrag.
Attack Vector
- Attacker crafts a SIP INVITE with a valid header but an SDP body containing an oversized
a=ice-ufrag:value (~130+ bytes to trigger, ~520 bytes for reliable overflow). - Attacker sends the INVITE via UDP to the target’s SIP port (default 5060).
- The target’s ICE session code parses the SDP and copies
rem_ufraginto the fixed stack buffer, overflowing it. - Depending on stack protections (canaries, ASLR, NX), this results in a crash (DoS) or, in weaker configurations, potential remote code execution.
Impact
Remote, unauthenticated denial of service (process crash) against any pjsip/pjnath-based SIP/VoIP endpoint with ICE enabled; potential remote code execution depending on target hardening.
Environment / Lab Setup
Target: pjsua (or any pjsip <= 2.16 application) built with --use-ice, listening on UDP/5060
Attacker: Python 3 (standard library socket only)
Proof of Concept
PoC Script
See
pjsip-cve-2026-25994.pyin this folder.
| |
The script builds a SIP INVITE with a valid SDP body whose a=ice-ufrag: field is padded to 520 bytes, sends it over UDP with automatic retries, and waits up to 4 seconds for a response; a timeout is reported as a likely crash (segmentation fault) of the target process.
Detection & Indicators of Compromise
Signs of compromise:
- Unexplained crashes/restarts of SIP/VoIP services built on pjsip with ICE enabled
- SDP bodies in SIP signaling logs containing
ice-ufragvalues far exceeding normal length - Repeated INVITE floods from a single source immediately preceding a service crash
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade to pjsip/pjnath 2.17 or later, which adds length validation on rem_ufrag before the buffer copy |
| Interim mitigation | Enable/verify stack canaries, ASLR, and NX on hosts running pjsip-based SIP services; restrict SIP signaling exposure to trusted networks where possible |
References
Notes
Mirrored from https://github.com/VABISMO/cve-2026-25994_PJSIP on 2026-07-05.
| |