Files are served private, no-cache, so every later view of an attachment,
avatar or thumbnail revalidates and gets a 304, and a browser updates the
stored response's headers with the 304's. The app-wide frame-ancestors 'self'
that FrameBleed's restore puts on every response therefore replaced the
file's own policy - an SVG's default-src 'none' and sandbox - from the second
view on. The SVG body is still sanitized on every serve, so this lost a layer
of defence rather than opening script execution. The app-wide framing headers
are now left off a 304, so the stored 200 keeps the policy its route chose; a
header a route set on the 304 itself is kept. Not recorded in Admin Panel /
Problems: it fires on ordinary revalidation, not on an attempt.
Thanks to xet7 !
With BROWSER_POLICY_ENABLED (the Docker and Snap default) WeKan is meant to be
frameable only by itself and TRUSTED_URL, so another site cannot load it in an
invisible frame and trick a signed-in user into clicking through it
(clickjacking). When browser-policy was removed on 2022-04-08, every line of
server/policy.js was commented out, and since then the app's pages carried no
framing header at all; only file responses did.
Every response now gets Content-Security-Policy: frame-ancestors 'self' plus
the TRUSTED_URL origins, and X-Frame-Options: SAMEORIGIN when no trusted origin
is set; a malformed TRUSTED_URL never widens it, and Sandstorm, which always
frames WeKan, and a disabled policy send nothing. build.sh and build.bat run
the test server with the default policy. FrameBleed moves from the recorded
gaps to guarded, with unit, negative and browser tests. A framed load cannot be
told from a normal one, so there is nothing to record in Problems.
Thanks to xet7 !