-
Notifications
You must be signed in to change notification settings - Fork 57
[Security] Transaction hash replay attack possible - same payment used multiple times to access AI service #241
Copy link
Copy link
Open
Labels
TypeScriptTypeScript codeTypeScript codebugSomething isn't workingSomething isn't workinggoPull requests that update go codePull requests that update go codegssoc:approvedApproved for GSSoC contributionApproved for GSSoC contributionlevel:advancedLarge, risky, or cross-service work requiring strong project context.Large, risky, or cross-service work requiring strong project context.triageNeeds maintainer triage.Needs maintainer triage.type:bugA defect or regression in existing behavior.A defect or regression in existing behavior.type:securitySecurity, abuse resistance, secret safety, or payment integrity work.Security, abuse resistance, secret safety, or payment integrity work.
Description
Metadata
Metadata
Assignees
Labels
TypeScriptTypeScript codeTypeScript codebugSomething isn't workingSomething isn't workinggoPull requests that update go codePull requests that update go codegssoc:approvedApproved for GSSoC contributionApproved for GSSoC contributionlevel:advancedLarge, risky, or cross-service work requiring strong project context.Large, risky, or cross-service work requiring strong project context.triageNeeds maintainer triage.Needs maintainer triage.type:bugA defect or regression in existing behavior.A defect or regression in existing behavior.type:securitySecurity, abuse resistance, secret safety, or payment integrity work.Security, abuse resistance, secret safety, or payment integrity work.
Problem
If the system verifies that a transaction hash is valid on-chain but does not record it as used, the same transaction hash can be replayed indefinitely to access the AI service for free after paying once:
An attacker pays once, receives a valid transaction hash, and replays it thousands of times.
Proposed Fix
Store used transaction hashes in a Redis set (fast, with TTL matching the on-chain finality window) or a database:
Acceptance Criteria