Repository navigation
Exclude Brotli from the default AutomaticDecompression while CVE-2026-111497 is unpatched in .NET - #2419
Exclude Brotli from the default AutomaticDecompression while CVE-2026-111497 is unpatched in .NET#2419K3UL wants to merge 2 commits into
Conversation
PR Summary by QodoExclude Brotli from default .NET decompression
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
The Brotli decoder vendored in the .NET runtime (System.IO.Compression.Native) has an out-of-bounds write, CVE-2026-111497, reachable from a crafted Content-Encoding: br response. No fixed runtime has shipped. With AutomaticDecompression defaulting to All, every RestClient built with default options advertised br and routed untrusted responses through that decoder. Default is now GZip | Deflate on .NET. Opting back in is one line: AutomaticDecompression = DecompressionMethods.All. .NET Framework default (GZip) is unchanged.
…erver is returned undecoded
44139b4 to
90c3011
Compare
|
@dotnet-policy-service agree |
|



Issue
Resolves #2420
Why
CVE-2026-111497 (CVSS 4.0: 9.2) is an out-of-bounds write in Google's Brotli C decoder, versions 1.0.3–1.2.0. The .NET runtime vendors that decoder (
src/native/external/brotli, currently 1.1.0 onrelease/9.0–main, 1.0.9 onrelease/8.0) and exposes it throughHttpClientautomatic decompression. As of 2026-10-24 no .NET servicing release contains the fix and no public branch ofdotnet/runtimehas it (checked: theBLOCK_SWITCHerror code and theDecodeBlockTypeAndLengthsignature change are absent on every branch touched this month).The bug is reachable from the client side: a server the application calls replies with a crafted
Content-Encoding: brbody, and the client's automatic decompression feeds it to the decoder. Imperva demonstrated code execution through this path on Node.js; public PoCs exist.HttpClientHandler.AutomaticDecompressiondefaults toNone, so a plainHttpClientis not exposed.RestClientOptions.AutomaticDecompressiondefaults toAll, so everyRestClientbuilt with default options is, without the caller ever having mentioned Brotli.What
RestClientOptions.AutomaticDecompressiondefault on .NET changes fromAlltoGZip | Deflate. .NET Framework (GZip) is unchanged.configuration.mdand the changelog explain why and how to opt back in.brnor decodes abrresponse; a client withAllstill does. AllCompressionTestspass on net10.0.Impact on users
AutomaticDecompression = DecompressionMethods.All.Follow-up
Once Microsoft ships fixed runtimes (8.0.x / 9.0.x / 10.0.x servicing), a follow-up PR can decide whether to return the default to
All. Because RestSharp supports runtimes that will stay unpatched (apps pinned to older patch levels, self-contained deployments), I'd argue for keepingGZip | Deflateas the permanent default and treating Brotli as opt-in, but that's a separate discussion.Alternative if this is too invasive
A docs-only change: keep
All, add the warning block fromconfiguration.mdand a pinned security advisory recommendingGZip | Deflateuntil patched. Protects only readers of the docs, but is non-breaking.References: