Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Ignore the picomatch advisory in the admin UI's build tooling until 2026-12-17 (GST-2998) (#9661)

Garry Tan26636335a4da
diff --git a/.github/workflows/osv-scanner.yml b/.github/workflows/osv-scanner.yml
index 5ca28af265..355c7d3b0e 100644
--- a/.github/workflows/osv-scanner.yml
+++ b/.github/workflows/osv-scanner.yml
@@ -17,6 +17,7 @@ on:
- 'package.json'
- 'admin/bun.lock'
- 'admin/package.json'
+ - 'admin/osv-scanner.toml'
schedule:
- cron: '30 6 * * 1' # weekly, Monday 06:30 UTC
workflow_dispatch:
diff --git a/admin/osv-scanner.toml b/admin/osv-scanner.toml
new file mode 100644
index 0000000000..73741e76e3
--- /dev/null
+++ b/admin/osv-scanner.toml
@@ -0,0 +1,10 @@
+# Advisories ignored for admin/bun.lock only (never the root lockfile).
+# OSV-Scanner reads this file for the lockfile beside it and stops ignoring an
+# entry after its ignoreUntil date; scripts/ci-dependency-audit.sh passes the
+# same ids to the admin bun audit and fails once a date has passed.
+# Each entry needs Garry's approval and an expiry (docs/ci-event-parity.md).
+
+[[IgnoredVulns]]
+id = "GHSA-fc5q-39xc-vjpf"
+ignoreUntil = 2026-12-17
+reason = "picomatch is a build-time dependency of the admin UI's bundler (vite, through tinyglobby and fdir); its patterns come from our own build config; it is not in the CLI or server; no fixed version exists as of 2026-11-17. Remove when picomatch ships a fix."
diff --git a/changelog.d/capy-picomatch-advisory-expiring-ignore.md b/changelog.d/capy-picomatch-advisory-expiring-ignore.md
new file mode 100644
index 0000000000..9202852a6c
--- /dev/null
+++ b/changelog.d/capy-picomatch-advisory-expiring-ignore.md
@@ -0,0 +1,6 @@
+**Dependency scans no longer fail on the picomatch advisory GHSA-fc5q-39xc-vjpf in the admin UI's build tooling, until 2026-12-17.**
+
+### Tests and CI
+- `admin/osv-scanner.toml` ignores GHSA-fc5q-39xc-vjpf (a picomatch ReDoS with no fixed version yet) for `admin/bun.lock` only, until 2026-12-17. picomatch reaches the admin UI only through its bundler (vite), with patterns from our own build config, and is not in the CLI or the server. The root lockfile has no ignore.
+- OSV-Scanner reads that file for the admin lockfile and stops ignoring the entry after its date. `scripts/ci-dependency-audit.sh` passes the same ids to the admin `bun audit` until then; an entry past its date or without one is reported as `audit_ignore_expired` and the advisory is checked again, which fails a blocking run.
+- The advisory-only registry-outage test now has the same time budget as its sibling, so it no longer times out on slower machines.
diff --git a/docs/ci-event-parity.md b/docs/ci-event-parity.md
index c219a7a6d9..fe174f8d29 100644
--- a/docs/ci-event-parity.md
+++ b/docs/ci-event-parity.md
@@ -289,6 +289,14 @@ a push-to-master red opens the Test `master-red` issue, a scheduled red the
dependency. When no fix exists, an ignore entry needs Garry's approval and an
expiry date.
+Ignore entries live in `admin/osv-scanner.toml` and apply to `admin/bun.lock`
+only; the root lockfile has none. OSV-Scanner reads the file for that lockfile
+and stops ignoring an entry after its `ignoreUntil` date, and
+`scripts/ci-dependency-audit.sh` passes each id to the admin `bun audit` until
+that date, then reports `audit_ignore_expired`, which blocks like an advisory.
+Current entry: GHSA-fc5q-39xc-vjpf (picomatch, a build-time dependency of the
+admin UI's bundler, with no fixed version), until 2026-12-17.
+
## Crash robot ceilings
Every crash-robot run executes one fixed schedule list (`scripts/persistence/robot-driver.ts`
diff --git a/scripts/ci-dependency-audit.sh b/scripts/ci-dependency-audit.sh
index 2972cef4a4..cded485fb1 100755
--- a/scripts/ci-dependency-audit.sh
+++ b/scripts/ci-dependency-audit.sh
@@ -9,18 +9,48 @@
# its time limit) is retried with backoff inside AUDIT_DEADLINE_S, then reported
# as audit_registry_unavailable. Any other failure without bun's advisory report
# is audit_incomplete. Both block a blocking run, because nothing was checked.
+#
+# admin/osv-scanner.toml lists advisories ignored for admin/ only, each with an
+# ignoreUntil date (OSV-Scanner reads the same file). Each id is passed to the
+# admin bun audit as --ignore until its date; on and after that date the entry
+# is audit_ignore_expired, which blocks a blocking run. AUDIT_IGNORE_FILE and
+# AUDIT_TODAY (YYYY-MM-DD) override the file and the date for tests.
set -uo pipefail
deadline=$(( SECONDS + ${AUDIT_DEADLINE_S:-420} ))
read -r -a delays <<< "${AUDIT_RETRY_DELAYS:-15 45}"
-found=0 unavailable="" incomplete=""
+found=0 unavailable="" incomplete="" expired=""
+
+ignore_file=${AUDIT_IGNORE_FILE:-admin/osv-scanner.toml}
+today=${AUDIT_TODAY:-$(date -u +%F)}
+admin_ignores=()
+if [ -f "$ignore_file" ]; then
+ entries=$(awk '
+ function flush() { if (inblock) { if (id == "") bad = 1; else print id, (until == "" ? "none" : until) } }
+ /^[[:space:]]*(#|$)/ { next }
+ /^[[:space:]]*\[\[IgnoredVulns\]\][[:space:]]*$/ { flush(); inblock = 1; id = ""; until = ""; next }
+ /^[[:space:]]*\[/ { flush(); inblock = 0; next }
+ inblock && /^[[:space:]]*id[[:space:]]*=/ { if (match($0, /"[^"]*"/)) id = substr($0, RSTART + 1, RLENGTH - 2); else bad = 1; next }
+ inblock && /^[[:space:]]*ignoreUntil[[:space:]]*=/ { v = $0; sub(/^[^=]*=[[:space:]]*/, "", v); sub(/[[:space:]]*(#.*)?$/, "", v); until = v; next }
+ inblock && /^[[:space:]]*[A-Za-z_]+[[:space:]]*=/ { next }
+ { bad = 1 }
+ END { flush(); if (bad) exit 1 }
+ ' "$ignore_file") || { echo "::error::audit_ignore_unreadable: $ignore_file has a line or an entry this script cannot read (each [[IgnoredVulns]] needs id = \"<id>\" and ignoreUntil = YYYY-MM-DD)"; exit 1; }
+ while read -r id until; do
+ [ -n "$id" ] || continue
+ if ! [[ "$until" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then expired+="${expired:+; }$id has no ignoreUntil date"
+ elif [[ ! "$today" < "$until" ]]; then expired+="${expired:+; }$id expired on $until"
+ else admin_ignores+=("--ignore=$id"); echo "bun audit in admin ignores $id until $until ($ignore_file)"; fi
+ done <<< "$entries"
+fi
audit() {
local dir=$1 attempt=0 out rc remaining
+ shift
while :; do
remaining=$(( deadline - SECONDS ))
if [ "$remaining" -lt 10 ]; then unavailable+="${unavailable:+; }$dir: not attempted, AUDIT_DEADLINE_S spent on earlier attempts"; return 0; fi
- out=$(cd "$dir" && timeout "$(( remaining < ${AUDIT_ATTEMPT_TIMEOUT_S:-120} ? remaining : ${AUDIT_ATTEMPT_TIMEOUT_S:-120} ))" bun audit 2>&1); rc=$?
+ out=$(cd "$dir" && timeout "$(( remaining < ${AUDIT_ATTEMPT_TIMEOUT_S:-120} ? remaining : ${AUDIT_ATTEMPT_TIMEOUT_S:-120} ))" bun audit "$@" 2>&1); rc=$?
printf '%s\n' "$out"
[ "$rc" -eq 0 ] && return 0
if grep -Eq '^[0-9]+ vulnerabilit(y|ies) \(' <<< "$out"; then found=1; return 0; fi
@@ -41,7 +71,7 @@ audit() {
}
audit .
-audit admin
+audit admin "${admin_ignores[@]}"
blocking=true; [ "${BLOCKING:-true}" = false ] && blocking=false
problems=0
@@ -55,6 +85,11 @@ if [ -n "$incomplete" ]; then
msg="audit_incomplete: bun audit failed without an advisory report ($incomplete). Why: a failed audit checked nothing, which is not the same as finding advisories. Fix: run bun audit locally in that directory and fix what it reports (lockfile or install state)."
if $blocking; then echo "::error::$msg (blocking: ${REASON:-unknown scope})"; else echo "::warning::$msg (advisory-only: ${REASON:-})"; fi
fi
+if [ -n "$expired" ]; then
+ problems=1
+ msg="audit_ignore_expired: an ignored advisory in $ignore_file is past its date or has none ($expired), so it is checked again. Why: an ignore is approved only until its date. Fix: bump or replace the package, or get a new approval and date and update the entry."
+ if $blocking; then echo "::error::$msg (blocking: ${REASON:-unknown scope})"; else echo "::warning::$msg (advisory-only: ${REASON:-})"; fi
+fi
if [ "$found" -eq 1 ]; then
problems=1
if $blocking; then
diff --git a/test/scripts/ci-dependency-audit.test.ts b/test/scripts/ci-dependency-audit.test.ts
index cf73ead934..33eace7ce5 100644
--- a/test/scripts/ci-dependency-audit.test.ts
+++ b/test/scripts/ci-dependency-audit.test.ts
@@ -4,6 +4,8 @@
* registry (BUN_CONFIG_REGISTRY) answers 503, then advisories, then nothing found; the real `bun audit` runs against it.
*/
import { afterAll, beforeAll, expect, test } from 'bun:test';
+import { readFileSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
import { join } from 'node:path';
const ROOT = join(import.meta.dir, '..', '..');
@@ -14,17 +16,20 @@ beforeAll(() => {
server = Bun.serve({ port: 0, hostname: '127.0.0.1', async fetch(req) {
if (!new URL(req.url).pathname.endsWith('/-/npm/v1/security/advisories/bulk')) return new Response('not found', { status: 404 });
const status = plan[calls++] ?? plan.at(-1)!;
- if (status !== 200 && status !== 299) return new Response('Service Unavailable', { status });
+ if (status < 200 || status > 299) return new Response('Service Unavailable', { status });
if (status === 200) return Response.json({});
const raw = new Uint8Array(await req.arrayBuffer());
let text: string; try { text = new TextDecoder().decode(Bun.gunzipSync(raw)); } catch { text = new TextDecoder().decode(raw); }
- const [name] = Object.keys(JSON.parse(text) as Record<string, string[]>);
+ const names = Object.keys(JSON.parse(text) as Record<string, string[]>);
+ // 298 answers only admin/ (vite is admin-only), 297 only the root (@ai-sdk/anthropic is root-only).
+ if ((status === 298 && !names.includes('vite')) || (status === 297 && !names.includes('@ai-sdk/anthropic'))) return Response.json({});
+ const [name] = names;
return Response.json({ [name!]: [{ id: 1, url: 'https://github.com/advisories/GHSA-0000-0000-0000', title: 'Synthetic advisory', severity: 'high', vulnerable_versions: '*', cwe: [], cvss: { score: 7.5, vectorString: null } }] });
} });
});
afterAll(() => server.stop(true));
-/** 299 stands for "answers with an advisory for the first package". */
+/** 299 stands for "answers with an advisory for the first package"; 298 and 297 do so for admin/ or the root only. */
async function audit(statuses: number[], env: Record<string, string> = {}) {
plan = statuses; calls = 0;
// Asynchronous: the stub registry answers on this test's event loop.
@@ -75,4 +80,59 @@ test('an unavailable registry on an advisory-only run warns without failing', as
expect(run.status).toBe(0);
expect(run.out).toContain('::warning::audit_registry_unavailable');
expect(run.out).not.toContain('found advisories');
+}, 60_000);
+
+function ignoreFile(id: string, until: string) {
+ const path = join(tmpdir(), `audit-ignore-${process.pid}-${until}.toml`);
+ writeFileSync(path, `[[IgnoredVulns]]\nid = "${id}"\nignoreUntil = ${until}\nreason = "test"\n`);
+ return path;
+}
+
+test('an ignore entry before its date clears that advisory in admin/', async () => {
+ const run = await audit([298], { AUDIT_IGNORE_FILE: ignoreFile('GHSA-0000-0000-0000', '2026-12-17'), AUDIT_TODAY: '2026-11-17' });
+ expect(run.out).toContain('bun audit in admin ignores GHSA-0000-0000-0000 until 2026-12-17');
+ expect(run.out).toContain('bun audit: no advisories.');
+ expect(run.status).toBe(0);
+});
+
+test('an ignore entry never applies to the root lockfile', async () => {
+ const run = await audit([297], { AUDIT_IGNORE_FILE: ignoreFile('GHSA-0000-0000-0000', '2026-12-17'), AUDIT_TODAY: '2026-11-17' });
+ expect(run.status).toBe(1);
+ expect(run.out).toContain('::error::bun audit found advisories');
+});
+
+test('an ignore entry on or after its date blocks as audit_ignore_expired and is checked again', async () => {
+ const run = await audit([298], { AUDIT_IGNORE_FILE: ignoreFile('GHSA-0000-0000-0000', '2026-12-17'), AUDIT_TODAY: '2026-12-17' });
+ expect(run.status).toBe(1);
+ expect(run.out).toContain('::error::audit_ignore_expired');
+ expect(run.out).toContain('GHSA-0000-0000-0000 expired on 2026-12-17');
+ expect(run.out).toContain('::error::bun audit found advisories');
+ expect(run.out).not.toContain('ignores GHSA-0000-0000-0000');
+});
+
+test('the shipped admin ignore file parses and every entry has a date', () => {
+ const t = Bun.TOML.parse(readFileSync(join(ROOT, 'admin', 'osv-scanner.toml'), 'utf8')) as { IgnoredVulns: { id: string; ignoreUntil: unknown; reason: string }[] };
+ expect(t.IgnoredVulns.length).toBeGreaterThan(0);
+ for (const v of t.IgnoredVulns) {
+ expect(String(v.ignoreUntil)).toMatch(/^\d{4}-\d{2}-\d{2}$/);
+ expect(v.reason.length).toBeGreaterThan(20);
+ }
+});
+
+test('an ignore entry without ignoreUntil blocks as audit_ignore_expired and is not ignored', async () => {
+ const path = join(tmpdir(), `audit-ignore-${process.pid}-nodate.toml`);
+ writeFileSync(path, '[[IgnoredVulns]]\nid = "GHSA-0000-0000-0000"\nreason = "test"\n');
+ const run = await audit([298], { AUDIT_IGNORE_FILE: path, AUDIT_TODAY: '2026-11-17' });
+ expect(run.status).toBe(1);
+ expect(run.out).toContain('::error::audit_ignore_expired');
+ expect(run.out).toContain('GHSA-0000-0000-0000 has no ignoreUntil date');
+ expect(run.out).toContain('::error::bun audit found advisories');
+});
+
+test('an unreadable ignore file fails as audit_ignore_unreadable', async () => {
+ const path = join(tmpdir(), `audit-ignore-${process.pid}-bad.toml`);
+ writeFileSync(path, '[[IgnoredVulns]\nid = ');
+ const run = await audit([200], { AUDIT_IGNORE_FILE: path });
+ expect(run.status).toBe(1);
+ expect(run.out).toContain('::error::audit_ignore_unreadable');
});