Skip to content

Commit 4301562

Browse files
author
Codex
committed
Resolve CodeQL findings and restore scan coverage
1 parent 21b84fa commit 4301562

5 files changed

Lines changed: 41 additions & 23 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: 🔍 Initialize CodeQL
2727
uses: github/codeql-action/init@v4
2828
with:
29-
languages: javascript-typescript
29+
languages: javascript-typescript, actions
3030
# Config excludes public/ (154 minified React bundle files) and docs/
3131
# which would otherwise generate hundreds of false-positive warnings.
3232
# Uses security-extended only — security-and-quality adds stylistic

audit/current/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Current file audit
22

33
Schema: 1
4-
Worktree fingerprint: 69d98b41205ad15b421b84610e16f9036bff62be09bb1083820e710a9538766e
4+
Worktree fingerprint: 78276793714b1ccbcad3c278eb0b0003efc5391c32af5bef39d959d34d7ff1f6
55
Audited files: 437
66
Git-tracked non-audit files: 437
77
Untracked non-audit files: 0
@@ -31,7 +31,7 @@ Active/reachable files: 257
3131
- injection.inner_html: 95
3232
- network.fetch: 126
3333
- network.http_client: 12
34-
- network.supabase_client: 63
34+
- network.supabase_client: 64
3535
- network.websocket: 24
3636
- secrets.identifiers: 55
3737
- sql.rls: 371

audit/current/manifest.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": 1,
33
"repository": {
4-
"worktreeFingerprint": "69d98b41205ad15b421b84610e16f9036bff62be09bb1083820e710a9538766e"
4+
"worktreeFingerprint": "78276793714b1ccbcad3c278eb0b0003efc5391c32af5bef39d959d34d7ff1f6"
55
},
66
"scope": {
77
"source": "Git index paths with current worktree content",
@@ -15,7 +15,7 @@
1515
"auditedFileCount": 437
1616
},
1717
"summary": {
18-
"totalBytes": 71977711,
18+
"totalBytes": 71978261,
1919
"activeFileCount": 257,
2020
"classifications": {
2121
"authored:configuration": 26,
@@ -59,7 +59,7 @@
5959
"injection.inner_html": 95,
6060
"network.fetch": 126,
6161
"network.http_client": 12,
62-
"network.supabase_client": 63,
62+
"network.supabase_client": 64,
6363
"network.websocket": 24,
6464
"secrets.identifiers": 55,
6565
"sql.rls": 371,
@@ -310,8 +310,8 @@
310310
{
311311
"path": ".github/workflows/codeql.yml",
312312
"source": "git-tracked",
313-
"sha256": "2a0c9eb1703c8f40a55c3f9047144705ff13269792569c444990e917ab65ac42",
314-
"size": 1154,
313+
"sha256": "b1d3651761559f3c0add740d345b04ca856e19d0e0ec4d51cc310c61bccab34a",
314+
"size": 1163,
315315
"type": "yaml",
316316
"text": true,
317317
"classification": "authored:configuration",
@@ -12669,8 +12669,8 @@
1266912669
{
1267012670
"path": "scripts/patch-lhci-js-yaml.mjs",
1267112671
"source": "git-tracked",
12672-
"sha256": "ab89a38940aca04dbe5866a8fbc6b171a7e8f248d92135377327d31c6f3524dc",
12673-
"size": 571,
12672+
"sha256": "0402e6cbf43f3e7ca392d5cff4423c62fef05774ba3a2ab0332b5f8a42e92ef3",
12673+
"size": 816,
1267412674
"type": "javascript",
1267512675
"text": true,
1267612676
"classification": "authored:tooling",
@@ -13275,8 +13275,8 @@
1327513275
{
1327613276
"path": "scripts/verify-supabase-security.mjs",
1327713277
"source": "git-tracked",
13278-
"sha256": "e9a3e1d71fbeb2ce7b27d34cd29ff549882f51a69c5a2a74e4a282e90f972c64",
13279-
"size": 19998,
13278+
"sha256": "e1f29387c4578f50f170baa67e0037e67091f46123c04239efaf058836629f89",
13279+
"size": 20294,
1328013280
"type": "javascript",
1328113281
"text": true,
1328213282
"classification": "authored:tooling",
@@ -13309,7 +13309,7 @@
1330913309
},
1331013310
{
1331113311
"id": "network.supabase_client",
13312-
"count": 1
13312+
"count": 2
1331313313
},
1331413314
{
1331513315
"id": "secrets.identifiers",

scripts/patch-lhci-js-yaml.mjs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@ import fs from 'node:fs';
22
import path from 'node:path';
33

44
const target = path.resolve('node_modules/@lhci/utils/src/lighthouserc.js');
5-
if (!fs.existsSync(target)) process.exit(0);
5+
let handle;
6+
try {
7+
handle = fs.openSync(target, 'r+');
8+
} catch (error) {
9+
if (error?.code === 'ENOENT') process.exit(0);
10+
throw error;
11+
}
612

7-
const source = fs.readFileSync(target, 'utf8');
8-
const oldCall = 'yaml.safeLoad(contents)';
9-
const newCall = '(yaml.load || yaml.safeLoad)(contents)';
13+
try {
14+
const source = fs.readFileSync(handle, 'utf8');
15+
const oldCall = 'yaml.safeLoad(contents)';
16+
const newCall = '(yaml.load || yaml.safeLoad)(contents)';
1017

11-
if (source.includes(newCall)) process.exit(0);
12-
if (!source.includes(oldCall)) {
13-
throw new Error('Unsupported @lhci/utils lighthouserc parser; update the compatibility patch');
18+
if (source.includes(newCall)) {
19+
// Already patched by an earlier install.
20+
} else if (!source.includes(oldCall)) {
21+
throw new Error('Unsupported @lhci/utils lighthouserc parser; update the compatibility patch');
22+
} else {
23+
fs.ftruncateSync(handle, 0);
24+
fs.writeSync(handle, source.replace(oldCall, newCall), 0, 'utf8');
25+
}
26+
} finally {
27+
fs.closeSync(handle);
1428
}
15-
16-
fs.writeFileSync(target, source.replace(oldCall, newCall));

scripts/verify-supabase-security.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import crypto from 'crypto';
33
import { loadEnv } from './storage-backup-lib.mjs';
44

55
const env = loadEnv();
6-
const base = env.SUPABASE_URL?.replace(/\/$/, '');
6+
const expectedBase = 'https://vteqquoqvksshmfhuepu.supabase.co';
7+
const configuredBase = env.SUPABASE_URL?.replace(/\/$/, '');
8+
if (configuredBase && configuredBase !== expectedBase) {
9+
console.error(`Refusing to run the production security proof against unexpected project URL: ${configuredBase}`);
10+
process.exit(1);
11+
}
12+
const base = expectedBase;
713
const service = env.SUPABASE_SECRET_KEY || env.SUPABASE_SERVICE_ROLE_KEY;
814
const anon = env.SUPABASE_ANON_KEY;
915

0 commit comments

Comments
 (0)