Skip to content

Bump vulnerable transitive deps, pin corepack, scope workflow permissions - #193

Merged
Logan2234 merged 2 commits into
mainfrom
fix/security-alerts-dependabot-scorecard
Sep 5, 2026
Merged

Bump vulnerable transitive deps, pin corepack, scope workflow permissions#193
Logan2234 merged 2 commits into
mainfrom
fix/security-alerts-dependabot-scorecard

Conversation

@Logan2234

Copy link
Copy Markdown
Owner

Summary

  • Force fast-uri, deepmerge-ts, tmp and uuid to their first patched version via pnpm.overrides (all pulled in transitively through ajv/fastify, prisma, and lhci) — fixes 12 Dependabot alerts and all 9 Trivy alerts (same CVEs, found inside the Docker image's pruned node_modules).
  • Pin the corepack version installed in both Dockerfiles (was npm install -g corepack, unpinned) — fixes 2 Scorecard PinnedDependenciesID alerts.
  • Add an explicit read-only top-level permissions: contents: read to generate-openapi-artifact.yml, which had none — fixes 1 Scorecard TokenPermissionsID alert.
  • Touching pnpm-lock.yaml/pnpm-workspace.yaml re-triggers both lint-test-api and lint-test-web in CI, which re-uploads clean ESLint SARIF and should auto-close the 20 stale ESLint code-scanning alerts — the underlying no-explicit-any/no-console violations were already fixed in earlier commits, but CI only reruns those jobs when apps/api/apps/web paths change, so GitHub never got a follow-up scan to close them.

Not fixed here (see conversation for the full breakdown)

  • Dependabot ⬆️ Bump the dev-dependencies group across 1 directory with 10 updates #37 (extract-zip symlink traversal): no patched version exists upstream (latest published is still the vulnerable 2.0.1). Pulled in only via @lhci/cli → Lighthouse → puppeteer-core for downloading Chromium in CI, never touches user-controlled input. Recommend accepting the risk / dismissing the alert.
  • Scorecard TokenPermissionsID on dependabot-auto-merge.yml: already correctly scoped (workflow-level contents: read, job-level contents: write + pull-requests: write only for the job that actually needs to squash-merge). Scorecard flags any job-level write grant regardless of necessity — this one is required for the feature to work.
  • Scorecard Fuzzing/CIIBestPractices/CodeReview/Maintained/BranchProtection: not code fixes — respectively no fuzzing setup, no OpenSSF badge application, direct-to-main push history (0/28 "approved changesets"), repo age, and main branch protection settings. Branch protection is the one that's actually actionable (a GitHub repo-settings change, not code) if you want it enabled.

Test plan

  • pnpm install succeeds, lockfile clean, vulnerable versions gone (verified via pnpm why)
  • pnpm build:package, API build (prisma generate + nest build), web build all succeed
  • pnpm --filter @loomkeep/api --filter @loomkeep/shared lint and pnpm --filter @loomkeep/web lint — 0 issues (matches CI's exact commands)
  • pre-push hook typecheck passed

🤖 Generated with Claude Code

…ssions

fast-uri (SSRF/host confusion), deepmerge-ts (stack exhaustion), tmp (path
traversal) and uuid (buffer bounds check) were all pulled in transitively
(ajv/fastify, prisma, lhci) below their first patched version — force them
via pnpm.overrides since none are direct dependencies. Trivy flagged the
same fast-uri/deepmerge-ts CVEs inside the built Docker image's pruned
node_modules, so this clears both.

Also: pin the corepack version installed in both Dockerfiles (was
unpinned), and add an explicit read-only top-level `permissions` block to
generate-openapi-artifact.yml (had none, so it defaulted to the
repo-wide token scope).

extract-zip's symlink traversal (dependabot #37) has no upstream fix yet
(latest is still the vulnerable 2.0.1) — pulled in only by @lhci/cli's
Lighthouse/puppeteer chain for Chromium download during CI, not exposed to
any user input, left as an accepted risk.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added docker Dockerfiles, docker-compose, self-hosting stack ci CI/CD, GitHub Actions workflows api apps/api (NestJS) web apps/web (SvelteKit) labels Sep 5, 2026
… palette

ZAP's weekly scan hits the web/api containers directly (no Caddy in front),
which surfaced a real gap: the web app set no security headers itself,
relying entirely on Caddy's edge config — so a self-host install without
Caddy (or a custom reverse proxy missing equivalent headers) shipped
unprotected. hooks.server.ts now sets X-Frame-Options/X-Content-Type-Options
on every response either way; CSP stays out of scope (Caddy's own is still
Report-Only, a separate decision).

favicon.ico served empty Content-Type: sirv (adapter-node's static file
server) resolves MIME types via mrmime, which has no `.ico` entry. Routed
it through a +server.ts instead (favicon.ico?inline import, so the binary
stays a real file in git rather than a hand-pasted base64 blob) to set it
explicitly.

Also reworked the light theme ("le programme") palette: --accent's hue had
drifted from the dark theme's amber (33° vs 40°) and --bg was oversaturated
tan, together reading muddy/pink rather than clean paper. Realigned accent
to the same hue as dark mode's amber, lightened/desaturated bg, and
retuned success/danger/warning/stat-*/tier-silver (already correctly
hue-matched to dark mode) for AA contrast on the new bg — pa11y's
color-contrast audit was failing all of these on the landing and auth
pages. Dark theme untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/web/src/routes/favicon.ico/+server.ts 0.000% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Logan2234
Logan2234 merged commit b71775c into main Sep 5, 2026
19 of 20 checks passed
@Logan2234
Logan2234 deleted the fix/security-alerts-dependabot-scorecard branch September 5, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api apps/api (NestJS) ci CI/CD, GitHub Actions workflows docker Dockerfiles, docker-compose, self-hosting stack web apps/web (SvelteKit)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant