Agent skill

Signature Vulnerabilities

by ccashwell in ccashwell/evm-cortex

Signature attack vectors and safe verification patterns for Solidity.

MITAuto-check passedBackend & APIs

Install Signature Vulnerabilities

skills CLI
$ npx skills add ccashwell/evm-cortex --skill signature-vulnerabilities -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex signature-vulnerabilities --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/signature-vulnerabilities .claude/skills/signature-vulnerabilities && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
signature-vulnerabilities
GitHub stars
131
Token cost
~1.8k tokens
SKILL.md length
258 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Signature attack vectors and safe verification patterns for Solidity.

  • Implementing permit
  • SKILL.md covers Replay Attacks, EIP-712 Typed Data Signing, Signature Malleability and ecrecover Returns address(0), plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Meta-transactions

What it does

Signature Vulnerabilities is an agent skill from ccashwell/evm-cortex. Signature attack vectors and safe verification patterns for Solidity. Use when implementing permit, meta-transactions, gasless approvals, or any signature-based authentication. Covers replay attacks, EIP-712, nonce management, malleability, and permit front-running.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Smart contracts. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Implementing permit
  • Meta-transactions
  • Gasless approvals
  • Any signature-based authentication

Example prompts

  • “/signature-vulnerabilities”

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Signature Vulnerabilities loads about 1.8k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 258 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 258 words, ~1,816 tokens.

Download SKILL.mdSave it as .claude/skills/signature-vulnerabilities/SKILL.md (or your agent's skills folder).
name
signature-vulnerabilities
description
Signature attack vectors and safe verification patterns for Solidity. Use when implementing permit, meta-transactions, gasless approvals, or any signature-based authentication. Covers replay attacks, EIP-712, nonce management, malleability, and permit front-running.

Signature Vulnerabilities

Replay Attacks

A valid signature can be reused unless explicitly prevented.

Cross-Chain Replay

A signature valid on Ethereum mainnet can be replayed on Arbitrum, Optimism, etc.

solidity
// VULNERABLE: no chain ID in signed data
bytes32 hash = keccak256(abi.encodePacked(user, amount, nonce));

// FIXED: include chain ID via EIP-712 domain separator
bytes32 public immutable DOMAIN_SEPARATOR;

constructor() {
    DOMAIN_SEPARATOR = keccak256(abi.encode(
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
        keccak256(bytes("MyProtocol")),
        keccak256(bytes("1")),
        block.chainid,
        address(this)
    ));
}
Cross-Contract Replay

A signature for contract A can be replayed on contract B if the verifying contract address isn't included.

Defense: Always include address(this) in the domain separator (EIP-712 handles this).

Same-Contract Replay

Reusing a signature multiple times on the same contract.

Defense: Nonce tracking.

solidity
mapping(address => uint256) public nonces;

function executeWithSignature(
    address user,
    uint256 amount,
    uint256 deadline,
    uint8 v, bytes32 r, bytes32 s
) external {
    if (block.timestamp > deadline) revert Expired();

    bytes32 structHash = keccak256(abi.encode(
        EXECUTE_TYPEHASH,
        user,
        amount,
        nonces[user]++,
        deadline
    ));

    bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, structHash));

    address recovered = ecrecover(digest, v, r, s);
    if (recovered == address(0) || recovered != user) revert InvalidSignature();

    _execute(user, amount);
}

EIP-712 Typed Data Signing

The standard for structured data signing. Provides human-readable signing prompts in wallets.

solidity
bytes32 public constant EXECUTE_TYPEHASH = keccak256(
    "Execute(address user,uint256 amount,uint256 nonce,uint256 deadline)"
);

function _hashTypedData(bytes32 structHash) internal view returns (bytes32) {
    return keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, structHash));
}
Nested Struct Hashing
solidity
// For complex types, hash inner structs first
bytes32 constant ORDER_TYPEHASH = keccak256(
    "Order(address maker,Asset makerAsset,Asset takerAsset,uint256 nonce,uint256 deadline)"
    "Asset(address token,uint256 amount)"
);

bytes32 constant ASSET_TYPEHASH = keccak256(
    "Asset(address token,uint256 amount)"
);

function hashOrder(Order memory order) internal pure returns (bytes32) {
    return keccak256(abi.encode(
        ORDER_TYPEHASH,
        order.maker,
        hashAsset(order.makerAsset),
        hashAsset(order.takerAsset),
        order.nonce,
        order.deadline
    ));
}

function hashAsset(Asset memory asset) internal pure returns (bytes32) {
    return keccak256(abi.encode(ASSET_TYPEHASH, asset.token, asset.amount));
}

Signature Malleability

ECDSA signatures have two valid forms for the same message (s and n-s). If both are accepted, a signature can be "replayed" with the alternate form.

solidity
// VULNERABLE: accepts both s values
address recovered = ecrecover(hash, v, r, s);

// FIXED: enforce low-s value (EIP-2 canonical form)
function _verifySignature(bytes32 hash, uint8 v, bytes32 r, bytes32 s)
    internal
    pure
    returns (address)
{
    // s must be in the lower half of the curve order
    if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
        revert MalleableSignature();
    }

    address recovered = ecrecover(hash, v, r, s);
    if (recovered == address(0)) revert InvalidSignature();

    return recovered;
}

Best practice: Use OpenZeppelin's ECDSA library which handles malleability checks.

solidity
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";

function verify(bytes32 hash, bytes memory signature) internal pure returns (address) {
    return ECDSA.recover(hash, signature); // handles malleability check
}

ecrecover Returns address(0)

ecrecover returns address(0) for invalid signatures instead of reverting. Always check.

solidity
// VULNERABLE: doesn't check for address(0)
address signer = ecrecover(hash, v, r, s);
require(signer == expectedSigner); // passes if expectedSigner is address(0)

// FIXED: explicit zero check
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) revert InvalidSignature();
if (signer != expectedSigner) revert Unauthorized();

EIP-2612 Permit Front-Running

An attacker can front-run a permit + action transaction by extracting the permit signature and calling permit first. The user's transaction reverts because the nonce is consumed.

solidity
// VULNERABLE: permit reverts if already used
function depositWithPermit(
    uint256 amount, uint256 deadline,
    uint8 v, bytes32 r, bytes32 s
) external {
    token.permit(msg.sender, address(this), amount, deadline, v, r, s); // ← reverts if front-run
    token.safeTransferFrom(msg.sender, address(this), amount);
}

// FIXED: try/catch on permit, proceed if allowance already set
function depositWithPermit(
    uint256 amount, uint256 deadline,
    uint8 v, bytes32 r, bytes32 s
) external {
    try token.permit(msg.sender, address(this), amount, deadline, v, r, s) {} catch {}
    token.safeTransferFrom(msg.sender, address(this), amount);
}

Nonce Management Patterns

Sequential Nonces

Simple, prevents replay, but requires sequential use.

solidity
mapping(address => uint256) public nonces;

// User must use nonce 0, then 1, then 2, etc.
// Cancel a nonce by calling with a no-op payload
Bitmap Nonces (Permit2 style)

Allows out-of-order nonce consumption.

solidity
// Nonces stored as bitmaps: nonce 256*wordPos + bitPos
mapping(address => mapping(uint256 => uint256)) public nonceBitmap;

function _useNonce(address owner, uint256 nonce) internal {
    uint256 wordPos = nonce >> 8;
    uint256 bitPos = nonce & 0xff;
    uint256 bit = 1 << bitPos;

    uint256 word = nonceBitmap[owner][wordPos];
    if (word & bit != 0) revert NonceAlreadyUsed();
    nonceBitmap[owner][wordPos] = word | bit;
}

Signature Verification Checklist

  • EIP-712 domain separator includes chainId and verifyingContract
  • Domain separator recomputed if chainId can change (forking)
  • Nonce included and incremented to prevent replay
  • Deadline/expiry included for time-bound signatures
  • ecrecover result checked against address(0)
  • Signature malleability mitigated (low-s check or OZ ECDSA)
  • Permit calls wrapped in try/catch to prevent front-running griefing
  • Typed data hashing follows EIP-712 spec exactly
  • Offchain signing tested against onchain verification

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/signature-vulnerabilities of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Signature Vulnerabilities next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Signature Vulnerabilities compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Signature Vulnerabilities this skillccashwell/evm-cortex131—~1.8kAutomated safety check: PassMIT
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT
Feynman Auditor0xiehnnkta/nemesis-auditor2431 repos~11kAutomated safety check: PassMIT
Smart Contract Auditgreatpie/smart-contract-audit-skill101—~1.1kAutomated safety check: PassNone
RadarAuditware/radar154—~2.1kAutomated safety check: PassGPL-3.0
Solidity AuditorGabson0x/bountyforge442—~3.7kAutomated safety check: PassNone

Similar skills

  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    243 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed
  • Smart Contract Audit

    greatpie/smart-contract-audit-skill

    Script-backed, out-of-box auditing workflow for Solidity/EVM repositories based on EVMbench detect/patch/exploit methodology.

    101 GitHub stars~1.1k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Radar

    Auditware/radar

    Use radar for smart contract security analysis, AST generation, and detection template development.

    154 GitHub stars~2.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    Gabson0x/bountyforge

    Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.

    442 GitHub stars~3.7k tokensUpdated 24 days ago
    Backend & APIsAuto-check passed
  • Add Explorer

    lidofinance/diffyscan

    Adds or repairs Diffyscan explorer API routing and response adapters for a new host, chain or payload format.

    142 GitHub stars~1k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 11 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 11 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 11 days ago
    Auto-check passed

Works with

Categories

Questions about Signature Vulnerabilities

What does Signature Vulnerabilities do?

Signature attack vectors and safe verification patterns for Solidity. Signature Vulnerabilities is an agent skill from ccashwell/evm-cortex. Signature attack vectors and safe verification patterns for Solidity.

When should I use Signature Vulnerabilities?

Signature Vulnerabilities fits situations like: implementing permit; meta-transactions; gasless approvals; any signature-based authentication.

How do I install Signature Vulnerabilities in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill signature-vulnerabilities -a claude-code`. Or copy the skill folder (skills/signature-vulnerabilities in ccashwell/evm-cortex) into .claude/skills/signature-vulnerabilities in your project. Claude Code loads it when a task matches its description.

How do I install Signature Vulnerabilities in Codex?

Run `npx skills add ccashwell/evm-cortex --skill signature-vulnerabilities -a codex`. Or copy the skill folder (skills/signature-vulnerabilities in ccashwell/evm-cortex) into .agents/skills/signature-vulnerabilities in your project. Codex loads it when a task matches its description.

Can I use Signature Vulnerabilities in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill signature-vulnerabilities -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/signature-vulnerabilities, .gemini/skills/signature-vulnerabilities, .github/skills/signature-vulnerabilities and .opencode/skills/signature-vulnerabilities in your project.

What does Signature Vulnerabilities need to run?

SKILL.md names no scripts, command-line tools or credentials: Signature Vulnerabilities is instructions for the agent only.

Does Signature Vulnerabilities access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Signature Vulnerabilities safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Signature Vulnerabilities use?

Signature Vulnerabilities is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Signature Vulnerabilities use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Signature Vulnerabilities?

Skills that share tags, products or a category with Signature Vulnerabilities: Fizz Convert (pashov/skills, 1.2k stars), Feynman Auditor (0xiehnnkta/nemesis-auditor, 243 stars), Smart Contract Audit (greatpie/smart-contract-audit-skill, 101 stars) and Radar (Auditware/radar, 154 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Signature Vulnerabilities?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.