fix(mobile): validate WalletConnect request id and topic in parseSignAuthEntryRequest (Fixes #1173) - #1203
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesWalletConnect request validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/mobile-wallet/src/components/SignAuthEntryApprovalSheet.tsx`:
- Around line 66-77: Update the request-ID validation around rawId in
SignAuthEntryApprovalSheet so only numeric values and non-blank, trimmed strings
are coerced before parsing; reject whitespace-only strings and non-scalar values
such as arrays instead of allowing them to become 0. Preserve rejection of
booleans, missing values, NaN, and infinities, and add coverage for ' ' and
[].
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 43327b04-bcb2-4912-8389-a5a452344c54
📒 Files selected for processing (2)
apps/mobile-wallet/src/components/SignAuthEntryApprovalSheet.tsxapps/mobile-wallet/src/components/__tests__/SignAuthEntryApprovalSheet.test.tsx
d8781af to
1069675
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/mobile-wallet/src/components/SignAuthEntryApprovalSheet.tsx`:
- Around line 93-96: Strengthen the validation in the session-handling flow
around the existing event.session check before casting to SessionTypes.Struct.
Replace the object-only guard with a WalletConnect session shape predicate or
schema validation that rejects arrays and incomplete objects such as [] and {},
while accepting valid sessions; add coverage for these malformed values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 775012bb-055a-473d-b0eb-3dd7ebde6872
📒 Files selected for processing (2)
apps/mobile-wallet/src/components/SignAuthEntryApprovalSheet.tsxapps/mobile-wallet/src/components/__tests__/SignAuthEntryApprovalSheet.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/mobile-wallet/src/components/tests/SignAuthEntryApprovalSheet.test.tsx
…parseSignAuthEntryRequest Signed-off-by: namdamdoi68-oss <namdamdoi68@gmail.com>
1069675 to
08378c9
Compare
Validates that event.id is a finite number and event.topic is a non-empty string in parseSignAuthEntryRequest before XDR parsing. Fixes #1173.
Summary by CodeRabbit