/

CVE-2026-67346

Severity:

HIGH RISK

(8.6)

SSRF via Unsafe URL Validation (CWE-918) in Swarms App

CVE-2026-67346

Deferred

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Unauthorized access to internal services and data exfiltration

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Swarms through version 6.8.1 contains a server-side request forgery flaw in the _is_safe_url function, which incorrectly validates hostnames without performing DNS resolution.

By providing attacker-controlled image or audio URLs that resolve to private or loopback addresses, an attacker can reach internal services and potentially exfiltrate credentials or other sensitive data.

Swarms through version 6.8.1 contains a server-side request forgery flaw in the _is_safe_url function, which incorrectly validates hostnames without performing DNS resolution.

By providing attacker-controlled image or audio URLs that resolve to private or loopback addresses, an attacker can reach internal services and potentially exfiltrate credentials or other sensitive data.

Affected context

This vulnerability appears in deployments of the Swarms application that fetch user-supplied URLs on the server side, such as for image or audio processing.

It is relevant when Swarms is able to make outbound HTTP(S) requests and relies on hostname-based blocklists without validating the resolved IP addresses.

Environments where the application server has network access to internal services (e.g., metadata endpoints, private APIs, or database consoles) are more exposed, though actual reachability depends on local network configuration and firewall rules.

This vulnerability appears in deployments of the Swarms application that fetch user-supplied URLs on the server side, such as for image or audio processing.

It is relevant when Swarms is able to make outbound HTTP(S) requests and relies on hostname-based blocklists without validating the resolved IP addresses.

Environments where the application server has network access to internal services (e.g., metadata endpoints, private APIs, or database consoles) are more exposed, though actual reachability depends on local network configuration and firewall rules.

Exploit preconditions

  • Attack surface: Endpoints or features that accept user-controlled URLs for media (image, audio) retrieval or processing.
  • Required access: Ability to submit or influence URLs that the server will fetch (e.g., through form fields, API parameters, or content upload workflows).
  • Trigger point: The _is_safe_url validation logic runs when the server processes the URL and decides whether to perform the outbound request.
  • Why exploitation is possible: The safety check only inspects hostnames against a blocklist and does not perform DNS resolution or IP-based validation, allowing attackers to craft URLs that appear benign but resolve to private, loopback, or metadata IP ranges.
  • Attack surface: Endpoints or features that accept user-controlled URLs for media (image, audio) retrieval or processing.
  • Required access: Ability to submit or influence URLs that the server will fetch (e.g., through form fields, API parameters, or content upload workflows).
  • Trigger point: The _is_safe_url validation logic runs when the server processes the URL and decides whether to perform the outbound request.
  • Why exploitation is possible: The safety check only inspects hostnames against a blocklist and does not perform DNS resolution or IP-based validation, allowing attackers to craft URLs that appear benign but resolve to private, loopback, or metadata IP ranges.

Why this happens

The root cause is an incomplete URL safety validation routine that trusts hostname checks alone instead of validating the actual network endpoint being contacted.

This behavior maps to CWE-918: Server-Side Request Forgery (SSRF), where a server-side component makes unintended network requests to internal systems based on untrusted input.

The _is_safe_url function attempts to block certain hosts, but without DNS resolution and IP classification, it enables attackers to bypass the blocklist using domains or records that resolve to internal or sensitive IP addresses.

The root cause is an incomplete URL safety validation routine that trusts hostname checks alone instead of validating the actual network endpoint being contacted.

This behavior maps to CWE-918: Server-Side Request Forgery (SSRF), where a server-side component makes unintended network requests to internal systems based on untrusted input.

The _is_safe_url function attempts to block certain hosts, but without DNS resolution and IP classification, it enables attackers to bypass the blocklist using domains or records that resolve to internal or sensitive IP addresses.

Potential impact

  • Attackers may access internal HTTP services that are not exposed externally.
  • Attackers could reach cloud provider metadata endpoints and exfiltrate instance credentials or tokens.
  • Attackers can leverage the server as a proxy to scan internal networks and enumerate services.
  • Attackers may retrieve configuration files or sensitive application data exposed on internal endpoints.
  • Attackers could pivot to privilege escalation by abusing credentials or tokens obtained via SSRF.
  • Attackers may access internal HTTP services that are not exposed externally.
  • Attackers could reach cloud provider metadata endpoints and exfiltrate instance credentials or tokens.
  • Attackers can leverage the server as a proxy to scan internal networks and enumerate services.
  • Attackers may retrieve configuration files or sensitive application data exposed on internal endpoints.
  • Attackers could pivot to privilege escalation by abusing credentials or tokens obtained via SSRF.

General mitigation guidance

Effective mitigation focuses on minimizing trust in user-supplied URLs and constraining outbound requests from the server.

Common defensive patterns include:

  • Performing full DNS resolution for user-controlled URLs and validating the resulting IP against explicit allowlists or disallowing private, loopback, link-local, and metadata address ranges.
  • Restricting outbound network access from application servers using network policies or firewalls, so they cannot reach sensitive internal or metadata endpoints.
  • Centralizing URL-fetching logic behind a hardened proxy or dedicated service that enforces strict network and domain policies.
  • Applying least-privilege principles to any credentials accessible via metadata services, limiting their scope and impact if exposed.
  • Treating all remote resource URLs as untrusted input and avoiding automatic fetching where it is not strictly necessary.

Effective mitigation focuses on minimizing trust in user-supplied URLs and constraining outbound requests from the server.

Common defensive patterns include:

  • Performing full DNS resolution for user-controlled URLs and validating the resulting IP against explicit allowlists or disallowing private, loopback, link-local, and metadata address ranges.
  • Restricting outbound network access from application servers using network policies or firewalls, so they cannot reach sensitive internal or metadata endpoints.
  • Centralizing URL-fetching logic behind a hardened proxy or dedicated service that enforces strict network and domain policies.
  • Applying least-privilege principles to any credentials accessible via metadata services, limiting their scope and impact if exposed.
  • Treating all remote resource URLs as untrusted input and avoiding automatic fetching where it is not strictly necessary.

How teams detect issues like this

SSRF risks can be surfaced through a combination of code-centric and operational controls:

  • Static analysis and code review focused on functions that perform outbound HTTP requests based on user input, checking for proper DNS and IP validation.
  • Searching for custom "safe URL" helpers or blocklist-based validators and verifying that they include proper resolution and address classification logic.
  • Adding security tests that attempt to reach known internal or metadata endpoints through URL parameters, verifying that such requests are blocked.
  • Implementing observability around outbound HTTP traffic from the application (e.g., logging destinations and response metadata) and alerting on connections to internal IP ranges or metadata endpoints.
  • Using automated security testing tools or proxies that can simulate SSRF payloads as part of CI/CD pipelines to identify regressions early.

SSRF risks can be surfaced through a combination of code-centric and operational controls:

  • Static analysis and code review focused on functions that perform outbound HTTP requests based on user input, checking for proper DNS and IP validation.
  • Searching for custom "safe URL" helpers or blocklist-based validators and verifying that they include proper resolution and address classification logic.
  • Adding security tests that attempt to reach known internal or metadata endpoints through URL parameters, verifying that such requests are blocked.
  • Implementing observability around outbound HTTP traffic from the application (e.g., logging destinations and response metadata) and alerting on connections to internal IP ranges or metadata endpoints.
  • Using automated security testing tools or proxies that can simulate SSRF payloads as part of CI/CD pipelines to identify regressions early.

Sources

SourceLink
github.comgithub.com/kyegomez/swarms/commit/8b0fc9e4645603ad94d5fcf4da86e3b9c71f4743
github.comgithub.com/kyegomez/swarms/issues/1714
github.comgithub.com/kyegomez/swarms/pull/1734
vulncheck.comvulncheck.com/advisories/swarms-server-side-request-forgery-via-dns-rebinding-bypass

Frequently asked

questions

Yes, it can be exploited remotely whenever an attacker can supply URLs that the server will fetch on their behalf, such as image or audio URLs, assuming the application is reachable over the network.

An attacker generally needs the ability to interact with features that accept user-controlled URLs. No direct access to internal services is required; the attacker leverages the application server's network position instead.

The most robust approach is to treat all user-supplied URLs as untrusted, perform DNS resolution, validate the resulting IP addresses, and deny requests to private, loopback, and metadata ranges, ideally combined with strict outbound network restrictions.

Avoid designing features that automatically fetch remote resources based on user input whenever possible, centralize outbound HTTP requests through hardened components, and enforce IP-based allowlists and network-layer controls to constrain where servers can connect.

Yes, it can be exploited remotely whenever an attacker can supply URLs that the server will fetch on their behalf, such as image or audio URLs, assuming the application is reachable over the network.

An attacker generally needs the ability to interact with features that accept user-controlled URLs. No direct access to internal services is required; the attacker leverages the application server's network position instead.

The most robust approach is to treat all user-supplied URLs as untrusted, perform DNS resolution, validate the resulting IP addresses, and deny requests to private, loopback, and metadata ranges, ideally combined with strict outbound network restrictions.

Avoid designing features that automatically fetch remote resources based on user input whenever possible, centralize outbound HTTP requests through hardened components, and enforce IP-based allowlists and network-layer controls to constrain where servers can connect.

Find out what's already
exploitable in your codebase.