CVE-2021-28027 — bam
CRITICALCVE-2021-28027 is a critical-severity (CVSS 9.8) CWE-191 vulnerability in bam. A fix is available for bam — see the affected versions and patch details below.
Loading a bgzip block can write out of bounds if size overflows.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
bamReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
An issue was discovered in the bam crate before 0.1.3 for Rust. There is an integer underflow and out-of-bounds write during the loading of a bgzip block.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | bam | all versions | 0.1.3cargo update -p bam --precise 0.1.3 |
Affected Products
bambam_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for bam, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update bam to 0.1.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-28027 is resolved across your whole dependency graph.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Frequently Asked Questions
Is CVE-2021-28027 in your dependencies?
Find it across crates.io, including transitive dependencies.