fix(locksmith): block private URLs in OG/certification image fetch - #16595
fix(locksmith): block private URLs in OG/certification image fetch#16595SashaMIT wants to merge 2 commits into
Conversation
imageURLToDataURI bare-fetched metadata.image / event_cover_image on unauth OG routes. Reuse assertSafeCallbackUrl and disable redirects.
|
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @SashaMIT on file. |
|
@SashaMIT is attempting to deploy a commit to the Unlock Protocol Team on Vercel. A member of the Team first needs to authorize it. |
Unauthenticated GET /image/:network/:lock/:keyId fetched key.tokenURI and redirected to json.image with no SSRF guard. Reuse assertSafeCallbackUrl (and redirect:error) for both URLs, matching the OG/Apple siblings.
|
Follow-up commit on this branch: the same unauthenticated SSRF class also sits on It bare- |
|
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @SashaMIT on file. |
|
CLA sign PR opened per cla-bot: #16596 (single-file |
Why
Unauthenticated
GET /v2/og/event/...(and certification) fetch lockmetadata.image/event_cover_imagethroughimageURLToDataURIwith barefetchand no scheme/private/redirect guard.Distinct from #16593 (WebSub hub.callback) and #16594 (Apple Wallet thumbnail). Same SSRF class; this PR introduces the shared
assertSafeCallbackUrlhelper for the image path (sibling PRs add the same helper for their sinks — land one first and rebase the others if needed).Fix
assertSafeCallbackUrl(http(s) + DNS private/link-local/CGNAT block)imageURLToDataURIbefore fetch withredirect: 'error'Test plan
yarn vitest run __tests__/utils/image.test.ts __tests__/utils/safeCallbackUrl.test.ts(6/6)http://127.0.0.1/.../ metadata IP fail closed (fallback / throw)Made with Cursor