From 4a712c827c1487c0290ffbd47d2973b771415e6a Mon Sep 17 00:00:00 2001 From: Thomas Bohn Date: Tue, 7 Jul 2026 21:31:40 -0500 Subject: [PATCH] Security: resolve 12 Dependabot vulnerabilities + 3 code-scanning findings (#35) * fix(deps): resolve 12 Dependabot vulnerabilities via npm audit + postcss override Runs npm audit fix to resolve 11 of 12 flagged vulnerabilities in transitive devDependencies (eslint tooling, puppeteer chain, gray-matter): - @babel/core: arbitrary file read via sourceMappingURL (GHSA-4x5r-pxfx-6jf8) - ajv: ReDoS via $data option (GHSA-2g4f-4pwh-qvx6) - basic-ftp: path traversal + CRLF injection + 2x DoS (critical) (GHSA-5rq4-664w-9x2c, GHSA-6v7q-wjvx-w8wg, GHSA-rp42-5vxx-qpwr, GHSA-rpmf-866q-6p89) - brace-expansion: zero-step sequence DoS (GHSA-f886-m6hf-6m8v) - flatted: unbounded recursion DoS + prototype pollution (GHSA-25h7-pfq9-p65f, GHSA-rf6f-7fwh-wjgh) - ip-address: XSS in Address6 HTML-emitting methods (GHSA-v2v4-37r5-5v8g) - js-yaml: quadratic-complexity DoS via merge key handling (GHSA-h67p-54hq-rp68) - minimatch: 3x ReDoS via wildcard/extglob backtracking (GHSA-3ppc-4f35-3m26, GHSA-7r86-cg39-jmmj, GHSA-23c5-xmqv-rm74) - picomatch: method injection + ReDoS (GHSA-3v7f-55p6-f55p, GHSA-c2c7-rcm5-vvqj) - ws: uninitialized memory disclosure + memory exhaustion DoS (GHSA-58qx-3vcg-4xpx, GHSA-96hv-2xvq-fx4p) The 12th finding (postcss XSS via unescaped , GHSA-qx2v-qp2m-jg93) could not be fixed by npm audit fix because Next.js bundles its own internal copy of postcss (node_modules/next/node_modules/postcss@8.4.31) that npm's suggested resolution would only fix by downgrading next to 9.3.3 - not viable. Instead: - Bump the direct postcss devDependency to ^8.5.10 (patched). - Add a package.json "overrides" entry pinning postcss to ^8.5.10 for every nested copy in the dependency tree, including the one bundled inside next, without downgrading next itself. Result: `npm audit` now reports 0 vulnerabilities (down from 12: 1 low, 6 moderate, 4 high, 1 critical). Verified `npm run build` and `npx tsc --noEmit` still succeed with no regressions. Co-authored-by: Thomas Bohn * fix(security): sanitize blog HTML, validate external podcast links, harden path resolution Addresses code-scanning findings in JS/TS application code: 1. XSS via dangerouslySetInnerHTML with unsanitized Markdown HTML (lib/blog.ts, app/blog/[slug]/page.tsx). remark-html does not sanitize its output, so raw HTML embedded in a blog Markdown file (local or Medium-synced) would be rendered as-is in the browser. Added sanitize-html with an explicit tag/attribute/scheme allowlist so