Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(security): cover reviewed static asset variants

Rahmanefdea20af7ff
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index b947b0e1..18333661 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,11 +1,23 @@
+## 2026-09-18 — Include the remaining reviewed public asset variants
+
+The first exact-main run of the path-scoped validator correctly failed because the live
+asset graph also contains content-hashed CSS chunks and Next's versioned SVG app icon.
+The raw report showed rule 10050 only on public cacheable assets. Header checks confirmed
+CSS is public/immutable for one year and the icon is public for one week. Extend the
+validator narrowly to CSS chunks and only the exact ?icon.<hash>.svg icon query shape;
+arbitrary queries, API/login paths, cross-origin URLs and all otherwise-unreviewed alerts
+still fail closed.
+
## 2026-09-18 — Scope cache retrieval review to immutable asset paths
PR review caught that a rule-wide 10050 INFO entry would also downgrade a future
shared-cache exposure on an authenticated or user-specific URL. Rule 10050 is therefore
removed from the rule-wide ZAP policy. Hosted and local DAST now validate the raw ZAP
-JSON: only same-origin, query-free /_next/static/chunks/*.js and
-/_next/static/media/*.woff2 instances are accepted for that rule; every other 10050
-instance and every otherwise-unreviewed alert remains a failing condition.
+JSON: only same-origin immutable public assets are accepted for that rule:
+query-free /_next/static/chunks/*.js, /_next/static/chunks/*.css and
+/_next/static/media/*.woff2, plus /icon.svg only with Next's bounded
+?icon.<hash>.svg cache-busting shape. Every other 10050 instance and every otherwise
+unreviewed alert remains a failing condition.
## 2026-09-18 — Classify cache retrieval only for immutable public assets
@@ -13,8 +25,9 @@ The first post-merge passive ZAP run against main produced one new default warni
rule 10050 (Retrieved from Cache) on five content-hashed _next/static JavaScript/font
assets carrying an Age header. The report contained no authenticated, personal, or
user-specific URL for that rule. Keep the signal visible as INFO for those intentionally
-cacheable public assets; do not use IGNORE, do not alter authenticated response caching,
-and leave every other unreviewed ZAP rule at its default warning/failure behavior.
+cacheable public assets through path-scoped raw-report validation; do not add a
+rule-wide INFO or IGNORE, do not alter authenticated response caching, and leave every
+other unreviewed ZAP rule at its default warning/failure behavior.
## 2026-09-18 — Require executed passive security scan evidence
diff --git a/docs/SECURITY-ASSURANCE.md b/docs/SECURITY-ASSURANCE.md
index ce489468..52cc743e 100644
--- a/docs/SECURITY-ASSURANCE.md
+++ b/docs/SECURITY-ASSURANCE.md
@@ -89,7 +89,7 @@ The exception is intentionally finding-specific. The file and rules are **not**
## Reviewed ZAP informational alerts
-The production baseline keeps five rule-wide passive signals visible as `INFO`: cache policy on the public manifest, intentionally non-storable private/auth-shell responses, broad HTTPS sources in `img-src`/`frame-src`, a Unix timestamp in a static bundle, and the deliberate absence of COEP. A sixth reviewed signal, ZAP rule 10050 (`Retrieved from Cache`), is deliberately **not** present in the rule-wide policy. `scripts/check-zap-report.mjs` accepts that rule only when every instance is a same-origin, query-free `/_next/static/chunks/*.js` or `/_next/static/media/*.woff2` asset; any other 10050 instance fails the gate. Authenticated and user-specific responses remain `private, no-cache, no-store`.
+The production baseline keeps five rule-wide passive signals visible as `INFO`: cache policy on the public manifest, intentionally non-storable private/auth-shell responses, broad HTTPS sources in `img-src`/`frame-src`, a Unix timestamp in a static bundle, and the deliberate absence of COEP. A sixth reviewed signal, ZAP rule 10050 (`Retrieved from Cache`), is deliberately **not** present in the rule-wide policy. `scripts/check-zap-report.mjs` accepts that rule only when every instance is a same-origin immutable public asset: query-free `/_next/static/chunks/*.js`, `/_next/static/chunks/*.css`, or `/_next/static/media/*.woff2`, plus `/icon.svg` only with Next's bounded `?icon.<hash>.svg` cache-busting shape. Any other 10050 instance fails the gate. Authenticated and user-specific responses remain `private, no-cache, no-store`.
These are rule-specific classifications in `security/zap-baseline.conf`, not a global warning bypass. Any other ZAP baseline alert remains a warning/failure and makes the gate non-zero.
diff --git a/scripts/check-zap-report.mjs b/scripts/check-zap-report.mjs
index e8e773f0..e51d0ee3 100644
--- a/scripts/check-zap-report.mjs
+++ b/scripts/check-zap-report.mjs
@@ -5,9 +5,10 @@ import { requireDastTarget } from "./check-dast-target.mjs";
const CACHE_RULE = "10050";
const STATIC_CACHE_PATHS = [
- /^\/_next\/static\/chunks\/[^/?#]+\.js$/,
+ /^\/_next\/static\/chunks\/[^/?#]+\.(?:js|css)$/,
/^\/_next\/static\/media\/[^/?#]+\.woff2$/,
];
+const VERSIONED_ICON_QUERY = /^\?icon\.[a-z0-9_-]+\.svg$/i;
function asArray(value) {
return Array.isArray(value) ? value : [];
@@ -46,7 +47,9 @@ function reviewedStaticCacheInstance(instance, targetOrigin) {
} catch {
return false;
}
- if (url.origin !== targetOrigin || url.username || url.password || url.search || url.hash) return false;
+ if (url.origin !== targetOrigin || url.username || url.password || url.hash) return false;
+ if (url.pathname === "/icon.svg") return VERSIONED_ICON_QUERY.test(url.search);
+ if (url.search) return false;
return STATIC_CACHE_PATHS.some((pattern) => pattern.test(url.pathname));
}
diff --git a/scripts/zap-report.test.ts b/scripts/zap-report.test.ts
index 387bbfd1..634ec91a 100644
--- a/scripts/zap-report.test.ts
+++ b/scripts/zap-report.test.ts
@@ -28,11 +28,13 @@ describe("path-scoped ZAP report review", () => {
alert("10055", [target + "/"]),
alert("10050", [
target + "/_next/static/chunks/abc-123.js",
+ target + "/_next/static/chunks/styles-123.css",
target + "/_next/static/media/Geist_Variable-s.p.hash.woff2",
+ target + "/icon.svg?icon.2nz7bd3koounz.svg",
]),
]),
{ target, policyText },
- )).toMatchObject({ reviewedCacheInstances: 2, reviewedInfoAlerts: 1 });
+ )).toMatchObject({ reviewedCacheInstances: 4, reviewedInfoAlerts: 1 });
});
it.each([
@@ -40,6 +42,8 @@ describe("path-scoped ZAP report review", () => {
target + "/login",
target + "/_next/static/chunks/a.js?token=secret",
target + "/_next/static/media/font.ttf",
+ target + "/icon.svg?token=secret",
+ target + "/icon.svg?icon.unexpected.png",
"https://other.example.com/_next/static/chunks/a.js",
])("rejects rule 10050 outside the reviewed static-cache boundary: %s", uri => {
expect(() => validateZapReport(