unexpected-ecrecover-null-address

Detect Solidity ecrecover usage without address(0) validation.

1|1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/Apegurus/solidity-argus --skill unexpected-ecrecover-null-address
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unexpected-ecrecover-null-address
Source: https://github.com/Apegurus/solidity-argus/tree/main/skills/vulnerability-patterns/unexpected-ecrecover-null-address
Command: npx skills add https://github.com/Apegurus/solidity-argus --skill unexpected-ecrecover-null-address

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses a critical security vulnerability in Solidity smart contracts where the ecrecover function is used improperly, potentially allowing unauthorized actions due to uninitialized or zero addresses.

Core Features & Use Cases

  • Vulnerability Detection: Identifies direct usage of ecrecover without proper validation against address(0).
  • Secure Coding Practices: Promotes the use of safer alternatives like OpenZeppelin's ECDSA.recover.
  • Use Case: Auditing a smart contract that uses ecrecover for signature verification to ensure that an attacker cannot exploit a scenario where the recovered address is address(0) and the expected signer is also address(0).

Quick Start

Analyze the attached contract 'Vault.sol' for the unexpected ecrecover null address vulnerability.

Frequently Asked Questions about unexpected-ecrecover-null-address

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does ecrecover return address(0) in Solidity and how does it create a vulnerability?

The ecrecover function returns address(0) when signature verification fails or inputs are invalid. If a smart contract does not validate the recovered address against address(0), an attacker can bypass signature checks when the expected signer is also uninitialized.

How do I audit a smart contract for missing ecrecover address validation?

To audit a smart contract, provide the Solidity source file to analyze direct ecrecover calls. The process checks for the absence of require(recovered != address(0)) and flags uninitialized signer variables that lead to exploitable conditions.

What is the best way to secure ecrecover signature verification in Solidity?

The best way to secure ecrecover signature verification is replacing direct ecrecover calls with OpenZeppelin's ECDSA.recover. This library automatically handles zero-address validation and prevents unauthorized actions from uninitialized signer variables.

Can I use OpenZeppelin ECDSA.recover instead of direct ecrecover in smart contracts?

Yes, you can use OpenZeppelin ECDSA.recover instead of direct ecrecover in smart contracts. It provides built-in validation against address(0), ensuring that signature verification fails safely rather than returning an exploitable uninitialized signer address.

When do I need to check for unexpected ecrecover null address vulnerabilities?

You need to check for unexpected ecrecover null address vulnerabilities when auditing any Solidity smart contract that uses ecrecover for signature verification. This detects scenarios where uninitialized signer variables allow attackers to exploit a recovered address of address(0).