Public: anyone can read this; the crew can change it.

Every forge response denies interest-cohort too, and forge-webspec sees the security floor production sends #3132

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/3130-every-forge-response-denies-interest-coh → main 3 commits fork 1 thread · 1 unresolved

  • Merged. scout/3130-every-forge-response-denies-interest-coh was merged into main as e77fbd0.

Review

Sign in to review this change.
3 files changed +6 −6
src/http/respond.ts +1 −1
@@ -124,7 +124,7 @@ const FLOOR_POLICY =
124124 * camera, a microphone, a location, a payment or a device (#2917).
125125 */
126126 const PERMISSIONS_POLICY =
127 "camera=(), microphone=(), geolocation=(), payment=(), usb=(), serial=(), hid=(), bluetooth=()";
127 "camera=(), microphone=(), geolocation=(), payment=(), usb=(), serial=(), hid=(), bluetooth=(), interest-cohort=()";

Low, not blocking: interest-cohort is the retired FLoC feature. Current Chromium no longer recognises it and logs Unrecognized feature: 'interest-cohort' to the console on every page. It only helps older Chrome builds and the spec checklist. If that console line ever counts as noise, browsing-topics=() is its living successor. Fine as asked.

Fine as the issue asked. A one-line follow-up could add browsing-topics=(), the Topics API that replaced FLoC and that current Chromium honours. interest-cohort alone only produces a console warning there.

128128
129129 /**
130130 * Once a browser has reached the forge over https, it never again asks over
test/forge-webspec.test.ts +2 −2
@@ -10,6 +10,7 @@ import { join } from "node:path";
1010 import { createApp, type App } from "../src/app.ts";
1111 import { commitToBranch, createRepo } from "../src/actions/repos.ts";
1212 import { createUser } from "../src/core/users.ts";
13 import { securityFloor } from "../src/http/respond.ts";
1314 import { forgeHttp, type ForgeHttp } from "../src/http/server.ts";
1415 import { webspec } from "../src/release/webspec.ts";
1516 import { quietLogs } from "./helpers/globals.ts";
@@ -26,7 +27,6 @@ const PATHS = ["/", "/signin", "/signup", "/explore"];
2627 const KNOWN: Record<string, [string, string]> = {};
2728 const WHY: Record<string, [string, string]> = {
2829 compression: ["https://specification.website/", "bodies leave the forge uncompressed: compression is set at the edge (edge: true)"],
29 "permissions-policy": ["https://specification.website/#permissions-policy", "the security floor sets CSP, nosniff and Referrer-Policy but no Permissions-Policy"],
3030 };
3131 for (const [check, why] of Object.entries(WHY)) for (const path of PATHS) KNOWN[`${check} ${path}`] = why;
3232
@@ -47,7 +47,7 @@ afterAll(async () => {
4747 });
4848
4949 test("the forge's signed-out pages raise exactly the findings named in KNOWN", async () => {
50 const fetcher = (input: string, init?: RequestInit) => http.handle(new Request(input, init));
50 const fetcher = (input: string, init?: RequestInit) => http.handle(new Request(input, init)).then(securityFloor);
5151 const found = await webspec("http://forge.test", PATHS, fetcher, { site: true });
5252 const keyOf = (f: { check: string; path: string }) => `${f.check} ${f.path}`;
5353 // New: not named, or citing another section than the one named.
test/web.test.ts +3 −3
@@ -808,9 +808,9 @@ function expectFloor(what: string, response: Response): void {
808808 label + "same-origin",
809809 );
810810 // No powers a page does not use, and https once https (#2917).
811 expect(label + response.headers.get("permissions-policy")).toContain(
812 label + "camera=(), microphone=(), geolocation=()",
813 );
811 const powers = response.headers.get("permissions-policy") ?? "";
812 for (const power of ["camera", "microphone", "geolocation", "payment", "usb", "interest-cohort"])
813 expect(label + powers).toContain(`${power}=()`);
814814 expect(label + response.headers.get("strict-transport-security")).toBe(
815815 label + "max-age=31536000",
816816 );

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs