Skip to content

fix: add SSRF protection and enable TLS verification in URI source#313

Open
Joshua-Medvinsky wants to merge 1 commit into
trypromptly:mainfrom
Joshua-Medvinsky:fix/find-002-ssrf-uri-source
Open

fix: add SSRF protection and enable TLS verification in URI source#313
Joshua-Medvinsky wants to merge 1 commit into
trypromptly:mainfrom
Joshua-Medvinsky:fix/find-002-ssrf-uri-source

Conversation

@Joshua-Medvinsky
Copy link
Copy Markdown

Problem

The URI data source passes user-controlled URLs directly to requests.head() and requests.get() with verify=False, enabling SSRF attacks against internal services and cloud metadata endpoints, as well as MITM attacks on outbound connections.

Fix

  1. Add _is_private_url() validation function that blocks URLs pointing to private/internal IP ranges (RFC 1918, loopback, link-local, reserved) and known metadata hostnames.
  2. Change verify=False to verify=True in get_url_content_type().
  3. Raise ValueError when a private URL is detected.

Test Plan

  • Existing test suite passes
  • URLs with private IPs (127.0.0.1, 10.x.x.x, 169.254.169.254) are rejected
  • Public URLs (https://example.com) still work correctly
  • TLS verification is enforced on all outbound requests

Security Note

Severity: High — SSRF allows access to internal services and cloud metadata (AWS/GCP/Azure credentials). Disabled TLS verification enables MITM attacks.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

Someone is attempting to deploy a commit to the LLMStack Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant