CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-29H2-JR22-FRMH

GHSA-29H2-JR22-FRMH: Improper Access Control and Handle Substitution in OpenZeppelin Confidential Contracts

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 25, 2026·6 min read·2 visits

Executive Summary (TL;DR)

OpenZeppelin Confidential Contracts prior to v0.3.2, v0.4.2, and v0.5.2 are vulnerable to handle substitution attacks. Untrusted external parties can return arbitrary encrypted handles that are consumed without ACL validation, resulting in side-channel plaintext leaks of private FHE states.

A critical access control vulnerability exists in the OpenZeppelin Confidential Contracts library for Fully Homomorphic Encryption (FHE) on EVM networks. Due to missing Access Control List (ACL) verification on encrypted FHE handles returned by untrusted external contracts, malicious actors can perform handle substitution attacks. This allows attackers to harvest unauthorized private FHE handles and leak their underlying plaintext values through logical side-channels in subsequent contract operations.

Vulnerability Overview

The @openzeppelin/confidential-contracts library provides essential primitives for constructing privacy-preserving tokens and financial instruments on EVM-compatible networks using Fully Homomorphic Encryption (FHE). Unlike standard transparent blockchains, FHE-enabled smart contracts perform computations on encrypted data states (such as private balances or boolean conditions) without ever decrypting them. The primary attack surface exposed by this architecture involves how data handles are passed across contract trust boundaries.

To interact with encrypted states within EVM constraints, frameworks like Zama's fhEVM represent encrypted payloads using global cryptographic reference pointers termed "handles" (e.g., ebool, euint64). The security and isolation of these handles rely on an Access Control List (ACL) enforced by the underlying virtual machine, which dictates which smart contracts have authorization to read or compute over specific handle IDs.

This vulnerability represents a systemic architectural validation failure in how handles returned by untrusted external contracts are ingested. Specifically, both VestingWalletConfidential and the ERC7984 transfer callback logic consume ciphertext handles from untrusted entities without verifying that the sending contract has ACL authorization over those handles. This allows an attacker to conduct a handle substitution attack, supplying sensitive handles belonging to other contracts and extracting their plaintext contents.

Root Cause Analysis

The fundamental root cause of the vulnerability is the implicit trust placed in FHE handles returned from external calls. In traditional Solidity development, returning an arbitrary data type does not compromise security because variables are scoped. However, FHE handles are global 32-bit or 64-bit integer values pointing to a shared enclave state. Because handles lack inherent namespaces, any contract can attempt to pass any handle ID to another contract.

In VestingWalletConfidential, the vestedAmount function calculates linear vesting by calling IERC7984(token).confidentialBalanceOf(address(this)). Because the returned balance handle was consumed in FHE arithmetic operations (FHE.add) without asserting that the token contract was ACL-authorized on that handle, a malicious token could return an arbitrary handle representing a sensitive private state of the wallet. The wallet would then perform arithmetic operations on this swapped handle and register transit permissions, creating an oracle that leaks private states.

In ERC7984 transfer callbacks, a similar flaw occurs during the evaluation of recipient responses. When performing a transfer with a callback, the token contract executes onConfidentialTransferReceived and expects an ebool handle indicating success or failure. The contract then uses this handle as a condition parameter in FHE.select to determine if a refund is required. Because there is no validation to confirm that the recipient has ACL authorization to the returned ebool, an attacker can pass a victim's encrypted boolean handle. The subsequent transaction execution patterns (whether a refund occurred or not) allow the attacker to deduce the underlying plaintext bit of the victim's handle.

Code-Level Analysis and Patch Diff

A detailed review of the patches reveals how validation controls were integrated to remediate the handle substitution vectors.

In VestingWalletConfidential.sol, the vulnerability was resolved by introducing a validation function, _checkTokenHandleAccess, which asserts that the token has ACL permissions for the returned handle before performing FHE arithmetic operations. Uninitialized handles (representing zero balances) are ignored to prevent honest zero-value transfers from reverting.

// Patched VestingWalletConfidential.sol
function vestedAmount(address token, uint48 timestamp) public virtual returns (euint128) {
    euint64 balance = IERC7984(token).confidentialBalanceOf(address(this));
    // Fix: Assert that the token contract is authorized on the returned handle
    _checkTokenHandleAccess(token, balance);
    return _vestingSchedule(FHE.add(released(token), balance), timestamp);
}
 
function _checkTokenHandleAccess(address token, euint64 handle) private view {
    require(
        !FHE.isInitialized(handle) || FHE.isAllowed(handle, token),
        VestingWalletConfidentialUnauthorizedHandle(handle, token)
    );
}

In ERC7984Utils.sol, the callback handler was fortified to ensure the recipient contract has actual permissions for the returned boolean handle. The logic checks that either the handle is uninitialized (handling non-FHE receivers safely) or that the recipient is authorized on it via FHE.isAllowed.

// Patched ERC7984Utils.sol
try IERC7984Receiver(to).onConfidentialTransferReceived(operator, from, amount, data) returns (
    ebool retval
) {
    // Fix: Enforce ACL authorization check on returned callback handle
    require(
        !FHE.isInitialized(retval) || FHE.isAllowed(retval, to),
        ERC7984UtilsUnauthorizedUseOfEncryptedAmount(retval, to)
    );
    return retval;
} catch (bytes memory reason) {
    // standard fallback handling
}

Exploitation Methodology & Side-Channel Mechanics

To exploit this vulnerability, an attacker constructs a malicious contract that registers as an ERC-7984 token or receiver, allowing them to inject targeted handles into the victim contract's execution thread.

In a callback-driven attack, the adversary target is a confidential boolean value (Target_Bool). The attacker deploys a contract implementing IERC7984Receiver and configures its onConfidentialTransferReceived function to return the handle ID of Target_Bool instead of a newly generated execution status. The attacker then executes a transfer targeting their own receiver contract.

When the token contract processes the transfer, it triggers the callback and receives the substituted handle. It then evaluates the conditional check FHE.select(Target_Bool, refundAmount, zeroAmount). Because the outcome of this transaction (specifically, whether the attacker receives a refund or not) is visible on-chain, the attacker directly observes the logical evaluation of Target_Bool. If the refund is executed, Target_Bool evaluated to false; otherwise, it evaluated to true. This side-channel completely decrypts the target boolean without requiring direct access keys.

Remediation and Mitigation Guidance

Remediation requires upgrading @openzeppelin/confidential-contracts dependencies to versions that enforce strict ACL validation. Project maintainers must audit their configurations to ensure they are on the patched release lines: 0.3.2 for the 0.3.x line, 0.4.2 for the 0.4.x line, and 0.5.2 for the 0.5.x line.

When developing custom FHE-based contracts outside of the OpenZeppelin ecosystem, engineers must follow defensive design principles for handles. Every external call that returns an FHE handle should be subjected to an explicit validation check using FHE.isAllowed(handle, sender) before incorporating the handle into internal arithmetic, comparison, or storage routines. Additionally, developers should design fallback mechanisms to ignore uninitialized handles to prevent Denial of Service (DoS) attacks on non-FHE integrations.

Official Patches

OpenZeppelinOfficial Security Advisory for GHSA-29H2-JR22-FRMH

Fix Analysis (3)

Technical Appendix

CVSS Score
7.1/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Affected Systems

OpenZeppelin Confidential Contracts library installations on EVM-compatible networks using FHE schemas (such as Zama fhEVM).

Affected Versions Detail

Product
Affected Versions
Fixed Version
@openzeppelin/confidential-contracts
OpenZeppelin
< 0.3.20.3.2
@openzeppelin/confidential-contracts
OpenZeppelin
>= 0.4.0-rc.0, < 0.4.20.4.2
@openzeppelin/confidential-contracts
OpenZeppelin
>= 0.5.0-rc.0, < 0.5.20.5.2
AttributeDetail
CWE IDCWE-284: Improper Access Control
Attack VectorNetwork
CVSS v4.0 Score7.1
ImpactHigh (Unauthorized disclosure of FHE state plaintext)
Exploit Statuspoc
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1548Abuse Elevation Control Mechanism
Privilege Escalation
T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-284
Improper Access Control

The software does not restrict or incorrectly restricts access to a resource from an unauthorized actor.

Known Exploits & Detection

GitHub (Mock Unit Tests)Unit tests in the repository mock the deployment of an unauthorized receiver returning arbitrary victim handles to trigger handle consumption validation failures.

Vulnerability Timeline

VestingWalletConfidential validation patch committed (Commit 93e75ceed2b9648f53f9d133f431064353456805)
2026-07-29
ERC7984 Callback validation patch committed (Commit fe0863af2c9dce7614acce98720a913bf6a767a5)
2026-08-03
Uninitialized callback handle refinement patch committed (Commit ee47edf189ab681cebdad18bfb53dee541987be2)
2026-08-04
Advisory GHSA-29H2-JR22-FRMH officially published. Patched releases v0.3.2, v0.4.2, and v0.5.2 made public.
2026-09-25

References & Sources

  • [1]GitHub Security Advisory GHSA-29H2-JR22-FRMH
  • [2]Pull Request #423: Vesting Wallet Fix
  • [3]Pull Request #428: ERC7984 Callback Fix
  • [4]Pull Request #431: Uninitialized Return Fix

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•18 minutes ago•CVE-2026-57443
7.5

CVE-2026-57443: Unauthenticated Operations API Information Disclosure in SCBE-AETHERMOORE

An unauthenticated remote information disclosure vulnerability exists in the SCBE-AETHERMOORE geometric AI governance framework. The API endpoint `/api/ops/check-email` allows unauthenticated network actors to trigger administrative subprocesses and retrieve sensitive operator email digests from Gmail or ProtonMail mailboxes due to missing authentication controls and overly permissive CORS configurations.

Alon Barad
Alon Barad
1 views•6 min read
•about 2 hours ago•CVE-2026-86439
8.8

CVE-2026-86439: Path Traversal Vulnerability in knowns MCP Document and Memory Storage

A critical path traversal vulnerability (CWE-22) exists in knowns prior to version 0.30.0. The software fails to restrict file path arguments passed to Model Context Protocol (MCP) tools, permitting low-privilege users to escape the designated base storage directories and manipulate arbitrary markdown files on the host filesystem.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 3 hours ago•CVE-2026-61825
8.7

CVE-2026-61825: Stored Cross-Site Scripting (XSS) via data-html-content Sanitizer Bypass in code16/sharp

CVE-2026-61825 is a high-severity, stored Cross-Site Scripting (XSS) vulnerability identified in code16/sharp, a Laravel-based administrative framework. The flaw resides within the administrative backend's rich-text and markdown editor field formatter. By bypassing HTML sanitization via crafted elements containing the data-html-content attribute or iframe srcdoc execution parameters, lower-privileged users can inject and execute arbitrary JavaScript code.

Amit Schendel
Amit Schendel
5 views•5 min read
•about 4 hours ago•CVE-2026-61823
7.3

CVE-2026-61823: Stored Cross-Site Scripting (XSS) via iframe srcdoc Attribute in code16 Sharp

A stored cross-site scripting (XSS) vulnerability was identified in the content-management and administrative framework code16 Sharp. The flaw stems from an overly permissive HTML sanitization configuration that whitelists the 'srcdoc' attribute on HTML 'iframe' tags. When processed and stored, browsers render the content of this attribute by decoding nested HTML entities, converting sanitized elements back into executable code.

Amit Schendel
Amit Schendel
4 views•5 min read
•about 5 hours ago•CVE-2026-57440
7.5

CVE-2026-57440: Stored Cross-Site Scripting (XSS) in MediaWiki EmbedVideo Extension

CVE-2026-57440 is a high-severity stored Cross-Site Scripting (XSS) vulnerability affecting the EmbedVideo extension for MediaWiki. When the extension is configured with consent requirements disabled ($wgEmbedVideoRequireConsent = false), video URLs and service IDs are parsed and inserted directly into the 'src' attribute of a generated iframe element without sanitization or context-aware escaping. This allows an attacker with editing privileges to inject arbitrary JavaScript and execute malicious commands in the context of other users' sessions.

Alon Barad
Alon Barad
4 views•7 min read
•about 6 hours ago•CVE-2026-92161
9.8

CVE-2026-92161: Unauthenticated Account Takeover in FriendsOfFlarum OAuth Extension

A critical logical vulnerability in the FriendsOfFlarum OAuth (fof/oauth) extension allows unauthenticated remote attackers to perform complete account takeover, including administrative profiles. This vulnerability is caused by a failure to verify the email verification status returned by third-party identity providers such as Discord before asserting that the email is trusted and matching it to existing local accounts.

Amit Schendel
Amit Schendel
6 views•6 min read