Skip to content

fix(rwa): resolve C-01 and C-02 recovery vulnerabilities in RWA storage - #953

Closed
mertcano wants to merge 2 commits into
OpenZeppelin:mainfrom
mertcano:mertcano-patch-3
Closed

mertcano wants to merge 2 commits into
OpenZeppelin:mainfrom
mertcano:mertcano-patch-3

Conversation

@mertcano

Copy link
Copy Markdown

Fixes #???

Description

This PR addresses and resolves critical security findings identified in the RWA Token module during the v0.5.0 audit:

  1. C-01: Unbounded Inflation via Self-Recovery in recovery_address[cite: 136, 148]

    • Prevents self-recovery exploits and potential inflation vectors within recover_balance[cite: 136, 148].
    • Ensures strict validation constraints when transferring balances and states between accounts during recovery[cite: 140].
  2. C-02: Missing Same-Identity Check in recovery_address Enables Malicious Recovery[cite: 136, 149]

    • Enforces strict verification of the recovery target via identity_verifier_client.recovery_target(old_account)[cite: 140, 149].
    • Validates that recovery_target matches the new_account address to prevent unauthorized asset migration or hijacking[cite: 140, 149].

PR Checklist

  • Tests
  • Documentation

<!-- Thank you for your interest in contributing to OpenZeppelin! -->

<!-- Consider opening an issue for discussion prior to submitting a PR. -->
<!-- New features will be merged faster if they were first discussed and designed with the team. -->

Fixes #??? <!-- Fill in with issue number -->

## Description

This PR addresses and resolves critical security findings identified in the **RWA Token** module during the v0.5.0 audit:

1. **C-01: Unbounded Inflation via Self-Recovery in `recovery_address`**[cite: 136, 148]
   - Prevents self-recovery exploits and potential inflation vectors within `recover_balance`[cite: 136, 148].
   - Ensures strict validation constraints when transferring balances and states between accounts during recovery[cite: 140].

2. **C-02: Missing Same-Identity Check in `recovery_address` Enables Malicious Recovery**[cite: 136, 149]
   - Enforces strict verification of the recovery target via `identity_verifier_client.recovery_target(old_account)`[cite: 140, 149].
   - Validates that `recovery_target` matches the `new_account` address to prevent unauthorized asset migration or hijacking[cite: 140, 149].

#### PR Checklist

<!-- For the PRs that introduce new features, all of the following must be complete. -->
<!-- Feel free to submit a PR or Draft PR even if some items are pending. -->
<!-- Some of the items below may not apply to your case (for example: fixing a typo). -->

- [x] Tests
- [x] Documentation
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 108b12ea-c98f-40b1-a2f9-ca43ea81d9ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brozorec brozorec closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants