[BUG] [VSCODE] WebFetch should not attempt requests to RFC 1918 private network addresses
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
When Claude Code uses the WebFetch tool on a URL containing a private/internal IP address (RFC 1918), the request always fails because the tool runs externally and cannot reach the user's local network.
Currently there's no guardrail preventing this — Claude will attempt the fetch, wait for it to timeout or fail, and only then realize it can't access the resource.
Expected behavior
Claude Code should detect private network IPs before attempting the fetch and either:
- Skip the fetch and inform the user that private addresses are unreachable
- Suggest alternatives (e.g., asking the user to paste the content, or using
curlvia the Bash tool which runs locally)
Affected address ranges
Per RFC 1918 and related:
10.0.0.0/8172.16.0.0/12192.168.0.0/16127.0.0.0/8(loopback)::1,fc00::/7(IPv6 private/loopback)
Reproduction
- Have a service running on a local network (e.g.
http://192.168.1.100:5009/api/health) - Ask Claude Code to fetch or check that URL
- Claude attempts WebFetch, which fails
What Should Happen?
Suggested fix
Add a pre-flight check in the WebFetch tool that rejects private/loopback IPs with a clear message, so Claude can immediately fall back to local alternatives.
Error Messages/Logs
Steps to Reproduce
- Have a service running on a local network (e.g.
http://192.168.1.100:5009/api/health) - Ask Claude Code to fetch or check that URL
- Claude attempts WebFetch, which fails
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
8,010,114 Claude Code for VS Code
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗