bypass_csp cookies are passed through the URL query string instead of looked up server-side #6
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
paul_loth/krautspaceTV#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
backend/slides/media.pybuilds the iframesrcforbypass_cspslides as/proxy?url=<...>&cookies=<raw cookie header, urlencoded>. The cookie value (already stored server-side in the slide'sconfig) ends up embedded in a URL that:config(and thus the cookie value) in the DB, keyed by slide id.Suggested fix
Have
/proxyaccept aslide_idinstead of rawurl/cookiesparams, and look up the target URL + stored cookies server-side fromdb.get_slide(slide_id)["config"]. This avoids duplicating/leaking the cookie value into the URL entirely.Fixed in
a841b02(merged to main at103cdf2): /proxy now accepts an optional slide_id param and looks up url/cookies server-side from the stored slide config when given. media.py's render() now builds /proxy?slide_id={id} instead of embedding the cookie value in the query string. The old url/cookies params still work directly for backward compatibility.