Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm

GHSA-9vx6-7xxf-x967

MEDIUM

OpenZeppelin Contracts base64 encoding may read from potentially dirty memory

Also known asCVE-2024-27094
Published
Feb 29, 2024
Updated
Dec 5, 2025
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed

EPSS Exploitation Probability

via FIRST.org ↗
0.8%probability of exploitation in next 30 days
Lower Risk51th percentile+0.20%
0.00%0.42%0.84%1.26%0.2%0.8%Dec 25Apr 26Jun 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Blast Radius

4 pkgs affected

Weekly download volume for affected packages — a proxy for how broadly this vulnerability is deployed.

@openzeppelin/contractsnpm
1.0Mdownloads / week
@openzeppelin/contracts-upgradeablenpm
264Kdownloads / week

Description

Impact

The Base64.encode function encodes a bytes input by iterating over it in chunks of 3 bytes. When this input is not a multiple of 3, the last iteration may read parts of the memory that are beyond the input buffer.

Although the encode function pads the output for these cases, up to 4 bits of data are kept between the encoding and padding, corrupting the output if these bits were dirty (i.e. memory after the input is not 0). These conditions are more frequent in the following scenarios:

  • A bytes memory struct is allocated just after the input and the first bytes of it are non-zero.
  • The memory pointer is set to a non-empty memory location before allocating the input.

Developers should evaluate whether the extra bits can be maliciously manipulated by an attacker.

Patches

Upgrade to 5.0.2 or 4.9.6.

References

This issue was reported by the Independent Security Researcher Riley Holterhus through Immunefi (@rileyholterhus on X)

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
📦npm@openzeppelin/contracts4.5.0&&< 4.9.64.9.6
📦npm@openzeppelin/contracts-upgradeable5.0.0-rc.0&&< 5.0.25.0.2
📦npm@openzeppelin/contracts5.0.0-rc.0&&< 5.0.25.0.2
📦npm@openzeppelin/contracts-upgradeable4.5.0&&< 4.9.64.9.6

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @openzeppelin/contracts. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update @openzeppelin/contracts to 4.9.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-9vx6-7xxf-x967 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-9vx6-7xxf-x967 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-9vx6-7xxf-x967. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Impact The `Base64.encode` function encodes a `bytes` input by iterating over it in chunks of 3 bytes. When this input is not a multiple of 3, the last iteration may read parts of the memory that are beyond the input buffer. Although the `encode` function pads the output for these cases, up to 4 bits of data are kept between the encoding and padding, corrupting the output if these bits were dirty (i.e. memory after the input is not 0). These conditions are more frequent in the following scenarios: - A `bytes memory` struct is allocated just after the input and the first bytes of it are
O3 Security · Impact-Aware SCA

Is GHSA-9vx6-7xxf-x967 in your dependencies?

O3 detects GHSA-9vx6-7xxf-x967 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.