Skip to content

[HIGH] verifyQuizProof ignores 3 of 5 parameters — proof reusable across users #30

Description

@DeFiVC

Description

verifyQuizProof in src/stellar/signatures.ts:35-49 accepts (userAddress, quizId, score, hash, signature) but never reconstructs the hash from userAddress + quizId + score. It only verifies "this hash was signed by the platform key" — not "this hash corresponds to these specific arguments."

Additionally, createQuizProof includes timestamp: Date.now() (line 17), making each proof unique and non-reproducible for verification.

Impact

A proof for User A's quiz can be reused for User B. Proof verification is effectively meaningless.

File

src/stellar/signatures.ts:35-49 (verify)
src/stellar/signatures.ts:17 (create)

Suggested Fix

Reconstruct the expected hash from the provided arguments (userAddress, quizId, score) and verify it matches the provided hash before checking the signature. Remove or make the timestamp deterministic.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workinghighsecuritySecurity concern

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions