fix: prevent PRIVATE_LINK token leak in landing page lookup - #44
Merged
Conversation
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.
🤖 Augment PR SummarySummary: 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 🤖 Was this summary useful? React with 👍 or 👎 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lookupUseraction where PRIVATE_LINK share tokens were exposed to unauthenticated visitors who submitted a username on the landing pagecheckWrappedAccesson the wrapped page, which correctly returns 404 when no valid token is presentTest plan
bun run checkpasses with no errorsbun testpasses (1206 tests)/wrapped/{year}/u/{userId}, which returns 404/wrapped/{year}/u/{token}) still works for PRIVATE_LINK users