Skip to content

[HIGH] Reward claim accepts any score ≥ 1, ignores passing threshold #29

Description

@DeFiVC

Description

In src/modules/rewards/reward.service.ts:114, claimReward checks !submission.score || submission.score < 1, meaning any submission with 1+ correct answer qualifies. The quiz passing logic (70% threshold) is applied in src/modules/quizzes/quiz.service.ts:160, but claimReward never checks passed status.

A client can call POST /api/rewards/claim with a submissionId for a failed quiz (e.g., score=1 on a 3-question quiz).

Impact

Users can claim rewards for quizzes they didn't pass.

File

src/modules/rewards/reward.service.ts:114

Suggested Fix

Add a check that submission.score meets the passing threshold (70%) before allowing reward claim, or verify submission.passed is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    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