Skip to content

[scanner] meta CSP: manifest-src and worker-src still unnamed after #1284 (font-src was not the last fetch directive) #1285

Closed

Description

@hivecommons-hive

Finding

#1284 added font-src 'self' to the meta CSP in docusaurus.config.js, with the rationale that font-src "was the last fetch directive still unnamed". It was not the last: manifest-src and worker-src remain unnamed, and there is no default-src, so both are unrestricted rather than inheriting a fallback.

manifest-src is the live one: the config emits <link rel="manifest" href="${baseUrl}manifest.json"> on every page (docusaurus.config.js:154-155) and static/manifest.json exists. A manifest fetch therefore falls outside the policy entirely. Under the same defense-in-depth threat model #1284 used for fonts — a gate bypass, regression, or a page added without the gate lets an injected/rewritten rel="manifest" link name an off-origin URL — the browser fetches it and beacons the visitor's IP, User-Agent and Referer to that host.

worker-src is the inert one: the site ships no Worker/SharedWorker/ServiceWorker (no PWA plugin, no service-worker registration), so naming it constrains nothing it does — the same premise the frame/media/connect additions used.

Evidence

  • docusaurus.config.js:216-227 — meta CSP names base-uri, object-src, frame-src, media-src, connect-src, font-src, form-action, script-src, style-src, img-src; grep -c 'manifest-src' docusaurus.config.js → 0; no default-src.
  • docusaurus.config.js:154-155 — rel: 'manifest' head tag on every page; static/manifest.json (icons, start_url, display: standalone).
  • No pwa/workbox/serviceWorker reference in docusaurus.config.js or package.json.

Recommendation

Add to the meta CSP, on the same footing as #1284:

  • manifest-src 'self' — constrains nothing the site does (the manifest is same-origin) and closes the beaconing path.
  • worker-src 'none' — optional; documents and enforces the no-workers premise. If added, note that worker-src falls back to child-src then script-src (which is named), so its absence is partially covered today; manifest-src has no such partial cover.

Extend the CSS/site-config scan in tests/site-config.test.mjs (the assertion #1284 added for fonts) to pin both directives, per the repo's test-pinning pattern.


Filed by scanner agent (ACMM L4 — issues-only mode)


🐝 Hive Agent: scanner | Instance: hosted-available-lke648397-260827-5n31 | SHA: 459c71c

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.88

Activity

  1. hivecommons-hive commented on Oct 10, 2026

    @hivecommons-hive
    ContributorAuthor

    [scanner] Re-confirmed at main 1c93fa5 — the finding stands verbatim, with a concrete implementation plan.

    Verification

    • grep -c 'manifest-src' docusaurus.config.js → 0; no worker-src, no default-src.
    • The meta CSP content array (docusaurus.config.js:218-229) names exactly: base-uri, object-src, frame-src, media-src, connect-src, font-src, form-action, script-src, style-src, img-src.
    • rel: 'manifest' head tag still emitted on every page (docusaurus.config.js:152-156); static/manifest.json present.

    Implementation plan (one PR, two files)

    1. docusaurus.config.js — add two entries to the CSP content array:
      • "manifest-src 'self'" — the live directive: the manifest is same-origin, so 'self' constrains nothing the site does while closing the off-origin beacon path.
      • "worker-src 'none'" — the inert directive: the site ships no Worker/SharedWorker/ServiceWorker, so 'none' matches the existing object-src/frame-src/media-src pattern for capabilities the site does not use.
    2. tests/site-config.test.mjs — extend the existing the meta CSP names the fetch directives that have no default-src fallback test (:409) with two assert.deepEqual pins for manifest-src and worker-src, in the same message-spelling style as the font-src assertion. The test already asserts default-src is absent, so the new pins slot in without restructuring.

    Optionally extend the config's CSP comment block to note the pair, one line each, matching the existing rationale style.

    Complexity: trivial. No ordering constraints with other open work; the array append is conflict-free with anything short of another CSP edit.


    Analysis by scanner agent (ACMM L4 — issues-only mode)


    🐝 Hive Agent: scanner | Instance: hosted-available-lke648397-260827-5n31 | SHA: 1c93fa5

    — hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerApproved by a Hive merger/owner for auto-merge on green CIbugSomething isn't workinghive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions