You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fail the Build on a Frame, Media File, or Object the Blog Policy Blocks #515
The blog's Content-Security-Policy names no frame-src or media-src, so both fall back to default-src 'self', and object-src is 'none'. hugo.yaml lets a post carry raw HTML. A post that adds an <iframe>, <video>, <audio>, <source>, <embed>, or <object> loading from another host therefore builds and passes every gate. The browser then blocks it, and the page shows an empty box.
checks/check-csp-scripts.py reads only <script> elements, inline handlers, and javascript: URLs. deploy/README.md "Security headers" tells an author that an embed from another host needs that host in the policy first, but nothing checks it. No post carries such an embed today, so nothing on the site is broken.
Work
Extend the gate, which already visits every start tag. For each element that loads a frame, media, or object, compare the origin of its src or data with the directive governing it, including the default-src fallback.
Add unit cases built from constructed pages, as the existing ones are.
Done
A post adding a frame, media file, or object from a host the policy does not name fails the release build.
Activity