fix(bio-links): strip plaintext secrets and move gated link passcode verification to backend
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 47/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nextjs, postgresql, typescript
- Domain
- api, authentication, backend, security
Research direction
Read apps/api/src/bio-links/bio-links.service.ts and apps/api/src/bio-links/bio-links.controller.ts, then trace how apps/web/app/l/[slug]/page.tsx passes data to apps/web/components/bio-links/PublicLinkCard.tsx. Check the public endpoint response and the gated link flow. Done means public data excludes private tokens, passcodes, and unverified destinations, with the destination returned only after server-side verification.
Written by the indexing model from the issue text.
Description
Problem Description
-
Plaintext
metaAccessTokenleaked on public Bio-Links endpoint:
Inapps/api/src/bio-links/bio-links.service.ts(getPublicBioPage), the fullbioPagerecord is returned directly from Prisma, includingpixelConfig.metaAccessTokenin plaintext. -
Gated link
passcodeand destinationurlexposed to client:
getPublicBioPagealso returnslink.passcode(andlink.url) for gated links (isGated: true).
Inapps/web/app/l/[slug]/page.tsx, this payload is passed into client components, serializing bothpixelConfig.metaAccessTokenandlink.passcodeinto the public page's RSC/client payload.
Inapps/web/components/bio-links/PublicLinkCard.tsx, passcode validation is performed client-side (const expectedPasscode = (link.passcode || '').trim().toLowerCase()), allowing any visitor to inspect the network/RSC payload and bypass the gate or extract the secret token.
Expected Behavior
GET /bio-links/public/:slug(getPublicBioPage) must never exposepixelConfig.metaAccessTokenor any gated link'spasscode(or unverifiedurl) in the public response.- Passcode-gated links must be verified server-side; the destination
urlshould only be returned after the backend confirms the submitted passcode is valid.
Where to Look
apps/api/src/bio-links/bio-links.service.ts(getPublicBioPage)apps/api/src/bio-links/bio-links.controller.tsapps/web/app/l/[slug]/page.tsxapps/web/components/bio-links/PublicLinkCard.tsx
Solution / Implementation Guide
-
Backend (
bio-links.service.ts&bio-links.controller.ts):- In
getPublicBioPage(slug):- Sanitize
pixelConfigsometaAccessToken(and any other private keys) is omitted from the returned object, keeping only public pixel IDs. - For
linkswhereisGated === true, omitpasscodeand mask/omiturl(andfileUrlif applicable) in the public payload.
- Sanitize
- Add a public verification endpoint (e.g.
POST /bio-links/public/:slug/unlock) accepting{ linkId, passcode }(or email for email-gated links):- Validate the passcode server-side against the database record.
- Return
{ unlocked: true, url }on match, or401/403with an error message on mismatch.
- In
-
Frontend (
PublicLinkCard.tsx):- Remove the client-side
link.passcodecomparison. - On passcode submit, call the new
POST /bio-links/public/:slug/unlockendpoint and use the returnedurlto open the link once unlocked.
- Remove the client-side
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 6m
- Merged PRs (30d)
- 27
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sumamakhan761/tryinstance
-
backend good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sumamakhan761/tryinstance#65 ·
Maintainers usually reply within 1 day
-
backend good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
sumamakhan761/tryinstance#64 ·
Maintainers usually reply within 1 day
-
backend good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
sumamakhan761/tryinstance#63 ·
Maintainers usually reply within 1 day
-
backend good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sumamakhan761/tryinstance#62 ·
Maintainers usually reply within 1 day
-
backend good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sumamakhan761/tryinstance#60 ·
Maintainers usually reply within 1 day
All issues in sumamakhan761/tryinstance
Similar issues
-
prio:low scope:hud
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OliverRomhagen/vrigstad-joyride#953 ·
Maintainers usually reply within 1 day
-
review-followup
Difficulty 1/5 Under an hour Newbie friendliness 92/100
griffinwork40/agent-afk#5446 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
kacper-szewczyk/Ticknest#346 ·
Maintainers usually reply within 1 day
-
echarts geo: a GeoJSON URL that returns 200 with a body that is not JSON is fetched on each refreshOpenbug plugin/echarts/geo
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Yeachan-Heo/gajae-code#8230 ·
Maintainers usually reply within 1 day