GHSA-qm2p-4w45-v2vr: Grcov Grcov Has An Out Of Vulnerability

MODERATE
CWE-787
Published
Advisory Summary

GHSA-qm2p-4w45-v2vr is a MODERATE grcov has an out of vulnerability (CWE-787: Out-of-bounds Write) affecting Grcov libraries in the crates.io ecosystem. The issue involves grcov has an out of bounds write triggered by crafted coverage data. Remediation is available by upgrading affected packages to version 0.8.20.

GHSA-qm2p-4w45-v2vr at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-qm2p-4w45-v2vr
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Grcov
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-qm2p-4w45-v2vr

To remediate this vulnerability, upgrade all affected Grcov dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

grcov fixed: 0.8.20
Upgrade grcov to 0.8.20
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for grcov

How to Check if You Are Affected

To determine whether your application is affected by GHSA-qm2p-4w45-v2vr, inspect your project dependencies for Grcov:

inspect dependencies for grcov

Analyze the terminal output to locate any version of Grcov in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.20), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Grcov, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-qm2p-4w45-v2vr Affected Grcov Versions

1 component(s)
Fixed Versions:
0.8.20
Product / Package Ecosystem Affected Versions Fixed Version
grcov
crates.io
< 0.8.20
0.8.20

References

Frequently Asked Questions

What is GHSA-qm2p-4w45-v2vr?
GHSA-qm2p-4w45-v2vr is a security vulnerability in Grcov involving grcov has an out of bounds write triggered by crafted coverage data under CWE-787: Out-of-bounds Write.
Which Grcov versions are affected?
Affected versions include releases prior to 0.8.20 across affected packages: grcov.
What version fixes GHSA-qm2p-4w45-v2vr?
Upgrading to 0.8.20 (or the latest patched release for your respective branch) resolves the vulnerability.
Is grcov affected?
Yes, grcov is affected in releases prior to 0.8.20. Upgrade your dependency to 0.8.20 or later.
What CWE is associated with GHSA-qm2p-4w45-v2vr?
GHSA-qm2p-4w45-v2vr is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check crates.io dependencies for GHSA-qm2p-4w45-v2vr?
Run the dependency tree command: 'inspect dependencies for grcov'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qm2p-4w45-v2vr",
  "modified" : "2025-02-10T18:07:30Z",
  "published" : "2025-02-10T18:07:30Z",
  "aliases" : [ ],
  "summary" : "grcov has an out of bounds write triggered by crafted coverage data",
  "details" : "Function `grcov::covdir::get_coverage` uses the `unsafe` function `get_unchecked_mut` without validating that the index is in bounds.\n\nThis results in memory corruption, and could potentially allow arbitrary code execution provided that an attacker can feed the tool crafted coverage data.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "grcov"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.20"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mozilla/grcov/commit/c8219563bc91615dd4a27884a5c63f09db8d03bb"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.mozilla.org/show_bug.cgi?id=1917475"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mozilla/grcov"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2025-0005.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-10T18:07:30Z",
    "nvd_published_at" : null
  }
}