Repository navigation
feat: decide advisory host conditions from the URL's constant text - #171
Merged
Merged
Conversation
taint.urls states what a URL's constant text proves: a fixed origin, a fixed path, a reference on the current site, and whether a call disables redirects. ssrf now reads it with unchanged verdicts, and open-redirect draws its own: refuted on the current site, a hotspot on a fixed host.
A fixed host with redirects disabled rules the call out; with redirects followed the condition stays pending, naming the chain a redirect may open. The correlation reads the same URL proof as ssrf and open-redirect.
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
An advisory entry point may now declare a
hostcondition: exploiting it needs the attacker to choose the host of the URL passed as the named argument. The correlation decides the condition from the proofssrfandopen-redirectread (taint.urls, #168), with the advisory's own criteria. There is no exception coded per CVE: the data declares the requirement, and the engine decides it.Closes #170.
Stacked on #169. Merge #169 first; this PR then shows only its own two commits.
allow_redirects=False,follow_redirects=False)"https://api.example.com" + x), or the base is unknownThe environment conditions (
.netrc,trust_env, a proxy) stay pending, visible next to the host one.Design
check_conditions(entry, arguments, url, passed_as)decides ahostcondition when the attacker's input is passed in the argument it names, by keyword or position. Otherwise the condition stays pending.correlatereceives the URL proof of each advisory flow, which_analyse_modulecomputes withflow_url.hostcondition must name its argument and carry novaluesnordefault; the loader rejects anything else.argumentconditions are decided as before, andsemanticones stay pending.Verification
tests/test_advisory_url_host.py, a new file (no existing test file is modified):allow_redirects=False, keyword withfollow_redirects=False);The seven tests covering the new decisions failed before the change.
pytest: 1285 passed.pytest -m regression: 19 passed, unchanged.ruff checkandmypy: clean.The Enterprise plugins pass on this branch (257 tests).