oliver-zehentleitner / maity
web + hub: links with hidden characters never break a view; route segments can't leave the project path
tsk-t232a5ttpeer Open
Hardening of the web client from the security rounds (tsk-v9kheekgq115).
To do:
- Links with invisible characters: a card link (
card-panel.jslinkItem) and a profile website (person.js) go throughM.dom.safeUrlbeforeh("a", {href}).h()drops a refused href and renders the text instead of throwing, so one bad value can't make a whole view unrenderable. - The hub agrees with the client:
board/links.py_plain_httpsandperson_links.pywebsite_problemrefuse the same hidden set assafeUrl(Cf, bidi controls, DEL, U+2028/2029), in the path too. - Route segments:
app.jsrouting andapi.jsprojectPathrefuse.and..segments, and segments that decode to/, so a crafted link can't point the client's API base at another hub path. - Tests: web unit/e2e for each, and hub tests for the link and website checks. A changelog entry under Security.