Set url_extension on HTTP_RESPONSE events - #3406
Open
liquidsec wants to merge 1 commit into
Open
Conversation
HTTP_RESPONSE.sanitize_data() overrode URL_UNVERIFIED's without extracting the URL file extension, so url_extension was never set. Modules that filter on it (paramminer) let every static-file URL through, fuzzing PDFs, DOCXs and ZIPs with a full binary search across the wordlist. Extract the extension logic into DictEvent._set_url_extension() rather than adding a third copy, and call it from HTTP_RESPONSE. Populating url_extension would also newly subject HTTP_RESPONSE to the url_extension_special gate, hiding .js responses from every module that doesn't set accept_url_special. Add _url_special_filterable so events representing already-retrieved content stay exempt.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3406 +/- ##
=====================================
- Coverage 90% 90% -0%
=====================================
Files 454 454
Lines 47081 47096 +15
=====================================
+ Hits 42320 42329 +9
- Misses 4761 4767 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary✅ No significant performance changes detected (all changes <10%) 🐍 Python Version 3.11.16 |
liquidsec
added a commit
that referenced
this pull request
Aug 29, 2026
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.
Problem
HTTP_RESPONSE.sanitize_data()overridesURL_UNVERIFIED.sanitize_data()without callingsuper()and without extracting the URL file extension. Sinceurl_extensionis declared in__slots__with no default, it is never set on HTTP_RESPONSE events.Paramminer's
filter_eventreadsgetattr(event, "url_extension", None), getsNone, and lets every static-file URL through:Every PDF, DOCX, ZIP etc. then receives the full paramminer treatment: 2 baseline requests plus a 0.5s sleep, then a binary search across the 5,289-word wordlist (~13 rounds of ~40-param batches). On
wayback-heavyscans this dominates runtime and produces blasthttp timeouts. All three paramminer variants are affected, since they all watch HTTP_RESPONSE and sharefilter_event.This is the same class of bug as 52c0cc8, which hoisted
url_extensiontoDictEventso WEB_PARAMETER events would get it. HTTP_RESPONSE was missed because it overridessanitize_dataand never picks up the inherited logic.Fix
The extension logic was already duplicated between
DictEventandURL_UNVERIFIED, so it is extracted intoDictEvent._set_url_extension()and used at all three call sites rather than adding a third copy.The second half
Populating
url_extensionalone introduces a regression.url_extension_special: [js]is enforced inbbot/modules/base.py, and since 52c0cc8 that check applies to all event types rather than URL types only. Giving HTTP_RESPONSE the attribute newly drags it under that gate:httpfetches JS URLs (accept_url_special = True) and emits HTTP_RESPONSEs for them, whichbadsecretsand other content-analysis modules consume today. Without a guard they would silently stop.HTTP_RESPONSE was only ever exempt from that gate by accident, because it lacked the attribute.
_url_special_filterablemakes the exemption explicit: events representing already-retrieved content stay out of a gate whose purpose (perdefaults.yml: "URLs with these extensions are not distributed to modules") is deciding which URLs to hand out, not which response bodies to analyze.Notes
retirejsandlightfuzzare unaffected.retirejswatchesURL_UNVERIFIED, and lightfuzz's static filter is scoped toWEB_PARAMETER. Both types already hadurl_extension.The existing
TestParamminer_Getparams_filter_staticpassed before this fix, because it only asserted that no parameter was confirmed on the.pdfURL rather than that the work was skipped. It is strengthened here to assert the invariant, and both new tests fail without the one-line fix.