Skip to content

Add libFuzzer target for BrotliDecoderAttachDictionary overflow#1443

Open
0xazanul wants to merge 2 commits intogoogle:masterfrom
0xazanul:add-fuzz-attach-dictionary
Open

Add libFuzzer target for BrotliDecoderAttachDictionary overflow#1443
0xazanul wants to merge 2 commits intogoogle:masterfrom
0xazanul:add-fuzz-attach-dictionary

Conversation

@0xazanul
Copy link
Copy Markdown
Contributor

This PR adds a libFuzzer target for BrotliDecoderAttachDictionary().

The fuzz target exposes an integer overflow in AttachCompoundDictionary()
(c/dec/decode.c:1545), where a size_t value is truncated to int:

addon->total_size += (int)size;

When size > INT_MAX, this results in signed integer overflow and corrupts
addon->total_size.

The corrupted state propagates into
EnsureCompoundDictionaryInitialized(), and under fuzzing leads to
memory corruption and a segmentation fault in
BrotliTransformDictionaryWord().

Reproducibility:

  • Triggered using libFuzzer with AddressSanitizer and UBSan enabled
  • UBSan reports signed integer overflow
  • AddressSanitizer reports a segmentation fault

This fuzz target improves test coverage and enables integration
with OSS-Fuzz to detect this issue and similar regressions.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Mar 31, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@0xazanul
Copy link
Copy Markdown
Contributor Author

0xazanul commented Apr 3, 2026

Is there any update on this one ?

copybara-service Bot pushed a commit that referenced this pull request Apr 8, 2026
Thanks to @0xazanul who reported the problem in #1443

PiperOrigin-RevId: 896514011
@0xazanul
Copy link
Copy Markdown
Contributor Author

0xazanul commented Apr 8, 2026

Hey just for confirmation the issue i reported is in 1443 not 1438 , can u guys confirm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant