Conversation
An http(s) scheme check still allowed 127.0.0.1 and the cloud metadata address. Re-check every redirect hop so a public URL cannot bounce inside. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Session 16 — graded ✅Score: +100.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks
fetch_urlonly checked that the scheme washttporhttps. That still admits:http://127.0.0.1:8111/...(the local gateway and control plane)http://169.254.169.254/(cloud metadata)http://192.168.x.x/and other RFC1918 spacefollow_redirects=Truemeant a public page could bounce the agent onto those addresses after the scheme check had already passed.A planner that is allowed
fetch_url(it is a shipped capability) can therefore read host-local HTTP from a prompt.Reproduction
On current
mainthis test fails (the URLs are accepted):Fix
Resolve the host, refuse loopback / private / link-local / metadata / reserved addresses, and re-check every redirect hop instead of following blindly.
uv run pytest tests/test_general_tools.pypasses.