Repository navigation
fix: prevent SSRF in fetch_url - #106
Merged
knight22-21 merged 1 commit intoOct 17, 2026
Merged
Conversation
Owner
|
Thanks for the fix, @mikemikimike! Pinning connections to validated public IPs, blocking non-public ranges, and re-validating redirect hops thoroughly addresses the SSRF vulnerability in \etch_url. If you find DevAgent useful, a ⭐ on the repo would mean a lot — no pressure though! |
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.
Summary
fetch_url()allowed agent-directed requests to cloud metadata and private services. This PR validates DNS results before connecting and rechecks every redirect.Changes
Tests
python -m pytest tests/test_phase11.py -k fetch_url -v --tb=shortpython -m pytest tests/ -v --tb=shorton Python 3.12 and 3.13: 842 passed, 1 skipped (the optional notebook suite requiresnbformat).python -m ruff check devagent/ tests/python -m buildgit diff --checkCompatibility / Known limitations
ruff format --checkreports formatting differences that are also present in the unmodified baseline; no formatting-only changes are included. The repository CI workflow does not run this formatter check.mypypasses fordevagent/tools/web_tools.py; checking the test module reports 9 pre-existing attribute errors because the Web Search test helpers are annotated asobject.Fixes #101: #101