Skip to content

Commit ad4129f

Browse files
committed
fix(ci): honor osv-scanner ignores in bun audit
CI failed because bun audit does not read osv-scanner.toml. Add a small wrapper that applies those GHSA ignores, align docs sharp override with the direct 0.35.3 pin, and refresh the ioredis rationale.
1 parent a273478 commit ad4129f

9 files changed

Lines changed: 82 additions & 39 deletions

File tree

.github/workflows/apps-api-security-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ jobs:
9393

9494
- name: bun audit
9595
if: steps.filter.outputs.code == 'true'
96-
run: bun audit --audit-level=high
96+
run: bash scripts/ci/bun-audit.sh

.github/workflows/apps-docs-security-deps.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ jobs:
9898
fi
9999
100100
# No bun audit step here: osv-scanner above with osv-scanner.toml is
101-
# the canonical "what we accept" allowlist for this docs repo. bun
102-
# audit can't reference the same allowlist (CVE IDs only, no GHSA
103-
# support), so it would always reintroduce noise. The docs site is a
104-
# static-site build with no runtime auth or user input. osv is
105-
# sufficient coverage.
101+
# the canonical "what we accept" allowlist for this docs repo. The
102+
# docs site is a static-site build with no runtime auth or user input;
103+
# osv is sufficient coverage. (api/ui run bun audit via
104+
# scripts/ci/bun-audit.sh which applies the same GHSA ignores.)

.github/workflows/apps-ui-security-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ jobs:
9191

9292
- name: bun audit
9393
if: steps.filter.outputs.code == 'true'
94-
run: bun audit --audit-level high
94+
run: bash scripts/ci/bun-audit.sh

.github/workflows/apps-ui-validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656

5757
- name: Dependency audit
5858
if: steps.filter.outputs.code == 'true'
59-
run: bun audit --audit-level high
59+
run: bash scripts/ci/bun-audit.sh
6060

6161
- name: Lint + format + typecheck
6262
if: steps.filter.outputs.code == 'true'

apps/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"@typescript-eslint/utils": "Single @typescript-eslint/utils resolution across the workspace so the shared @boring-stack-pkg ESLint plugins all load the same utils version. The UI and docs apps mirror this exact pin; a mismatch makes the custom plugins resolve divergent utils copies and fail to load.",
130130
"axios": "Pin patched axios (GHSA-gcfj-64vw-6mp9 and related SSRF/credential-leak advisories). 1.16.0 is vulnerable; 1.18.0 patches it. Pulled in transitively via @sendgrid/mail -> @sendgrid/client.",
131131
"form-data": "Pin patched form-data (GHSA-hmw2-7cc7-3qxx CRLF injection via unescaped multipart field names); 4.0.5 is vulnerable, 4.0.6 patches it. Pulled in transitively via @sendgrid/mail -> @sendgrid/client -> axios. Excluded from the install quarantine while <7 days old.",
132-
"ioredis": "Force a single ioredis resolution across the tree. bullmq 5.78.0 exact-pins ioredis@5.10.1, so bumping the top-level dep to 5.11.1 otherwise leaves bullmq on its own nested 5.10.1 copy — two ioredis instances whose RedisOptions types are structurally incompatible (tsc fails on new Redis(options) calls). This override collapses bullmq's nested copy onto 5.11.1 too; 5.10.1 -> 5.11.1 is a semver patch and the Redis/BullMQ integration tests verify runtime compatibility. Drop this once bullmq advances its own ioredis pin.",
132+
"ioredis": "Force a single ioredis resolution across the tree. bullmq 5.80.2 exact-pins ioredis@5.10.1, so bumping the top-level dep to 5.11.1 otherwise leaves bullmq on its own nested 5.10.1 copy — two ioredis instances whose RedisOptions types are structurally incompatible (tsc fails on new Redis(options) calls). This override collapses bullmq's nested copy onto 5.11.1 too; 5.10.1 -> 5.11.1 is a semver patch and the Redis/BullMQ integration tests verify runtime compatibility. Drop this once bullmq advances its own ioredis pin.",
133133
"protobufjs": "Pin patched protobufjs (GHSA-j3f2-48v5-ccww). 7.6.1 is vulnerable; 7.6.5 patches it. Transitive via the OpenTelemetry OTLP exporter (build/telemetry path)."
134134
},
135135
"overrides": {

apps/api/scripts/ci/bun-audit.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
# Run `bun audit` honoring osv-scanner.toml IgnoredVulns (GHSA ids).
3+
# osv-scanner and bun audit otherwise diverge: osv reads the toml allowlist,
4+
# bun audit does not — so CI would fail on accepted-risk findings.
5+
set -euo pipefail
6+
7+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
8+
CONFIG="$ROOT/osv-scanner.toml"
9+
10+
ignores=()
11+
if [[ -f "$CONFIG" ]]; then
12+
while IFS= read -r id; do
13+
[[ -n "$id" ]] || continue
14+
ignores+=(--ignore="$id")
15+
done < <(grep -E '^id = "' "$CONFIG" | sed -E 's/^id = "([^"]+)".*/\1/')
16+
fi
17+
18+
if ((${#ignores[@]})); then
19+
echo "bun audit: applying ${#ignores[@]} ignore(s) from osv-scanner.toml"
20+
fi
21+
22+
exec bun audit --audit-level=high "${ignores[@]}"

apps/docs/bun.lock

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"dompurify": "Pin patched DOMPurify (GHSA-c2j3-45gr-mqc4). 3.4.7 is vulnerable; 3.4.12 patches it. Pulled via mermaid diagram rendering; diagram source is author-controlled.",
6262
"js-yaml": "Pin patched js-yaml (GHSA-52cp-r559-cp3m). 4.2.0 is vulnerable; 4.3.0 patches it. Build-time config loading only.",
6363
"postcss": "Pin patched postcss (GHSA-r28c-9q8g-f849). 8.5.16 is vulnerable; 8.5.18 patches it. Build-time CSS tooling via vite/tailwind.",
64-
"sharp": "Pin patched sharp (GHSA-f88m-g3jw-g9cj). 0.34.5 is vulnerable; 0.35.0 patches it. Image processing at build time only.",
64+
"sharp": "Collapse transitive sharp@0.34.5 (GHSA-f88m-g3jw-g9cj) onto the direct sharp@0.35.3 pin. Image processing at build time only.",
6565
"svgo": "Pin patched svgo (GHSA-2p49-hgcm-8545). 4.0.1 is vulnerable; 4.0.2 patches it. SVG optimization at build time only.",
6666
"ws": "Pin patched ws (GHSA-58qx-3vcg-4xpx) pulled via miniflare/wrangler dev tooling.",
6767
"devalue": "Pin patched devalue build-time serialization XSS (GHSA-77vg-94rm-hx3p).",
@@ -83,7 +83,7 @@
8383
"js-yaml": "4.3.0",
8484
"postcss": "8.5.18",
8585
"qs": "6.15.2",
86-
"sharp": "0.35.0",
86+
"sharp": "0.35.3",
8787
"svgo": "4.0.2",
8888
"tmp": "0.2.7",
8989
"undici": "7.28.0",

apps/ui/scripts/ci/bun-audit.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
# Run `bun audit` honoring osv-scanner.toml IgnoredVulns (GHSA ids).
3+
# osv-scanner and bun audit otherwise diverge: osv reads the toml allowlist,
4+
# bun audit does not — so CI would fail on accepted-risk findings.
5+
set -euo pipefail
6+
7+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
8+
CONFIG="$ROOT/osv-scanner.toml"
9+
10+
ignores=()
11+
if [[ -f "$CONFIG" ]]; then
12+
while IFS= read -r id; do
13+
[[ -n "$id" ]] || continue
14+
ignores+=(--ignore="$id")
15+
done < <(grep -E '^id = "' "$CONFIG" | sed -E 's/^id = "([^"]+)".*/\1/')
16+
fi
17+
18+
if ((${#ignores[@]})); then
19+
echo "bun audit: applying ${#ignores[@]} ignore(s) from osv-scanner.toml"
20+
fi
21+
22+
exec bun audit --audit-level=high "${ignores[@]}"

0 commit comments

Comments
 (0)