fix(security): credential-set invite email check + shopify authorize XSS#4302
fix(security): credential-set invite email check + shopify authorize XSS#4302waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Locks down credential-set invite acceptance by requiring the authenticated user’s email (normalized via Reviewed by Cursor Bugbot for commit 33fac4b. Configure here. |
3f3abf5 to
33fac4b
Compare
Greptile SummaryThis PR fixes two security vulnerabilities: a reflected XSS in the Shopify authorize page (via unsafe JS string interpolation of Confidence Score: 5/5Both security fixes are well-implemented and consistent with existing codebase patterns; no new issues introduced. No P0 or P1 findings. Both changes are tightly scoped, use existing helpers (isSameOrigin, normalizeEmail), and the logic is straightforward to verify. The XSS fix correctly uses JSON.stringify after origin validation, and the email-match check handles the open-invite case correctly. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant ShopifyRoute as Shopify Authorize Route
participant CredRoute as Credential Set Invite Route
Note over ShopifyRoute: XSS fix
Browser->>ShopifyRoute: GET with returnUrl param
ShopifyRoute->>ShopifyRoute: isSameOrigin check
alt same origin
ShopifyRoute->>ShopifyRoute: JSON.stringify after encodeURIComponent
ShopifyRoute-->>Browser: HTML with safely quoted JS literal
else different origin or no returnUrl
ShopifyRoute-->>Browser: HTML with empty string literal
end
Note over CredRoute: Email authorization fix
Browser->>CredRoute: POST accept invite token
CredRoute->>CredRoute: invitation has email?
alt email bound
CredRoute->>CredRoute: normalizeEmail comparison
alt emails match
CredRoute-->>Browser: 200 accepted
else mismatch
CredRoute-->>Browser: 403 forbidden
end
else open invite
CredRoute-->>Browser: 200 accepted
end
Reviews (2): Last reviewed commit: "fix(security): credential-set invite ema..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 33fac4b. Configure here.
Summary
normalizeEmailfrom the org-invite path); open invites with no bound email still workreturnUrlviaJSON.stringifyafterisSameOriginvalidation, replacing the unsafe'${encodeURIComponent(returnUrl)}'JS-string interpolation that left'unescapedType of Change
Testing
Tested manually
Checklist