skills/vulnerability-patterns/unsecure-signatures/SKILL.md
- Contract uses ECDSA signatures for authorization, authentication, or message verification
npx skillsauth add apegurus/solidity-argus unsecure-signaturesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
abi.encodePacked with multiple dynamic types// Combines multiple signature anti-patterns
function execute(bytes memory sig, address to, uint256 amount) external {
// 1. No nonce — replay attack
// 2. No address(this) — cross-contract replay
// 3. No block.chainid — cross-chain replay
bytes32 hash = keccak256(abi.encodePacked(to, amount));
// 4. Raw ecrecover — no null address check
address recovered = ecrecover(hash, v, r, s);
// 5. No s-value malleability check
require(recovered == signer);
// 6. Signature tracked by bytes — malleable bypass
require(!used[sig]);
used[sig] = true;
_transfer(to, amount);
}
ecrecover or ECDSA.recover — this indicates signature usageaddress(this) + block.chainid? Flag any missingaddress(0)? Flag if notabi.encodePacked used with multiple dynamic types? Flag if yesabi.encode instead of abi.encodePacked for hash constructionimport {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
contract SecureSig is EIP712("SecureSig", "1") {
mapping(address => uint256) public nonces;
bytes32 constant EXECUTE_TYPEHASH =
keccak256("Execute(address to,uint256 amount,uint256 nonce)");
function execute(address to, uint256 amount, bytes memory sig) external {
uint256 nonce = nonces[msg.sender]++;
bytes32 structHash = keccak256(abi.encode(EXECUTE_TYPEHASH, to, amount, nonce));
bytes32 hash = _hashTypedDataV4(structHash);
address recovered = ECDSA.recover(hash, sig);
require(recovered == signer, "invalid sig");
_transfer(to, amount);
}
}
testing
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.