fix(browser): fingerprint cookies at the selected page URL (#763)

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This commit is contained in:
Rudy Mizrahi Celekli
2026-10-07 10:11:57 +08:00
committed by GitHub
parent 472b72a530
commit 78014e3d14
7 changed files with 58 additions and 7 deletions
@@ -52,6 +52,10 @@ export async function startBrowserVerifierSite() {
return;
}
response.setHeader("content-type", "text/html");
response.setHeader("set-cookie", [
"rea-root-cookie=root-fixture; Path=/; SameSite=Lax",
"rea-app-cookie=app-fixture; Path=/app; SameSite=Lax",
]);
response.end(
'<!doctype html><html><head><title>REA browser verifier</title></head><body><main><h1>Browser evidence</h1><button aria-label="ax-private-label-value">Verify</button></main><script type="module" src="/app.js?token=script-query-secret"></script></body></html>',
);
@@ -89,6 +89,14 @@ function assertObservationPrivacy(result) {
function assertObservationMetadata(result) {
if (!result.storage.local_storage_keys.includes("rea-storage-key"))
throw new Error("Real Chrome local-storage key inventory was missing");
if (
result.storage.content_fingerprints.filter(
({ scope }) => scope === "cookie",
).length !== 2
)
throw new Error(
"Real Chrome root and current-page cookie fingerprints were missing",
);
if (!result.storage.indexed_db_names.includes("rea-browser-db"))
throw new Error("Real Chrome IndexedDB name inventory was missing");
if (!result.storage.cache_names.includes("rea-browser-cache"))