Skip to content
Heist/ feed
Back to feed
Critical

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-45538
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 07:27 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 4 Aug 2026, 20:47 UTC

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.

osv:CVE-2026-45538
Complete source record
{
  "id": "3e36b26d1dc76f2d81877828392c0fe0663500b0ff198b9bcf763816f5015d49",
  "url": "https://osv.dev/vulnerability/CVE-2026-45538",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "OpenSIPS: Stack Buffer Overflow in sip_to_json() Header Name Copy",
    "summary": "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.",
    "evidence": "osv:CVE-2026-45538",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2026-45538",
      "aliases": [
        "CVE-2026-45538",
        "GHSA-37wc-5j8j-95x3"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/opensips/opensips",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "acf45c08e7a169b18f7b53f02d42c19c035c1c43"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "4.0.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "4.0.0"
                      }
                    ],
                    "source": "DESCRIPTION"
                  }
                ]
              }
            }
          ],
          "versions": [
            "4.0.0",
            "4.0.0-rc2",
            "4.0.0-rc1",
            "4.0.0-beta",
            "2.1-rc1",
            "2.1-alpha3",
            "2.1-alpha2",
            "2.1-alpha1",
            "1.11.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-45538.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:26.583434466Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45538.json",
        "https://github.com/OpenSIPS/opensips/security/advisories/GHSA-37wc-5j8j-95x3",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-45538"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-121"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45538.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-45538",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 493377,
  "published_at": "2026-08-04T20:47:10.262+00:00"
}