Skip to content

Patch web Critical and High npm dependency advisories - #72

Merged
aflanagan merged 3 commits into
masterfrom
agent/web-dependabot-alerts-09d0
Oct 27, 2026
Merged

aflanagan merged 3 commits into
masterfrom
agent/web-dependabot-alerts-09d0

Conversation

@aflanagan

@aflanagan aflanagan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Dependabot alerts for web/package-lock.json were not readable (GitHub API 403). This uses npm audit plus GitHub advisory ranges instead.

npm audit on master was 63 findings (3 Critical, 34 High, 15 Moderate, 11 Low). After this change it is 16 findings (0 Critical, 0 High, 7 Moderate, 9 Low). Draft #64 will move web/ out of this repo; this stays a lockfile-first patch with two targeted overrides and no CRA/React major upgrades or public-behavior changes.

Approach

  1. npm audit fix (no --force) to bump transitive versions inside existing ranges.
  2. overrides only where consumers pin a vulnerable version:
    • underscore: 1.13.8 (jsonpath pins 1.13.6)
    • serialize-javascript: ^7.1.3 (rollup-plugin-terser / css-minimizer-webpack-plugin stay on 4.x / 6.x; API is unchanged, requires Node >=20, already required here)
  3. Existing dependency tests now also guard those two overrides.

Direct app dependencies stay on the same majors (react-scripts@5.0.1, react-router-dom@^6, puppeteer@^25).

Fixed Critical (3)

Package Advisory Resolution
proxy-addr GHSA-jqcg-44mw-7w3h IP spoofing via IPv4-mapped IPv6 trust subnet 2.0.7 → 2.0.8
shell-quote GHSA-w7jw-789q-3m8p quote() does not escape newlines in object .op values 1.8.3 → 1.12.0
websocket-driver GHSA-xv26-6w52-cph6 message corruption via protocol length headers 0.7.4 → 0.7.5

Fixed High (48 advisories across 26 packages)

Lockfile bumps unless noted.

Other in-range lockfile bumps

These stayed inside declared ranges and are not public API changes:

  • puppeteer / puppeteer-core 25.10.0 → 25.16.0, which pulls chromium-bidi 17.0.2 → 157.0.8090-0 and zod 3.25.76 → 4.6.7 (major of a Puppeteer-only transitive; only chromium-bidi uses zod)
  • webpack 5.103 → 5.112, terser-webpack-plugin 5.3.15 → 5.6.1, @babel/core 7.28.5 → 7.29.7
  • Newer caniuse-lite / browserslist data (1.0.30001759 → 1.0.30001819) drops very old browsers from >0.2%, not dead (iOS Safari 11.0–11.2 and 15.6, Chrome 112). Babel no longer emits object-spread helpers (JS ~0.86 kB smaller gzipped) and Autoprefixer drops -webkit-appearance and -webkit-text-decoration-line. No behavior change for current browsers.

Left (no remaining Critical/High)

No Critical or High findings remain in npm audit. Leftover Moderate/Low need a major framework upgrade or an npm audit fix --force downgrade of react-scripts to 0.9.5:

Package Severity Why left
react-router / react-router-dom Moderate Remaining open-redirect / SSR hydration advisories (GHSA-wrjc-x8rr-h8h6, GHSA-337j-9hxr-rhxg) require 7.18.x (major from v6)
uuid (via sockjs / webpack-dev-server) Moderate GHSA-w5hq-g745-h8pq needs uuid 11.x; sockjs pins ^8.3.2. Force-fix wants react-scripts@0.9.5. webpack-dev-server has no remaining advisory of its own; it is flagged only through sockjs → uuid
sockjs / @pmmmwh/react-refresh-webpack-plugin Moderate Still inside CRA 5; remaining issues are Moderate. Latest WDS 6.x is a major
jest 27 / jsdom 16 chain Low Jest 28+ is a major and is pinned by react-scripts@5.0.1
@tootallnate/once / http-proxy-agent Low Pulled in by jsdom 16 via Jest 27

Validation

Local (Node 22.23.4):

  • PUPPETEER_SKIP_DOWNLOAD=true npm ci — 1346 packages, 0 Critical / 0 High
  • npm run test:dependencies — 5 passed, 1 skipped (Puppeteer screenshot, no PUPPETEER_EXECUTABLE_PATH)
  • npm run build — production dashboard compiled successfully

GitHub Actions on 5e535d2 (Linux + Windows) passed: npm ci, dependency tests, web build, go test ./..., and BATS. Run: https://github.com/cronitorio/cronitor-cli/actions/runs/40577463706

Open in Web Open in Cursor 

cursoragent and others added 2 commits October 27, 2026 20:05
Clear remaining Critical/High findings in web/ with lockfile bumps
from npm audit fix, plus underscore and serialize-javascript
overrides where consumers pin vulnerable versions.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
_.flatten is deep by default; assert both deep and shallow results.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Opus 5.5 High review @ 9eebafe: APPROVE

Blocking

None.

What I re-ran (Node 22.23.4, npm 10.9.9, against a master worktree as baseline)

  • PUPPETEER_SKIP_DOWNLOAD=true npm ci: clean. There are 1346 lock entries, npm ls --all exits 0, and npm install --package-lock-only leaves the lockfile byte-identical, so it is in sync with package.json. All 241 changed resolved URLs point at registry.npmjs.org.
  • npm audit: master shows 63 findings (3 Critical / 34 High / 15 Moderate / 11 Low). This PR shows 16 (0 / 0 / 7 / 9). Both match the PR body. The 51 Critical/High GHSAs on master are exactly the 51 listed as fixed in the body, with nothing missing and nothing extra.
  • npm run test:dependencies: 5 pass and 1 skipped. With PUPPETEER_EXECUTABLE_PATH set to a local Chrome, all 6 pass, including the screenshot test.
  • npm run build: compiles successfully.
  • I ran go build with the fresh web/static, then cronitor dash. Unauthenticated / returns 401. Authenticated, /, /jobs and /settings serve the SPA, and the served main.*.js is byte-identical to the built file. In headless Chrome, /, /jobs, /crontabs (including its ?crontab= redirect), /settings and /docs all render, client-side navigation works, and there are no page or console errors. The js-cookie theme toggle sets theme=light with a 365-day expiry and survives a reload.

Overrides

  • serialize-javascript 7.1.4: Its only consumers are css-minimizer-webpack-plugin@3.4.1 (declares ^6) and rollup-plugin-terser@7.0.2 (declares ^4, reached via workbox-build). terser-webpack-plugin@5.6.1 no longer depends on it. The call is still serialize(options), and each worker evals or new Functions the result, so I tested that round trip directly:
    • css-minimizer's worker transform() with the real cssnanoMinify function as the implementation minifies correctly, and </script> inside a string survives.
    • rollup-plugin-terser's transform() with regex and function options works, and a full rollup + terser() run through jest-worker works.
    • The CRA build also uses the css-minimizer worker path whenever there are 2 or more cores (I had 4). The rollup path is dormant here because there is no src/service-worker.js.
    • Its engines says node >=20. This package already requires >=22.12.0 and CI uses 22. Safe.
  • underscore 1.13.8: This is a patch on top of jsonpath@1.3.0's exact 1.13.6 pin, and jsonpath only calls _.uniq, for recursive-descent de-duplication. I checked query, paths, nodes, value, apply and parse (including .. and filter expressions), plus bfj.write, which is all CRA uses from bfj. Safe.

Non-blocking

  1. PR body, force-fix target. npm 10.9.9 reports react-scripts@0.9.5 as the --force target for every leftover finding in the CRA chain (uuid, sockjs, webpack-dev-server, jest, jsdom), not 4.0.3.
  2. PR body, "34 packages". That is npm's count of High-flagged packages including via-chains. The 48 advisories belong to 26 packages directly, which matches the 26 bullets. In the "Left" table, webpack-dev-server has no direct advisory left; it is flagged only through sockjs → uuid.
  3. Transitive bumps not mentioned in the body. All stay inside declared ranges:
    • puppeteer 25.10.0 → 25.16.0. This brings chromium-bidi 17.0.2 → 157.0.8090-0 (pinned exactly by puppeteer-core) and zod 3.25.76 → 4.6.7, a major. That is fine because only chromium-bidi uses zod, and the Puppeteer smoke and screenshot tests pass.
    • webpack 5.103 → 5.112, terser-webpack-plugin 5.3.15 → 5.6.1, @babel/core 7.28.5 → 7.29.7.
  4. Build output differs slightly from master. caniuse-lite 1.0.30001759 → 1.0.30001819 narrows >0.2%, not dead: it drops iOS Safari 11.0–11.2 and 15.6, and Chrome 112. The effects:
    • Babel no longer emits object-spread helpers, so JS is 0.86 kB smaller gzipped.
    • Autoprefixer drops -webkit-appearance and -webkit-text-decoration-line.
    • Nothing changes for current browsers, so "no behavior change" holds for any realistic user of a local dashboard. It just isn't byte-identical output.
  5. Tests are weaker than they could be. The serialize-javascript test only checks /ok/. Evaluating '(' + serialize({ re: /cron/i, fn() { return 1 } }) + ')' would cover the round trip both consumers rely on. The underscore test checks flatten and isEqual, but jsonpath only uses _.uniq, so a _.uniq assertion would target the real consumer. The 9eebafe fix to the flatten expectation is correct. Optional given Extract Crontab Guru Dashboard into its standalone repository #64.
  6. README edit is accurate and appropriately scoped.

No pushes or merges were made as part of this review.

Round-trip serialize-javascript through eval the way CRA workers
do, and exercise _.uniq, the only underscore API jsonpath uses.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Addressed the Opus non-blocking notes on 5e535d2. Linux + Windows CI is green: https://github.com/cronitorio/cronitor-cli/actions/runs/40577463706

  1. PR body, force-fix target. Corrected: leftover CRA-chain findings report react-scripts@0.9.5 as the --force target, not 4.0.3.
  2. PR body, "34 packages". Corrected to 48 High advisories across 26 packages (the 26 bullets). In the Left table, webpack-dev-server is no longer treated as having its own remaining advisory; it is flagged only through sockjs → uuid.
  3. Unmentioned in-range transitive bumps. Added an "Other in-range lockfile bumps" section: puppeteer 25.10.0 → 25.16.0 pulling chromium-bidi 17 → 157 and zod 3 → 4.6.7; webpack 5.103 → 5.112 (plus terser-webpack-plugin 5.3.15 → 5.6.1 and @babel/core 7.28.5 → 7.29.7); newer caniuse-lite / browserslist data drops very old browsers, so the bundle is slightly smaller and a couple of -webkit- prefixes are gone.
  4. serialize-javascript test. Now eval-round-trips serialize({ ok, re: /cron/i, fn() { return 1 } }) and asserts the restored regex and function, matching how css-minimizer / rollup-plugin-terser workers deserialize options.
  5. underscore test. Still checks flatten / isEqual (the patched APIs) and now also _.uniq, the only underscore function jsonpath uses.
  6. README. Left as-is; the review called it accurate and scoped.

No merge.

@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Opus 5.5 High re-review @ 5e535d2: APPROVE

Blocking

None.

Delta 9eebafe..5e535d2

The only code commit is 5e535d2, which changes web/scripts/dependency-security.test.cjs. package.json, package-lock.json and README.md are byte-identical to 9eebafe.

  • serialize-javascript test: it now evals the serialized object back, the same way css-minimizer and rollup-plugin-terser do in their workers. It checks a boolean, a regex (its source and flags) and a method. This addresses the earlier note.
  • underscore test: it adds a _.uniq check, the function jsonpath actually uses. This addresses the earlier note.

PR body

All the earlier corrections landed:

  • The --force target is now react-scripts@0.9.5.
  • The High heading now reads "48 advisories across 26 packages".
  • webpack-dev-server is noted as flagged only through sockjs → uuid.
  • A new "Other in-range lockfile bumps" section covers Puppeteer 25.16 (with chromium-bidi and zod 4), webpack, terser-webpack-plugin, Babel, and the browser-target refresh.
  • The Validation section points at the 5e535d2 CI run, which is green on Linux and Windows.

Re-run at 5e535d2 (Node 22.23.4)

  • PUPPETEER_SKIP_DOWNLOAD=true npm ci: 1346 packages audited.
  • npm audit: 0 Critical, 0 High, 7 Moderate, 9 Low (16 total), unchanged.
  • npm run test:dependencies: 5 pass and 1 skipped. With a local Chrome as PUPPETEER_EXECUTABLE_PATH, all 6 pass.
  • npm run build: compiles successfully. The output hashes (main.4b025454.js, main.5dd73607.css) are identical to my 9eebafe build, so the embedded dashboard I checked last round (Go binary, auth, every route rendered in headless Chrome, theme cookie) is unchanged.

Non-blocking nit

jsonpath calls the iteratee form, _uniq(results, fn). The new assertion uses the plain form. A one-line _.uniq(list, fn) check would match the real call exactly. I confirmed the iteratee form works on 1.13.8, and last round's jsonpath .. queries cover it, so this is optional given #64.

No pushes or merges were made as part of this review.

@aflanagan

Copy link
Copy Markdown
Contributor Author

Opus re-review optional nit (test uses _.uniq(list) while jsonpath calls _.uniq(list, fn)): skipped. Opus confirmed the key-function form works on underscore 1.13.8, and web/ is moving out of this repo via #64, so expanding this test isn't worth it.

@aflanagan
aflanagan merged commit 431cd5a into master Oct 27, 2026
2 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.

2 participants