Repository navigation
fix(timeslider): only follow a same-origin pad referrer in "Return to pad" - #8397
Conversation
… pad" The button navigated to document.referrer whenever the character before its last "/" was "p", so a cross-origin link from https://attacker/p/login to /p/<pad>/timeslider?embed=1 redirected the user off-site when they clicked it (GHSA-35rj-7vrx-29wq, reported by @sun1024). Parse the referrer and only follow it when it is a pad page on the same origin; otherwise return to the pad. Also bump develop to 3.3.11 (it was left at 3.3.10 after the 3.3.11 release) and add the 3.3.12 changelog entry, crediting @temantih for the rev-export chat fix (#8389). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4cYEvi9Y4BTPntnkV9tzh
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoPrevent cross-origin redirects from timeslider’s Return to pad button
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
…s pad page Addresses Qodo review: same-origin timeslider, export or other-pad URLs no longer count as the pad to return to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4cYEvi9Y4BTPntnkV9tzh
The timeslider's "Return to pad" button navigated to
document.referrerwhenever the character before its last/wasp. A link fromhttps://attacker/p/login(withreferrerpolicy="unsafe-url") to/p/<pad>/timeslider?embed=1therefore sent the user back to the attacker's site when they clicked the button. The button is hidden when the timeslider runs inside an iframe, so only direct top-level visits were affected.The referrer is now parsed and only followed when it is a pad page on the same origin; otherwise the button returns to the pad. The logic lives in
static/js/timesliderReturnUrl.tsso it can be unit tested.Fixes GHSA-35rj-7vrx-29wq. Reported by @sun1024.
This PR also bumps develop to 3.3.11 (it was still at 3.3.10 after the 3.3.11 release) and adds the 3.3.12 changelog entry, which also credits @temantih for #8389.
Tests: new vitest spec (
timesliderReturnUrl.test.ts: cross-origin, same-origin, empty and proxy-prefix cases); full vitest suite passes; tsc clean. Checked in Chromium against a local server: from a cross-origin/p/page withunsafe-url, the button now returns to the pad instead of the attacker page.🤖 Generated with Claude Code
https://claude.ai/code/session_01V4cYEvi9Y4BTPntnkV9tzh