feat: serve pdf.js from this origin instead of a CDN
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 1m10s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images and notify Portainer (push) Successful in 1m43s
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 1m10s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images and notify Portainer (push) Successful in 1m43s
The Site pulled pdf.js 3.11.174 from cdnjs with no integrity attribute, and the policy trusted the whole of cdnjs.cloudflare.com for both script-src and worker-src. Anything that host served would have executed, and a customer measuring a PDF sheet depended on it being reachable. Vendor both files instead of pinning a hash: it removes the dependency rather than constraining it, and lets the policy name only 'self'. Provenance and SHA-256 digests are recorded in local/static/vendor/README.md, verified on download against the SRI digests cdnjs publishes for that release. cdnjs is now absent from script-src, worker-src and connect-src in both gateway templates. Workers are 'self' plus blob:, which the Site needs for the worker it constructs itself. Verified in a browser against the running stack: pdf.js loads from /vendor/, the blob worker starts, and a real seven-page PDF parses with no CSP violation. Both browser suites and the full integration suite pass. The version is deliberately unchanged. 3.11.174 is old, but its known eval path is already closed by isEvalSupported:false, and upgrading is an API change that needs its own testing rather than riding along with this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
22
ROADMAP.md
22
ROADMAP.md
@@ -253,10 +253,26 @@ Dockerfiles default to mutable `python:3.12-slim` / `nginx:1.28-alpine`, the
|
||||
workflow passes no digest build-args, and `--pull` makes builds non-reproducible —
|
||||
while `PORTAINER.md` documents digest-pinned immutable bases.
|
||||
|
||||
### `[ ]` 2.7 — pdf.js loaded from CDN without integrity `(F11)`
|
||||
### `[x]` 2.7 — pdf.js loaded from CDN without integrity `(F11)`
|
||||
|
||||
3.11.174 from `cdnjs`, no SRI, and CSP allows the whole host for `script-src` **and**
|
||||
`worker-src`. Vendor the asset or pin `integrity` and narrow the CSP to the exact path.
|
||||
Vendored rather than integrity-pinned, so the Site no longer depends on a third
|
||||
party being reachable and honest when a customer opens it. Both files are served
|
||||
from this origin and their provenance is recorded in `local/static/vendor/README.md`,
|
||||
verified against the SRI digests cdnjs publishes for 3.11.174.
|
||||
|
||||
`cdnjs.cloudflare.com` is gone from `script-src`, `worker-src` and `connect-src` in
|
||||
both gateway templates: scripts and workers are now `'self'` plus `blob:` for the
|
||||
worker the Site builds itself.
|
||||
|
||||
Verified in a browser against the running stack: pdf.js loads from `/vendor/`,
|
||||
the blob worker starts, and a real 7-page PDF parses with no CSP violation. Both
|
||||
browser suites and the full integration suite pass.
|
||||
|
||||
**Still open: the version.** 3.11.174 is old. GHSA-wgrm-67xf-hhpq is mitigated —
|
||||
`dtf-site.html` already passes `isEvalSupported: false`, which is the documented
|
||||
workaround — but staying on it indefinitely is not a posture. Upgrading is an API
|
||||
change rather than a file swap and needs its own browser testing, so it is
|
||||
deliberately not bundled here.
|
||||
|
||||
### `[ ]` 2.8 — Single shared operator credential `(F12)`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user