Skip to content

fix: prevent PRIVATE_LINK token leak in landing page lookup - #44

Merged
engels74 merged 1 commit into
mainfrom
fix/private-link-token-leak-landing-page
Feb 24, 2026
Merged

fix: prevent PRIVATE_LINK token leak in landing page lookup#44
engels74 merged 1 commit into
mainfrom
fix/private-link-token-leak-landing-page

Conversation

@engels74

Copy link
Copy Markdown
Collaborator

Summary

  • Remove authorization bypass in the lookupUser action where PRIVATE_LINK share tokens were exposed to unauthenticated visitors who submitted a username on the landing page
  • The action now always redirects to the userId-based URL, delegating access control to checkWrappedAccess on the wrapped page, which correctly returns 404 when no valid token is present

Test plan

  • bun run check passes with no errors
  • bun test passes (1206 tests)
  • With a user set to PRIVATE_LINK mode, submitting their username on the landing page redirects to /wrapped/{year}/u/{userId}, which returns 404
  • Users with PUBLIC or RESTRICTED modes are unaffected and can still be looked up normally
  • Direct access via a valid token URL (/wrapped/{year}/u/{token}) still works for PRIVATE_LINK users

The lookupUser action retrieved or generated the secret share token
and redirected unauthenticated visitors directly to the token URL.
This defeated PRIVATE_LINK mode by exposing the token to anyone who
knew a username. Access control is now fully delegated to the wrapped
page's checkWrappedAccess, which correctly denies access when no
token is present in the URL.
@augmentcode

augmentcode Bot commented Feb 24, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Fixes a share-token leak in the landing-page username lookup by removing PRIVATE_LINK token-based redirects for unauthenticated visitors.

Changes: The lookup action now always redirects to the userId-based wrapped URL, relying on checkWrappedAccess on the wrapped page to deny access (404) when no valid token is present.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@engels74
engels74 merged commit 06a407d into main Feb 24, 2026
1 check passed
@engels74
engels74 deleted the fix/private-link-token-leak-landing-page branch February 24, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant