Skip to content

chore(security): close all open Dependabot + CodeQL alerts#459

Merged
amavashev merged 1 commit intomainfrom
chore/security-fixes
Apr 19, 2026
Merged

chore(security): close all open Dependabot + CodeQL alerts#459
amavashev merged 1 commit intomainfrom
chore/security-fixes

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

Summary

Closes all 8 open Dependabot alerts and both open CodeQL findings on runcycles/docs.

Changes

Fix Mechanism Alerts cleared
Remove unused to-ico + png-to-ico devDeps They were declared but never imported by any script — see grep. They drag in deprecated request@2.x (and its transitive form-data / qs / tough-cookie), mkdirp@0.5.1minimist@0.0.8, and minimist@1.x directly. Dependabot #5, #6, #7, #9, #10, plus #1 / older minimist
overrides: { esbuild: "^0.25.0" } Forces all transitive esbuild consumers (vite via vitepress + vitest) onto the patched line. Dependabot #8 (esbuild dev-server CORS)
(no change needed for vite #16) Installed vite@5.4.21 and vite@8.0.8 already include the path-traversal patch. Dependabot will auto-clear on next scan. Dependabot #16
Restrict ci.yml GITHUB_TOKEN to contents: read The workflow only reads code and runs tests — no need for write scope. CodeQL #3 (actions/missing-workflow-permissions, MEDIUM)
Fixed-point loop in estimateReadingTime HTML strip Single-pass /<[^>]*>/g was flagged as incomplete sanitization (overlapping tag sequences could leak). Output is only used for word-count math, not rendered, so defensive — but clears the rule. CodeQL #2 (js/incomplete-multi-character-sanitization, HIGH)

Why

to-ico / png-to-ico haven't been used by any script in this repo for some time — they likely date from an earlier favicon-generation flow that was replaced by sharp (still a dep). Removing them is purely cleanup; the deprecated request chain they pulled in was the source of two of the critical alerts.

esbuild override is the standard transitive-pinning play — Vite's API surface has been stable across the 0.21 → 0.25 esbuild range, and the build verifies cleanly.

Test plan

  • npm install — 129 packages removed, no new vulns introduced
  • npm test — 3 files, 33 tests, all pass
  • npm run build — full vitepress build succeeds (87s)
  • CI runs green on this PR
  • Post-merge: confirm Dependabot + CodeQL alerts close automatically (Security tab → Dependabot alerts / Code scanning alerts)

Removes the unused `to-ico` and `png-to-ico` devDependencies, which
were never imported by any script but pulled in `request`,
`form-data`, `qs`, `tough-cookie`, `mkdirp@0.5.1`, and old `minimist`
through `jimp@0.2.x` — the source of 7 of 8 Dependabot alerts
(2 critical: form-data unsafe random, minimist prototype pollution).

Adds an `overrides` block forcing `esbuild ^0.25.0` to clear the
last Dependabot alert (esbuild dev-server CORS, GHSA-67mh-4wv8-2f99).
The vite path-traversal alert is already fixed by the installed
vite 5.4.21 / 8.0.8 — Dependabot will auto-clear it on next scan.

Also fixes two CodeQL findings:
- ci.yml had no top-level permissions block (medium). Restricted to
  `contents: read` — the workflow only reads code and runs tests.
- estimateReadingTime in blog/posts.data.ts used a single-pass tag
  strip (`/<[^>]*>/g`) flagged as `js/incomplete-multi-character-
  sanitization` (high). Replaced with a fixed-point loop so nested
  / overlapping tag sequences can't leak through. The output is
  only used for word-count math, not rendered, so this is defensive
  rather than load-bearing — but clears the alert.

Build + 33 tests pass on the new lockfile.
@amavashev amavashev merged commit bf5481f into main Apr 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant