Skip to content

Open-source x402 security testing harness (20 tests, 7 attack categories) #1755

@msaleme

Description

@msaleme

Built the first open-source security testing harness for x402. 20 tests across 7 categories targeting the V2 attack surface:

Test Categories:

  • Payment challenge validation (missing headers, malformed auth, currency mismatch)
  • Recipient address manipulation (dynamic payTo routing attacks, address spoofing)
  • Session token security (token fabrication, expiry bypass, sensitive data leakage)
  • Spending limit exploitation (rate limit bypass, underpayment, budget exhaustion)
  • Facilitator trust (fake facilitator injection, verification bypass)
  • Information disclosure (leaked keys, stack traces in error responses)
  • Cross-chain confusion (wrong network, wrong token type)

Zero external dependencies. Does not spend real money. Python 3.10+.

pip install agent-security-harness
agent-security test x402 --url https://your-x402-endpoint.com
agent-security list x402

Repo: https://github.com/msaleme/red-team-blue-team-agent-fabric
PyPI: https://pypi.org/project/agent-security-harness/

The harness also includes an Agent Autonomy Risk Score (0-100) that answers: how dangerous is it to let an autonomous agent pay this endpoint without human oversight?

Would welcome feedback from the x402 team on coverage gaps or additional attack vectors worth testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions