Commit Graph
10 Commits
Author SHA1 Message Date
Lauri Ojansivu e8a1106782 FrameBleed follow-up: a 304 Not Modified no longer replaces a stored file's own Content-Security-Policy.
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 !
2026-10-27 20:57:38 +02:00
Lauri Ojansivu dae1fd68e8 Restore FrameBleed protection: WeKan's pages refuse being framed by other sites again.
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 !
2026-10-02 10:46:06 +03:00
Lauri Ojansivu 12448ab473 Removed browser contect policy so that attachments would be visible. Part 2.
Thanks to xet7 !

Fixes #4468
2022-04-08 18:37:51 +03:00
Lauri Ojansivu 8a39a52d5d Removed browser contect policy so that attachments would be visible.
Thanks to xet7 !

Fixes #4468
2022-04-08 17:52:27 +03:00
Lauri Ojansivu 0d9c37b006 Fix Can't add attachments because of Content-Security-Policy.
Thanks to Ben0it-T and xet7 !

Fixes #4461
2022-04-06 17:26:39 +03:00
Justin Reynolds 3eb4d2c341 Prettier & eslint project style update 2019-06-28 12:56:51 -05:00
Lauri Ojansivu b3005f828d - Use only framing policy, not all of content policy.
- Fix Date and Time Formats are only US in every language.

Thanks to xet7 !

Closes #1833
2018-08-16 14:29:38 +03:00
Lauri Ojansivu 807c6ce09e - Content Policy: Allow inline scripts, otherwise there is errors in browser/inspect/console.
- Set default matomo settings to disabled.

Thanks to xet7 !
2018-08-15 23:41:01 +03:00
Lauri Ojansivu b9929dc682 - When Content Policy is enabled, allow one URL to have iframe that embeds Wekan
- Add option to turn off Content Policy
- Allow always in Wekan markdown <img src="any-image-url-here">

Thanks to xet7 !

Closes #1676
2018-08-13 19:24:07 +03:00
guillaume ec59af3777 Integration of matomo with env vars 2018-07-27 18:08:09 +02:00