Skip to content

fix(turnloop-http): decoder-only brotli 6.2, rejecting large-window streams - #132

Merged
proggeramlug merged 2 commits into
mainfrom
fix/brotli-decoder-only
Nov 8, 2026
Merged

proggeramlug merged 2 commits into
mainfrom
fix/brotli-decoder-only

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

turnloop-http only decodes Brotli, so it now depends on brotli-decompressor directly instead of the brotli umbrella crate. That takes the encoder out of every consumer's dependency graph. brotli remains a dev-dependency, because the tests use it to compress their fixtures.

Security hardening

  • Large-window Brotli is rejected. BrotliState::new also accepts the non-standard large-window format, whose window can reach 1 GiB. A tiny body could make the decoder allocate that before the decoded-size limit applies. This is the same denial of service as actix-http's RUSTSEC-2026-0455 (GHSA-7p9w-p5qm-5gc5). Content-Encoding: br means RFC 7932 Brotli, which is exactly what BrotliState::new_strict decodes. Node's decoder also rejects large windows by default. The new test large_window_brotli_is_rejected fails if the decoder goes back to new.

  • brotli-decompressor 5.0.3 → 6.2.0. 6.x has fixes that 5.0.3 lacks:

    • no decoder panics on malformed streams
    • a fix for a streaming bounds overflow
    • the uncompressed-metablock copy length is clamped
    • the correct error for CVE-2026-111497-shaped input

    6.2.0 is the newest release past the seven-day soak. 6.3.0 is 46 hours old and contains only performance work, with no security fixes.

  • brotli (dev-only) 8.0.4 → 9.1.1, the latest release.

Neither crate has a RustSec or GitHub advisory. cargo deny passes, and the soak check passes with 0 exceptions.

Closes #112.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 67a41b38-a782-4c06-ad6a-c0d9b4e7f41b
Commits

Reviewing files that changed from the base of the PR and between 7a1da11 and af4afc2.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 5

  • Cargo.toml
  • protocols/turnloop-http/Cargo.toml
  • protocols/turnloop-http/src/compression.rs
  • protocols/turnloop-http/src/recycling.rs
  • protocols/turnloop-http/tests/codecs.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@proggeramlug
proggeramlug force-pushed the fix/brotli-decoder-only branch from 8fc376f to c96a919 Compare November 8, 2026 07:04
…oder

turnloop-http only decodes, and every symbol it uses is exported by
brotli-decompressor, which the brotli umbrella crate wraps. Depending on it
directly drops the Brotli encoder (most of brotli's source) from every
consumer's graph. The encoder stays a dev-dependency for the test fixtures.

Closes #112
@proggeramlug
proggeramlug force-pushed the fix/brotli-decoder-only branch from c96a919 to dc8ea76 Compare November 8, 2026 07:14
BrotliState::new accepts the non-standard large-window format, whose
window reaches 1 GiB: an 850-byte body could make the decoder allocate
that before the decoded-size limit applies (the shape of actix-http's
RUSTSEC-2026-0455). Content-Encoding: br is RFC 7932 Brotli, which
new_strict decodes; Node's decoder also rejects large windows by default.

brotli-decompressor 6.2.0 also carries the 6.x hardening missing from
5.0.3: no panics on malformed streams, the streaming bounds overflow and
uncompressed-metablock length fixes, and the CVE-2026-111497 input
error. 6.3.0 (performance only) is younger than the seven-day soak. The
brotli encoder, a dev-dependency, moves to 9.1.1.
@proggeramlug proggeramlug changed the title fix(turnloop-http): depend on brotli-decompressor, not the brotli encoder fix(turnloop-http): decoder-only brotli 6.2, rejecting large-window streams Nov 8, 2026
@proggeramlug
proggeramlug merged commit d1186fb into main Nov 8, 2026
39 checks passed
@proggeramlug
proggeramlug deleted the fix/brotli-decoder-only branch November 8, 2026 07:29
proggeramlug added a commit that referenced this pull request Nov 8, 2026
The first beta: Perry's provider repairs (#131), the decoder-only brotli
dependency (#132) and HTTPS proxies (#133) are upstream, so Perry can
depend on published crates instead of a vendored copy.
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.

turnloop-http: depend on brotli-decompressor instead of brotli (decoder only)

1 participant