CVE-2020-8927: Brotli Library Buffer Overflow

brotli Updated 02 Oct 2025

Summary

15/09/2020
Yes i
Unrated
Not published

CVE-2020-36846: A buffer overflow exists in the Brotli library versions prior to 1.0.8 where an attacker controlling the input length of a "one-shot" decompression request to a script can trigger a crash, which happens when copying over... Affects brotli versions < 1.0.8. Fixed in 1.0.8. How to fix ↓

Also tracked for

The same CVE-2020-36846 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Brotli library is a compression algorithm developed by Google. It is widely used for compressing data in various applications and libraries. The library provides both a "one-shot" API and a "streaming" API for decompression. The vulnerability in the Brotli library versions prior to 1.0.8 allows an attacker to trigger a buffer overflow by controlling the input length of a "one-shot" decompression request. This can lead to a crash when copying over chunks of data larger than 2 GiB.

Vulnerability Detail

The buffer overflow vulnerability in the Brotli library arises due to improper handling of input length in a "one-shot" decompression request. By manipulating the input length, an attacker can cause the library to copy chunks of data larger than 2 GiB, resulting in a buffer overflow. This can lead to a crash of the application using the library. The impact of this vulnerability can vary depending on the context in which the library is used. In some cases, it may allow an attacker to execute arbitrary code or cause a denial-of-service condition.

How To Fix

Latest published version: 1.2.1 as of 22 Oct 2026

pip install --upgrade "brotli==1.2.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.0.8

This is the first release that contains the fix.

pip install --upgrade "brotli==1.0.8"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the Brotli library is not feasible, using the "streaming" API instead of the "one-shot" API can provide a workaround. By using the "streaming" API, the decompression process can be divided into smaller chunks, reducing the risk of triggering the buffer overflow. Here is an example of using the "streaming" API in Python:

import brotli

def decompress_data(data):
    decompressor = brotli.Decompressor()
    output = b''
    for chunk in data:
        output += decompressor.process(chunk)
    output += decompressor.finish()
    return output

In this example, the data is decompressed in smaller chunks using the process() method of the decompressor object.

Conclusion

The buffer overflow vulnerability in the Brotli library can be mitigated by updating to version 1.0.8 or later. If updating is not possible, using the "streaming" API and imposing chunk size limits can provide a workaround. It is important to take action to protect systems and applications that use the Brotli library. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for brotli →

Share this vulnerability

FAQ

The Brotli library is a compression algorithm developed by Google. It is designed to provide high compression ratios while maintaining fast decompression speeds.

The vulnerability affects Brotli library versions prior to 1.0.8.

The impact of this vulnerability can vary depending on the context in which the library is used. It may allow an attacker to execute arbitrary code or cause a denial-of-service condition.

To fix this vulnerability, it is recommended to update the Brotli library to version 1.0.8 or later. Alternatively, you can use the "streaming" API instead of the "one-shot" API and impose chunk size limits.

Yes, if updating the Brotli library is not feasible, you can use the "streaming" API instead of the "one-shot" API. This can help mitigate the risk of triggering the buffer overflow.

Related vulnerabilities

Recent vulnerabilities recorded for brotli.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 1.2.1 as of 22 Oct 2026

pip install --upgrade "brotli==1.2.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.0.8

This is the first release that contains the fix.

pip install --upgrade "brotli==1.0.8"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback