Repository navigation
Escape evidence and case-file text in the interface; serve it with a Content-Security-Policy - #188
Conversation
The event viewer wrote an event's ID and record number, the audit dialog wrote each entry's time and action, and the file browser wrote the parent folder's path into the page unescaped. All are escaped now. Static pages carry a Content-Security-Policy that allows only the interface's own script files, plus nosniff. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz
|
Three checks are red and none is caused by this change: Each fails in No fix exists yet. Proposed patch, as its own change: run the 3.8 and 3.9 Linux jobs on Generated by Claude Code |
ubuntu-latest now resolves to Ubuntu 26.04, for which setup-python has no 3.8 or 3.9 builds, so those jobs failed before any test ran. Job names are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz
What changes for examiners
Text that comes from evidence, a case file or a folder name is shown as text everywhere it was found being written into the page as markup:
The interface's own pages are now served with a Content-Security-Policy that runs only Strata's own script files (
script-src 'self', no inline script), plusnosniff. A place that is missed later displays the text rather than running it.The change
web/app.js: six interpolations escaped.engine/server.py:CSP_APP, sent on static responses. Styles keep'unsafe-inline'because the interface sets inline styles itself; images allowdata:for previews; frames and media are same-origin only.tests/test_ui_escaping.py(7 tests): the escapes, that the event parser really does return text, that the page has no inline script or handlers for the policy to break, the policy's rules, and that static pages are served with it. 5 fail on the old code.Verification
Not in this PR: timestamps written unescaped into the HTML report, the Office DOCTYPE check's 4 KB window, and the unbounded request body. Those are smaller and separate.
Generated by Claude Code