Repository navigation
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
|
So the problem with 1.2.0 is that it's vulnerable for CVE-2026-111497 'Node2Shell'. (see #1311, this happened AFTER your PR). So it probably would be better to test for minimum version 1.2.1 instead. Also, the error ""neither of the 'brotlicffi' or 'brotli' packages have been installed". should be improved/changed to reflect the version number. |
Check `brotli>=1.2.1` and `brotlicffi>=1.2.1.0` instead of probing for `output_buffer_limit`, since earlier releases are vulnerable to CVE-2026-111497 (GHSA-9v8h-qqgm-4m35). Raise the `brotli` extra to the same minimums and name them in the missing-decoder error.
output_buffer_limit support as unavailablebr decoding
|
Thanks, done in 5284c1d. The import-time check now requires |
|
Closing as per #1296 (comment). |
Summary
Closes #1296.
BrotliDecodercallsprocess()/decompress()withoutput_buffer_limit, which only exists in Brotli >= 1.2.0 and brotlicffi >= 1.2.0.0. Thebrotliextra declares minimum versions, but packages that depend on plainhttpx2(for examplehuggingface_hub) can end up with an older Brotli that happens to be installed already. In that case anybrresponse crashes withTypeError: process() takes no keyword arguments.This PR checks the importable binding's
__version__once at import time and requiresbrotli>=1.2.1orbrotlicffi>=1.2.1.0. Earlier releases are vulnerable to CVE-2026-111497 (GHSA-9v8h-qqgm-4m35), as noted in #1311. A binding below the minimum is treated like a missing Brotli install:bris removed fromSUPPORTED_DECODERS, so it is no longer advertised inAccept-Encoding. Ifbrotliis too old,brotlicffiis tried next.The
brotliextra is raised to the same minimums, and the missing-decoder error now names them.Checked against an installed Brotli:
Brotli==1.1.0before:TypeError: process() takes no keyword argumentsBrotli==1.2.0after:bris not supported, andBrotliDecoder()raisesUsing 'BrotliDecoder', but neither 'brotli>=1.2.1' nor 'brotlicffi>=1.2.1.0' is installed.Brotli==1.2.1after:brdecodes normallyChecklist