Skip to content

Fix: Prevent panics and enforce typed validation in cryptographic boundaries - #11

Open
mertcano wants to merge 1 commit into
Fairblock:masterfrom
mertcano:mertcano-patch-1
Open

mertcano wants to merge 1 commit into
Fairblock:masterfrom
mertcano:mertcano-patch-1

Conversation

@mertcano

Copy link
Copy Markdown

Description

This PR addresses critical cryptographic validation vulnerabilities across the ArbitrumContracts, arbitrum-contracts-audit, and debid-audit repositories.

Vulnerabilities & Security Defects Remediated:

  • Cryptography / Attacker-Controlled Panic Paths (decrypter-contract/src/lib.rs): Previously, malformed age headers, recipients, compressed points, recipient bodies, base64 payloads, and invalid key material could trigger panics through unchecked parsing and unwrapping. The duplicated implementations have been hardened to strictly validate lengths and parser results before performing any indexing or curve operations. All attacker-controlled panic paths (e.g., unwrap, expect) have been successfully replaced with fallible decoding and typed contract errors (e.g., BAD_G1, LEN_ERR, PARSE_ERR, MAC_ERR), ensuring the contract fails safely rather than terminating execution abruptly.

…ndaries

### Description
This PR addresses critical cryptographic validation vulnerabilities across the `ArbitrumContracts`, `arbitrum-contracts-audit`, and `debid-audit` repositories.

**Vulnerabilities & Security Defects Remediated:**
* **Cryptography / Attacker-Controlled Panic Paths (`decrypter-contract/src/lib.rs`):** Previously, malformed age headers, recipients, compressed points, recipient bodies, base64 payloads, and invalid key material could trigger panics through unchecked parsing and unwrapping. The duplicated implementations have been hardened to strictly validate lengths and parser results before performing any indexing or curve operations. All attacker-controlled panic paths (e.g., `unwrap`, `expect`) have been successfully replaced with fallible decoding and typed contract errors (e.g., `BAD_G1`, `LEN_ERR`, `PARSE_ERR`, `MAC_ERR`), ensuring the contract fails safely rather than terminating execution abruptly.
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.

1 participant