{"id":"GHSA-pg59-5vwg-4jxq","revision":"58a4a7eecf504426a5bc562f9cd4f23b","records":[{"revision":"58a4a7eecf504426a5bc562f9cd4f23b","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-pg59-5vwg-4jxq","aliases":["CVE-2026-58268","GO-2026-6550"],"title":"SIPGO: DoS via unvalidated Content-Length in the stream parser","description":"### Summary\n\nThe stream parser allocates the SIP body buffer from the `Content-Length` header before validating its size, which can lead to an unauthenticated DoS.\n\n### Details\n\n`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):\n\n```go\nbody := make([]byte, contentLength)   // contentLength is client-controlled, up to 2^32-1 (uint32)\n```\n\nThe `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.\n\n### PoC\n\nTested on emiago/sipgo v1.4.0 (latest).\n\nSend a single message with a large `Content-Length` and no body to a SIP server:\n\n```\nINVITE sip:victim@example.com SIP/2.0\nVia: SIP/2.0/TCP attacker.example;branch=z9hG4bK1\nFrom: <sip:attacker@attacker.example>;tag=1\nTo: <sip:victim@example.com>\nCall-ID: 1@attacker.example\nCSeq: 1 INVITE\nContent-Length: 4000000000                     // <- a large Content-Length\n\n```\n\n### Suggested Fix\n\nValidate `contentLength` against `ParseMaxMessageLength` before the allocation.\n\n### Impact\n\nUnauthenticated DoS. Any service using `sipgo` with a stream transport (TCP/TLS/WS/WSS) can be forced to run out of memory.","state":0,"publishedAt":"2026-09-22T19:57:51+00:00","modifiedAt":"2026-10-01T20:55:47.2896334+00:00","affected":[{"ecosystem":"Go","name":"github.com/emiago/sipgo","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.4.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/emiago/sipgo/security/advisories/GHSA-pg59-5vwg-4jxq","https://github.com/emiago/sipgo/commit/a7be60a07f48c06b3cdd5a7d35eb820b3df5736c","https://github.com/emiago/sipgo","https://github.com/emiago/sipgo/releases/tag/v1.4.1"],"sourceUrl":"https://github.com/advisories/GHSA-pg59-5vwg-4jxq","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-pg59-5vwg-4jxq","identifiers":["GHSA-pg59-5vwg-4jxq","CVE-2026-58268","GO-2026-6550"]},"retained":false,"historicalAffected":[]}],"coverage":[]}