CVE-2026-45538

OpenSIPS: Stack Buffer Overflow in sip_to_json() Header Name Copy

Published Aug 4, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
Description
OpenSIPS is a Session Initiation Protocol (SIP) server implementation. In versions 4.0.0 and prior, processing a SIP message with a header name longer than 255 bytes causes a stack buffer overflow when sip_to_json() is called in the routing script. Function sip_to_json() (modules/sipmsgops/sipmsgops.c) copies SIP header names into a fixed 255-byte stack buffer without bounds checking, performing a memcpy of the full header-name length even though the SIP parser imposes no such limit (a header name can be roughly 65000 bytes). As a result, when a routing script calls sip_to_json(), a SIP message with a header name longer than 255 bytes triggers a stack buffer overflow in which both the length and content of the overwrite are attacker-controlled, corrupting the saved frame pointer and return address. A single unauthenticated UDP packet to the SIP port (5060) can crash the process or, on builds without stack protections, hijack the return address to achieve remote code execution. This affects deployments whose routing script invokes sip_to_json(). This issue was not fixed at the time of publication.

Analysis

AI-generated

Technical impact

OpenSIPS versions 4.0.0 and prior contain a stack buffer overflow in the sip_to_json() function. When the function copies a SIP header name longer than 255 bytes into a fixed 255‑byte buffer without bounds checking, an attacker can craft a SIP message whose header name exceeds the limit. The overflow corrupts the saved frame pointer and return address, allowing the attacker to crash the process or, on builds without stack protections, hijack execution to achieve remote code execution.

Affected Systems

All deployments of OpenSIPS:opensips running version 4.0.0 or earlier that use the sip_to_json() function within their routing scripts are affected. The vulnerability is triggered by any routing script that calls this function with untrusted SIP header names.

Risk and Exploitability

The vulnerability receives a CVSS score of 9.8, indicating critical severity. EPSS is not available and the issue is not listed in CISA’s KEV catalog. A single unauthenticated UDP packet sent to the SIP port (5060) can trigger the overflow, meaning the attack vector is readily exploitable and requires no special privileges. On systems without stack protection such as stack canaries, this overflow can lead to arbitrary code execution, making the risk extremely high.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade OpenSIPS to a version that contains the fix or to a newer major release where the issue is resolved.
  • If upgrading is not an option, modify routing scripts to eliminate or replace the use of sip_to_json() when processing headers that might exceed 255 bytes, or patch the function to enforce a length check before copying.
  • Recompile OpenSIPS with stack protection (e.g., enable -fstack-protector-strong or similar compiler options) to mitigate the impact of any remaining overflows.

Generated by OpenCVE AI on August 4, 2026 at 22:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Opensips
Opensips opensips
Vendors & Products Opensips
Opensips opensips
Type Values Removed Values Added
Description OpenSIPS is a Session Initiation Protocol (SIP) server implementation. In versions 4.0.0 and prior, processing a SIP message with a header name longer than 255 bytes causes a stack buffer overflow when sip_to_json() is called in the routing script. Function sip_to_json() (modules/sipmsgops/sipmsgops.c) copies SIP header names into a fixed 255-byte stack buffer without bounds checking, performing a memcpy of the full header-name length even though the SIP parser imposes no such limit (a header name can be roughly 65000 bytes). As a result, when a routing script calls sip_to_json(), a SIP message with a header name longer than 255 bytes triggers a stack buffer overflow in which both the length and content of the overwrite are attacker-controlled, corrupting the saved frame pointer and return address. A single unauthenticated UDP packet to the SIP port (5060) can crash the process or, on builds without stack protections, hijack the return address to achieve remote code execution. This affects deployments whose routing script invokes sip_to_json(). This issue was not fixed at the time of publication.
Title OpenSIPS: Stack Buffer Overflow in sip_to_json() Header Name Copy
Weaknesses CWE-121
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-121

    Stack-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 5, 2026, 2:28 PM
Reserved
May 12, 2026, 5:48 PM
Status
Awaiting Analysis
Published
Aug 4, 2026, 9:16 PM
Modified
Sep 8, 2026, 8:41 PM