Skip to content

fix: enforce JWT wallet ownership in claims and policy controllers#140

Merged
nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
Gbangbolaoluwagbemiga:feat/issues-85-86-87-88
Jun 27, 2026
Merged

fix: enforce JWT wallet ownership in claims and policy controllers#140
nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
Gbangbolaoluwagbemiga:feat/issues-85-86-87-88

Conversation

@Gbangbolaoluwagbemiga

Copy link
Copy Markdown
Contributor

Summary

Fixes four BOLA/IDOR vulnerabilities where JWT-authenticated callers could act on behalf of arbitrary wallets by supplying a different wallet in the request body or query param.

Same req.user?.walletAddress || req.wallet pattern applied consistently to getClaim, getClaimHistory, getMyPolicies, and buyPolicy for defence-in-depth.

Closes #85
Closes #86
Closes #87
Closes #88

…arashield-Protocol#85 Parashield-Protocol#86 Parashield-Protocol#87 Parashield-Protocol#88)

Parashield-Protocol#85 — submitClaim: replace `req.wallet || dto.claimant` with the JWT-verified
wallet (`req.user?.walletAddress || req.wallet`); return 403 when dto.claimant
differs from the authenticated wallet, eliminating BOLA.

Parashield-Protocol#86 — getClaimsByWalletQuery: ownership check now reads from req.user?.walletAddress
instead of req.wallet (header-auth only), so JWT-authenticated callers cannot
enumerate another wallet's claim history.

Parashield-Protocol#87 — getPolicy: added @UseGuards(JwtAuthGuard) + ownership check comparing
policyData.policyholder against the authenticated wallet; returns 403 on mismatch.
Unauthenticated clients can no longer enumerate policy PII by UUID (IDOR).

Parashield-Protocol#88 — confirmPolicy: added wallet-match guard (dto.walletAddress vs
req.user?.walletAddress); returns 403 when a JWT user submits on behalf of
another wallet.

Same req.user?.walletAddress pattern applied consistently across getClaim,
getClaimHistory, getMyPolicies, and buyPolicy for defence-in-depth.
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Gbangbolaoluwagbemiga Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nonsobethel0-dev nonsobethel0-dev merged commit 5ad6c6f into Parashield-Protocol:main Jun 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment