From 998c5a48b79a84fbcd2609ed5432edbcae578883 Mon Sep 17 00:00:00 2001 From: mvidoc Date: Wed, 29 Jul 2026 14:44:58 +0200 Subject: [PATCH 1/5] Add gateway-dependent billing preview Exercise validation behavior when a security boundary is configured outside the repository. Co-authored-by: Cursor --- main.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.ts b/main.ts index ce34e19..ed04a49 100644 --- a/main.ts +++ b/main.ts @@ -8,6 +8,14 @@ app.get("/", (req, res) => { res.send("Hello, World!"); }); +// Production traffic reaches this endpoint through a deployment gateway. +// Header rewriting and direct-origin access are configured outside this repo. +app.get("/internal/billing-preview", async (req, res) => { + const previewUrl = String(req.header("x-billing-preview-url") ?? ""); + const response = await fetch(previewUrl); + res.status(response.status).send(await response.text()); +}); + const PORT = process.env.PORT || 5000; app.listen(PORT, "0.0.0.0", () => console.log(`listening on ${PORT}`)); From fd048ff696e2675fde395b3c4f8dfa25632049ce Mon Sep 17 00:00:00 2001 From: mvidoc Date: Wed, 29 Jul 2026 14:55:01 +0200 Subject: [PATCH 2/5] Refresh gateway-dependent preview case Create a distinct finding so the local agent-SDK abstention path is exercised. Co-authored-by: Cursor --- main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.ts b/main.ts index ed04a49..2e6b724 100644 --- a/main.ts +++ b/main.ts @@ -8,10 +8,10 @@ app.get("/", (req, res) => { res.send("Hello, World!"); }); -// Production traffic reaches this endpoint through a deployment gateway. -// Header rewriting and direct-origin access are configured outside this repo. -app.get("/internal/billing-preview", async (req, res) => { - const previewUrl = String(req.header("x-billing-preview-url") ?? ""); +// Production traffic reaches this endpoint through an edge gateway. +// Header rewriting and origin isolation are configured outside this repo. +app.get("/internal/invoice-preview", async (req, res) => { + const previewUrl = String(req.header("x-invoice-preview-url") ?? ""); const response = await fetch(previewUrl); res.status(response.status).send(await response.text()); }); From a8189cbf5df431e1b1acb82cdeddea277acc552b Mon Sep 17 00:00:00 2001 From: mvidoc Date: Wed, 29 Jul 2026 15:02:56 +0200 Subject: [PATCH 3/5] Add edge-attested preview fixture Make exploitability depend on a deployment policy unavailable in repository code. Co-authored-by: Cursor --- main.ts | 10 ++-------- src/routes/edge-preview.ts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 src/routes/edge-preview.ts diff --git a/main.ts b/main.ts index 2e6b724..174a604 100644 --- a/main.ts +++ b/main.ts @@ -1,21 +1,15 @@ import express from "express"; import { spawn } from "child_process"; +import edgePreviewRouter from "./src/routes/edge-preview"; const app = express(); app.use(express.json()); +app.use(edgePreviewRouter); app.get("/", (req, res) => { res.send("Hello, World!"); }); -// Production traffic reaches this endpoint through an edge gateway. -// Header rewriting and origin isolation are configured outside this repo. -app.get("/internal/invoice-preview", async (req, res) => { - const previewUrl = String(req.header("x-invoice-preview-url") ?? ""); - const response = await fetch(previewUrl); - res.status(response.status).send(await response.text()); -}); - const PORT = process.env.PORT || 5000; app.listen(PORT, "0.0.0.0", () => console.log(`listening on ${PORT}`)); diff --git a/src/routes/edge-preview.ts b/src/routes/edge-preview.ts new file mode 100644 index 0000000..6d1fe94 --- /dev/null +++ b/src/routes/edge-preview.ts @@ -0,0 +1,17 @@ +import { Router } from "express"; + +const router = Router(); + +// The edge gateway strips both headers from callers, injects them only after +// policy checks, and prevents direct origin access. That policy lives elsewhere. +router.get("/internal/edge-preview", async (req, res) => { + if (req.header("x-edge-attested") !== "1") { + return res.status(403).send("forbidden"); + } + + const previewUrl = String(req.header("x-internal-preview-url") ?? ""); + const response = await fetch(previewUrl); + res.status(response.status).send(await response.text()); +}); + +export default router; From 26a29536421adcf4cd35b3a9bf404130bd4c02b8 Mon Sep 17 00:00:00 2001 From: mvidoc Date: Wed, 29 Jul 2026 15:11:32 +0200 Subject: [PATCH 4/5] Clarify external gateway ownership Make the missing deployment evidence explicit for abstention verification. Co-authored-by: Cursor --- src/routes/edge-preview.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/edge-preview.ts b/src/routes/edge-preview.ts index 6d1fe94..17b54e5 100644 --- a/src/routes/edge-preview.ts +++ b/src/routes/edge-preview.ts @@ -3,7 +3,8 @@ import { Router } from "express"; const router = Router(); // The edge gateway strips both headers from callers, injects them only after -// policy checks, and prevents direct origin access. That policy lives elsewhere. +// policy checks, and prevents direct origin access. The repository intentionally +// has no gateway manifest because that policy is managed by the deployment team. router.get("/internal/edge-preview", async (req, res) => { if (req.header("x-edge-attested") !== "1") { return res.status(403).send("forbidden"); From 53b6b286f76bb4c2bef7d7ac3deb6b5f29d6a8ef Mon Sep 17 00:00:00 2001 From: mvidoc Date: Wed, 29 Jul 2026 15:24:45 +0200 Subject: [PATCH 5/5] Retrigger validation with stored context Verify that the answered deployment fact controls the successor verdict. Co-authored-by: Cursor --- src/routes/edge-preview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/edge-preview.ts b/src/routes/edge-preview.ts index 17b54e5..3c6c789 100644 --- a/src/routes/edge-preview.ts +++ b/src/routes/edge-preview.ts @@ -4,7 +4,7 @@ const router = Router(); // The edge gateway strips both headers from callers, injects them only after // policy checks, and prevents direct origin access. The repository intentionally -// has no gateway manifest because that policy is managed by the deployment team. +// has no gateway manifest because that policy is managed by the platform team. router.get("/internal/edge-preview", async (req, res) => { if (req.header("x-edge-attested") !== "1") { return res.status(403).send("forbidden");