GHSA-r2x7-427f-rq69: Github.com/lin snow/ech0 Ech0 Has SSRF Vulnerability

MODERATE
CVSS 5.5
CWE-918
Published
Advisory Summary

GHSA-r2x7-427f-rq69 is a MODERATE (CVSS 5.5) ech0 has ssrf vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Github.com/lin snow/ech0 libraries in the Go ecosystem. The issue involves ech0 has ssrf via dns resolution bypass in webhook url validation. Remediation is available by upgrading affected packages to version 4.4.3.

GHSA-r2x7-427f-rq69 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-r2x7-427f-rq69
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Github.com/lin snow/ech0
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-r2x7-427f-rq69

To remediate this vulnerability, upgrade all affected Github.com/lin snow/ech0 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/lin-snow/ech0 fixed: 4.4.3
Upgrade github.com/lin-snow/ech0 to 4.4.3
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/lin-snow/ech0

How to Check if You Are Affected

To determine whether your application is affected by GHSA-r2x7-427f-rq69, inspect your project dependencies for Github.com/lin snow/ech0:

inspect dependencies for github.com/lin-snow/ech0

Analyze the terminal output to locate any version of Github.com/lin snow/ech0 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.3), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Github.com/lin snow/ech0, 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

## Summary The `validateWebhookURL` function in `webhook_setting_service.go` attempts to block webhooks targeting private/internal IP addresses, but only checks literal IP strings via `net.ParseIP()`. Hostnames that DNS-resolve to private IPs (e.g., `169.254.169.254.nip.io`, `10.0.0.1.nip.io`) bypass all checks, allowing an admin to create webhooks that make server-side requests to internal network services and cloud metadata endpoints. ## Details The vulnerability is in `validateWebhookURL` (`internal/service/setting/webhook_setting_service.go:180-199`): ```go func validateWebhookURL(rawURL string) error { parsed, err := url.Parse(rawURL) // ... host := strings.ToLower(parsed.Hostname()) if host == "" || host == "localhost" || strings.HasSuffix(host, ".local") { return errors.New(commonModel.INVALID_WEBHOOK_URL) } if ip := net.ParseIP(host); ip != nil { // <-- returns nil for hostnames if ip.IsLoopback() || ip.IsPrivate() || ip.IsLinkLocalMulticast() || ip.IsLinkLocalUnicast() || ip.IsUnspecified() { return errors.New(commonModel.INVALID_WEBHOOK_URL) } } return nil // hostname passes all checks unchecked } ``` `net.ParseIP("169.254.169.254.nip.io")` returns `nil` because it is not a literal IP address. The entire private IP check block is skipped, and the function returns `nil` (valid). Both HTTP clients that execute webhook requests use standard `http.Client` / `http.Transport` with no custom `DialContext` to verify resolved IPs: - **TestWebhook** (`webhook_setting_service.go:169`): `&http.Client{Timeout: 5 * time.Second}` - **Dispatcher** (`dispatcher.go:51-58`): `&http.Client{...Transport: &http.Transport{...}}` — no custom dialer The `Dispatcher.HandleObservation` (`dispatcher.go:67-81`) iterates all active webhooks and dispatches without re-validating URLs, so a stored malicious webhook triggers SSRF on every application event. **Execution flow:** 1. Admin calls POST `/api/webhook` with URL `http://169.254.169.254.nip.io/latest/meta-data/` 2. `CreateWebhook` → `validateWebhookURL` → `net.ParseIP` returns nil → passes validation 3. Webhook stored in database with `is_active: true` 4. On any echo event → `Dispatcher.HandleObservation` → `Dispatch` → `SendWithRetry` → DNS resolves `169.254.169.254.nip.io` to `169.254.169.254` → POST to cloud metadata endpoint ## PoC ```bash # Step 1: Create a webhook targeting cloud metadata via DNS rebinding curl -X POST http://localhost:8080/api/webhook \ -H 'Authorization: Bearer <admin-jwt>' \ -H 'Content-Type: application/json' \ -d '{"name":"ssrf-probe","url":"http://169.254.169.254.nip.io/latest/meta-data/","secret":"","is_active":true}' # Step 2: Trigger SSRF via test endpoint curl -X POST http://localhost:8080/api/webhook/<webhook-id>/test \ -H 'Authorization: Bearer <admin-jwt>' # The server makes an HTTP POST to 169.254.169.254 (AWS metadata). # net.ParseIP("169.254.169.254.nip.io") returns nil, skipping all IP checks. # Delivery status and error messages reveal connectivity information. # For internal network scanning: # http://10.0.0.1.nip.io:8080/ # http://127.0.0.1.nip.io:6379/ # With is_active:true, every application event automatically dispatches # to the SSRF target via Dispatcher.HandleObservation (no re-validation). ``` ## Impact - **Cloud metadata access:** An admin can reach cloud instance metadata endpoints (AWS `169.254.169.254`, GCP, Azure) to steal IAM credentials, instance identity tokens, and configuration data. - **Internal network probing:** Webhooks can scan internal services by observing delivery status (`success`/`failed`) and error messages, mapping internal network topology. - **Persistent SSRF:** Active webhooks fire on every application event via the Dispatcher, creating ongoing SSRF without further admin interaction. - **Scope escalation:** Impact escapes the application's security boundary to affect internal infrastructure, despite the application explicitly attempting to prevent this. ## Recommended Fix Replace the hostname-only check with a custom `net.Dialer` that resolves DNS and validates the resolved IP before connecting. Apply this to both HTTP clients: ```go import "net" func safeDialContext(ctx context.Context, network, addr string) (net.Conn, error) { host, port, err := net.SplitHostPort(addr) if err != nil { return nil, err } ips, err := net.DefaultResolver.LookupIPAddr(ctx, host) if err != nil { return nil, err } for _, ip := range ips { if ip.IP.IsLoopback() || ip.IP.IsPrivate() || ip.IP.IsLinkLocalUnicast() || ip.IP.IsLinkLocalMulticast() || ip.IP.IsUnspecified() { return nil, fmt.Errorf("resolved IP %s is not allowed", ip.IP) } } dialer := &net.Dialer{Timeout: 5 * time.Second} return dialer.DialContext(ctx, network, addr) } // Use in both TestWebhook and Dispatcher: client := &http.Client{ Timeout: 5 * time.Second, Transport: &http.Transport{ DialContext: safeDialContext, }, } ``` This ensures resolved IPs are checked against the private range blocklist regardless of hostname used.

GHSA-r2x7-427f-rq69 Affected Github.com/lin snow/ech0 Versions

1 component(s)
Fixed Versions:
4.4.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/lin-snow/ech0
Go
< 4.4.3
4.4.3

References

Frequently Asked Questions

What is GHSA-r2x7-427f-rq69?
GHSA-r2x7-427f-rq69 is a security vulnerability in Github.com/lin snow/ech0 involving Ech0 has SSRF via DNS Resolution Bypass in Webhook URL Validation under CWE-918: Server-Side Request Forgery (SSRF).
Which Github.com/lin snow/ech0 versions are affected?
Affected versions include releases prior to 4.4.3 across affected packages: github.com/lin-snow/ech0.
What version fixes GHSA-r2x7-427f-rq69?
Upgrading to 4.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/lin-snow/ech0 affected?
Yes, github.com/lin-snow/ech0 is affected in releases prior to 4.4.3. Upgrade your dependency to 4.4.3 or later.
What is the CVSS score of GHSA-r2x7-427f-rq69?
GHSA-r2x7-427f-rq69 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with GHSA-r2x7-427f-rq69?
GHSA-r2x7-427f-rq69 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Go dependencies for GHSA-r2x7-427f-rq69?
Run the dependency tree command: 'inspect dependencies for github.com/lin-snow/ech0'. 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-r2x7-427f-rq69",
  "modified" : "2026-04-10T19:49:49Z",
  "published" : "2026-04-10T19:49:48Z",
  "aliases" : [ ],
  "summary" : "Ech0 has SSRF via DNS Resolution Bypass in Webhook URL Validation",
  "details" : "## Summary\n\nThe `validateWebhookURL` function in `webhook_setting_service.go` attempts to block webhooks targeting private/internal IP addresses, but only checks literal IP strings via `net.ParseIP()`. Hostnames that DNS-resolve to private IPs (e.g., `169.254.169.254.nip.io`, `10.0.0.1.nip.io`) bypass all checks, allowing an admin to create webhooks that make server-side requests to internal network services and cloud metadata endpoints.\n\n## Details\n\nThe vulnerability is in `validateWebhookURL` (`internal/service/setting/webhook_setting_service.go:180-199`):\n\n```go\nfunc validateWebhookURL(rawURL string) error {\n    parsed, err := url.Parse(rawURL)\n    // ...\n    host := strings.ToLower(parsed.Hostname())\n    if host == \"\" || host == \"localhost\" || strings.HasSuffix(host, \".local\") {\n        return errors.New(commonModel.INVALID_WEBHOOK_URL)\n    }\n    if ip := net.ParseIP(host); ip != nil {  // <-- returns nil for hostnames\n        if ip.IsLoopback() || ip.IsPrivate() || ip.IsLinkLocalMulticast() ||\n            ip.IsLinkLocalUnicast() || ip.IsUnspecified() {\n            return errors.New(commonModel.INVALID_WEBHOOK_URL)\n        }\n    }\n    return nil  // hostname passes all checks unchecked\n}\n```\n\n`net.ParseIP(\"169.254.169.254.nip.io\")` returns `nil` because it is not a literal IP address. The entire private IP check block is skipped, and the function returns `nil` (valid).\n\nBoth HTTP clients that execute webhook requests use standard `http.Client` / `http.Transport` with no custom `DialContext` to verify resolved IPs:\n\n- **TestWebhook** (`webhook_setting_service.go:169`): `&http.Client{Timeout: 5 * time.Second}`\n- **Dispatcher** (`dispatcher.go:51-58`): `&http.Client{...Transport: &http.Transport{...}}` — no custom dialer\n\nThe `Dispatcher.HandleObservation` (`dispatcher.go:67-81`) iterates all active webhooks and dispatches without re-validating URLs, so a stored malicious webhook triggers SSRF on every application event.\n\n**Execution flow:**\n1. Admin calls POST `/api/webhook` with URL `http://169.254.169.254.nip.io/latest/meta-data/`\n2. `CreateWebhook` → `validateWebhookURL` → `net.ParseIP` returns nil → passes validation\n3. Webhook stored in database with `is_active: true`\n4. On any echo event → `Dispatcher.HandleObservation` → `Dispatch` → `SendWithRetry` → DNS resolves `169.254.169.254.nip.io` to `169.254.169.254` → POST to cloud metadata endpoint\n\n## PoC\n\n```bash\n# Step 1: Create a webhook targeting cloud metadata via DNS rebinding\ncurl -X POST http://localhost:8080/api/webhook \\\n  -H 'Authorization: Bearer <admin-jwt>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"name\":\"ssrf-probe\",\"url\":\"http://169.254.169.254.nip.io/latest/meta-data/\",\"secret\":\"\",\"is_active\":true}'\n\n# Step 2: Trigger SSRF via test endpoint\ncurl -X POST http://localhost:8080/api/webhook/<webhook-id>/test \\\n  -H 'Authorization: Bearer <admin-jwt>'\n\n# The server makes an HTTP POST to 169.254.169.254 (AWS metadata).\n# net.ParseIP(\"169.254.169.254.nip.io\") returns nil, skipping all IP checks.\n# Delivery status and error messages reveal connectivity information.\n\n# For internal network scanning:\n# http://10.0.0.1.nip.io:8080/\n# http://127.0.0.1.nip.io:6379/\n\n# With is_active:true, every application event automatically dispatches\n# to the SSRF target via Dispatcher.HandleObservation (no re-validation).\n```\n\n## Impact\n\n- **Cloud metadata access:** An admin can reach cloud instance metadata endpoints (AWS `169.254.169.254`, GCP, Azure) to steal IAM credentials, instance identity tokens, and configuration data.\n- **Internal network probing:** Webhooks can scan internal services by observing delivery status (`success`/`failed`) and error messages, mapping internal network topology.\n- **Persistent SSRF:** Active webhooks fire on every application event via the Dispatcher, creating ongoing SSRF without further admin interaction.\n- **Scope escalation:** Impact escapes the application's security boundary to affect internal infrastructure, despite the application explicitly attempting to prevent this.\n\n## Recommended Fix\n\nReplace the hostname-only check with a custom `net.Dialer` that resolves DNS and validates the resolved IP before connecting. Apply this to both HTTP clients:\n\n```go\nimport \"net\"\n\nfunc safeDialContext(ctx context.Context, network, addr string) (net.Conn, error) {\n    host, port, err := net.SplitHostPort(addr)\n    if err != nil {\n        return nil, err\n    }\n    ips, err := net.DefaultResolver.LookupIPAddr(ctx, host)\n    if err != nil {\n        return nil, err\n    }\n    for _, ip := range ips {\n        if ip.IP.IsLoopback() || ip.IP.IsPrivate() || ip.IP.IsLinkLocalUnicast() ||\n            ip.IP.IsLinkLocalMulticast() || ip.IP.IsUnspecified() {\n            return nil, fmt.Errorf(\"resolved IP %s is not allowed\", ip.IP)\n        }\n    }\n    dialer := &net.Dialer{Timeout: 5 * time.Second}\n    return dialer.DialContext(ctx, network, addr)\n}\n\n// Use in both TestWebhook and Dispatcher:\nclient := &http.Client{\n    Timeout: 5 * time.Second,\n    Transport: &http.Transport{\n        DialContext: safeDialContext,\n    },\n}\n```\n\nThis ensures resolved IPs are checked against the private range blocklist regardless of hostname used.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/lin-snow/ech0"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lin-snow/Ech0/security/advisories/GHSA-r2x7-427f-rq69"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lin-snow/Ech0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lin-snow/Ech0/releases/tag/v4.4.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T19:49:48Z",
    "nvd_published_at" : null
  }
}