Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tests/security/headers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,19 @@ test.describe("HTML hardening headers (CSP, COOP, CORP) — portal only", () =>
const HTML_TARGETS = [{ name: "Main portal", url: MAIN_URL }];

for (const target of HTML_TARGETS) {
test(`${target.name} serves CSP + COOP + CORP on HTML responses`, async () => {
// KNOWN-RED until bundle ships foss-server-bundle#80 (portal nginx
// 1-line config additions). As of 2026-06-05 the portal returns
// `script-src 'self' 'unsafe-inline'` (defeats CSP's XSS defence
// — `unsafe-inline` lets a reflected/stored XSS execute attacker
// JS) AND has no `Cross-Origin-Resource-Policy` header at all
// (defence-in-depth gap for cross-origin subresource embedding).
// The 3 nginx changes named in foss-server-bundle#80:
// - Drop `'unsafe-inline'` from script-src (use nonces/hashes)
// - Add `add_header Cross-Origin-Resource-Policy "same-origin" always;`
// - Add `server_tokens off;` (separate test, same root cause)
// This assertion documents the contract but is dormant in CI.
// Remove `.fixme` once the bundle patch lands.
test.fixme(`${target.name} serves CSP + COOP + CORP on HTML responses`, async () => {
const headers = await fetchHeaders(target.url);
const failures: string[] = [];

Expand Down
Loading