# GHSA-QM2P-4W45-V2VR: grcov has an out of bounds write triggered by crafted coverage data

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2025-02-10
- Modified: 2025-10-28

## Also published as

- [RUSTSEC-2025-0005](https://cve.now/RUSTSEC-2025-0005.md) (RustSec)

## Affected versions

- grcov (crates.io): fixed in 0.8.20

## Description

Function `grcov::covdir::get_coverage` uses the `unsafe` function `get_unchecked_mut` without validating that the index is in bounds.

This results in memory corruption, and could potentially allow arbitrary code execution provided that an attacker can feed the tool crafted coverage data.

## References

- https://github.com/mozilla/grcov/commit/c8219563bc91615dd4a27884a5c63f09db8d03bb
- https://bugzilla.mozilla.org/show_bug.cgi?id=1917475
- https://github.com/mozilla/grcov
- https://rustsec.org/advisories/RUSTSEC-2025-0005.html

Page: https://cve.now/GHSA-QM2P-4W45-V2VR

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
