Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2024-27094
JavaScript vulnerability analysis and mitigation

Overview

OpenZeppelin Contracts, a library for secure smart contract development, disclosed a vulnerability (CVE-2024-27094) in its Base64.encode function. The vulnerability was discovered in versions >=4.5.0 <5.0.2 of both @openzeppelin/contracts and @openzeppelin/contracts-upgradeable packages. The issue was reported by Independent Security Researcher Riley Holterhus through Immunefi and has been fixed in versions 5.0.2 and 4.9.6 (GitHub Advisory).

Technical details

The Base64.encode function processes bytes input by iterating over it in chunks of 3 bytes. When the input length is not a multiple of 3, the last iteration may read memory beyond the input buffer. Although the function implements padding for these cases, up to 4 bits of data are retained between the encoding and padding stages. If the memory after the input contains non-zero values (dirty memory), these bits can corrupt the output. This issue is more likely to occur when either a bytes memory struct with non-zero initial bytes is allocated immediately after the input, or when the memory pointer is set to a non-empty memory location before allocating the input (GitHub Advisory).

Impact

The vulnerability has been rated as LOW severity. While the issue can lead to corrupted Base64 encoding output when specific memory conditions are met, the impact is limited to scenarios where the extra bits can be maliciously manipulated by an attacker (GitHub Advisory).

Exploitability

The vulnerability requires specific conditions to be exploitable, particularly when dealing with input lengths that are not multiples of 3 bytes and when there is dirty memory present after the input buffer. The issue was discovered and reported through Immunefi's bug bounty program (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions 5.0.2 and 4.9.6 of both @openzeppelin/contracts and @openzeppelin/contracts-upgradeable packages. Users are advised to upgrade to these versions to address the issue (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-54504HIGH8.8
  • JavaScript logoJavaScript
  • @andrea9293/mcp-documentation-server
NoYesSep 17, 2026
CVE-2026-77615HIGH8.7
  • JavaScript logoJavaScript
  • org.opencastproject:opencast-engage-paella-player-7
NoYesSep 17, 2026
CVE-2026-91127HIGH8.2
  • JavaScript logoJavaScript
  • @file-viewer/doc
NoYesSep 18, 2026
CVE-2026-77301HIGH7.5
  • JavaScript logoJavaScript
  • adm-zip
NoYesSep 18, 2026
CVE-2026-84992MEDIUM6.1
  • JavaScript logoJavaScript
  • md-editor-v3
NoYesSep 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management