Skip to content

[Bug] fetch_url Tool Doesn't Block IPv6 Loopback Address (::1) #734

Closed

Description

@akramcodez

Description

The fetch_url tool validator blocks common internal addresses (localhost, 127.0.0.1, 192.168.x.x) but does not block the IPv6 loopback address ::1. This means the SSRF guard can be bypassed by passing a URL like http://[::1]:8080.

Environment

  • OS: Any
  • Node version: Any
  • Nanocoder version: Latest
  • Provider: N/A
  • Model: N/A

Steps to Reproduce

  1. Open source/tools/fetch-url.tsx.
  2. Navigate to fetchUrlValidator (~line 150).
  3. Observe the hostname blocklist — localhost, 127.0.0.1, and 0.0.0.0 are present, but [::1] and ::1 are missing.
  4. Call the tool with url: "http://[::1]:8080" — it passes validation.

Expected Behavior

The validator should reject requests to [::1] and ::1 with the same error it gives for 127.0.0.1.

Actual Behavior

The request passes validation and proceeds to fetch content from the IPv6 loopback address.

Logs/Screenshots

N/A

Additional Context

  • url-utils.ts already includes [::1] and ::1 in its LOCAL_HOSTNAMES set — the validator in fetch-url.tsx simply missed them.
  • Fix: add hostname === '[::1]' and hostname === '::1' to the blocklist in fetchUrlValidator.
  • Note: This issue is intentionally kept small and is suitable for first-time contributors. If you're interested in working on it, please leave a comment below and ask to be assigned before opening a pull request.
  • I have searched existing issues to ensure this is not a duplicate
  • I can reproduce this issue consistently
  • This issue occurs with the latest version of nanocoder

Activity

  1. added
    bug
    good first issue
    on Aug 1, 2026
  2. nightcityblade commented on Aug 1, 2026

    @nightcityblade

    Hi, I'd like to work on this. Could you please assign it to me? I'll submit a focused PR shortly.

  3. MsadafK commented on Aug 1, 2026

    @MsadafK

    Hi @akramcodez , I would like to work on this issue. Please assign it to me!

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

Metadata

Metadata

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions