HTTP/2: HPACK string length addition can overflow into out-of-bounds reads
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- networking, security
Research direction
Start at h2_decode_string_counted() in the HPACK decoder and trace how pos and str_len are derived before the bounds check. Rewrite the guard as str_len > len - *pos and reject oversized lengths before any allocation or Huffman/memcpy path runs. Then add a regression vector with a wrapped position-plus-length to the existing HPACK test suite and run it to confirm the reject path fires.
Written by the indexing model from the issue text.
Description
h2_decode_string_counted() checks *pos + str_len > len with size_t arithmetic. A large decoded length can wrap the sum and pass the check, after which Huffman decoding or memcpy reads beyond the header buffer. Use str_len > len - *pos and reject oversized values before advancing or allocating. Add a regression vector with a wrapped position-plus-length.
- Dominant language
- C
- Stars
- 16
- Forks
- 7
- Avg merge
- 4h 17m
- Merged PRs (30d)
- 198
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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 c4punks/CWIST
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
GXF: heap buffer overflow in parse_ad_cdp() — unbounded cc_count in CDP cc data sectionPossibly taken @pranayr710 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CCExtractor/ccextractor#2498 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
area: services kind: bug preview-effort: small priority: low
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Static Analysis failurePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100