GHSA-pg59-5vwg-4jxq: High severity go/github.com/emiago/sipgo vulnerability

Published Sep 22, 2026
·
Updated

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/parserstream.go#L195):

go 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/parserstream.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.

Affected Software

1 affected componentFixes available
go/github.com/emiago/sipgo<=1.4.0
1.4.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/emiago/sipgo to a version that resolves this vulnerability.

    Fixed in 1.4.1
  2. Compensating control

    In sipgo's stream parser, validate the client-controlled contentLength against ParseMaxMessageLength before allocating the SIP body buffer in ParserStream.parseSingle.

Event History

Sep 22, 2026
Advisory Published
via GitHub·07:57 PM
Data Sourced
via GitHub·07:57 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What systems are exposed to this denial of service?

SIP servers that use the affected stream parser to process SIP messages received over a network are exposed. An unauthenticated remote client can send a crafted SIP message with an oversized Content-Length value.

2

Does the configured maximum message length prevent the allocation?

No. The parser allocates the body buffer using the client-controlled Content-Length before the ParseMaxMessageLength check in the caller runs, so the 65535 maximum does not prevent the oversized allocation.

3

What does an attacker need to send?

The attacker needs only to send a single SIP message containing a very large Content-Length header; a message body is not required. The declared value can be up to 2^32-1 because it is parsed as a uint32.

4

What can be done if updating is not immediately possible?

The suggested mitigation is to validate Content-Length against ParseMaxMessageLength before allocating the body buffer. Network-level restrictions that prevent untrusted clients from reaching the SIP service can also reduce exposure, but no product-specific workaround is provided.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203