`response_to_event_dict` crashes on repeated Content-Length headers, dropping the http batch
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
Research direction
Start in bbot/core/helpers/web/response_event.py at line 43, where header_dict lowercases names, turns - into _ and joins repeats with ", " before the bare int() on content_length; that join is why "1, 1" reaches the parser. Reproduce with the two-header response in the issue, then decide how duplicate lengths should collapse to a single value. Also read handle_batch in the http module for the 429 rescheduling that a throw skips, and check wayback/lightfuzz callers. Done means the duplicate-header response yields an event and the batch keeps processing.
Written by the indexing model from the issue text.
Description
response_to_event_dict (bbot/core/helpers/web/response_event.py:43) parses content_length with a bare int() on the header value. While building header_dict, it lowercases header names, turns - into _, and joins repeated headers with ", ". A response with two Content-Length headers, or with both Content-Length and Content_Length, reaches int() as "1, 1" or "1, nope" and raises ValueError.
Repeated identical Content-Length values are valid (RFC 9110, section 8.6) and blasthttp accepts them, so ordinary servers can trigger this, not only crafted responses.
In the http module the exception escapes handle_batch, so every result still left in that batch is dropped, not just the bad one. The scan logs Error in http.handle_batch(...). It also skips the end of handle_batch, so an event already held back for a 429 retry in the same batch is never rescheduled. wayback and lightfuzz call the same function.
To reproduce, serve:
HTTP/1.1 200 OK
Content-Length: 1
Content-Length: 1
X
and pass the blasthttp response to response_to_event_dict:
ValueError: invalid literal for int() with base 10: '1, 1'
- Dominant language
- Python
- Stars
- 10.9k
- Forks
- 959
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 84
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blacklanternsecurity/bbot
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
blacklanternsecurity/bbot#3679 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
blacklanternsecurity/bbot#3671 ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 22/100
blacklanternsecurity/bbot#3646 · 2 reactions ·
Maintainers usually reply within 2 days
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 58/100
blacklanternsecurity/bbot#3630 · 1 assignee ·
Maintainers usually reply within 2 days
-
Publish python deps for modules as optional depencency groupsPossibly taken @liquidsec claimed this 27 days ago. Openenhancement
blacklanternsecurity/bbot#3581 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
All issues in blacklanternsecurity/bbot
Similar issues
-
eegprep-lean: set channel types from the Zarr group's channel_typePossibly taken @claude claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
sccn/eegprep#668 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Link Checker ReportOpenBot Type: Bug Type: Documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
speakeasy-api/speakeasy#2159 ·
Maintainers usually reply within 1 day
-
area: ci enhancement perceived difficulty: 1
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Nitjsefnie-Harness-Commons/daedalus#1826 ·
Maintainers usually reply within 1 day