Repository navigation
Fix npm audit vulnerabilities - #9
Merged
Merged
Conversation
Apply the non-breaking npm audit fixes, upgrade sqlite3 to 6.0.1 (the only release free of the vulnerable tar/node-gyp chain), and override minimatch under @typescript-eslint/typescript-estree, which pins a vulnerable 9.0.3. sqlite3 6's Linux prebuild needs glibc 2.38+, so the README now says how to build it from source on older distros. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tjcouch-sil
reviewed
Sep 28, 2026
tjcouch-sil
left a comment
Member
There was a problem hiding this comment.
Also worth looking at, though not part of this PR's changes: the workflows don't use a consistent Node version. build-english-db.yml pins node-version: '20', and Node 20 reached end of life in April 2026. test.yml has no setup-node step, so it uses whatever Node version ubuntu-latest happens to have.
Once there's a Volta pin (see the comment on package.json), it would be best to install that version in the workflows the way paranext-core does, so CI and developers use the same Node:
- name: Read package.json
id: package_json
uses: zoexx/github-action-json-file-properties@1.0.6
with:
file_path: 'package.json'
- name: Install Volta and toolchain
uses: volta-cli/action@v4
- name: Install Node and NPM
uses: actions/setup-node@v4
with:
node-version: ${{ fromJson(steps.package_json.outputs.volta).node }}
cache: npm- Scope the minimatch override to typescript-estree v6 so newer v8 releases keep the minimatch ^10 they require. - Pin Node 22.22.1 with Volta (sqlite3 6 needs >= 20.17) and have both workflows install the pinned version instead of Node 20 / runner default. Bump @types/node to match. - Add a postinstall script that rebuilds sqlite3 from source only when the prebuilt binary fails to load for lack of glibc 2.38, so the fix survives reinstalls. Update the README accordingly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Re: the workflow Node versions - done in this PR. Both workflows now read the Volta version from (AI-assisted, with my guidance) |
tjcouch-sil
reviewed
Sep 29, 2026
…e TODO Read the Volta Node version with setup-node's node-version-file instead of two third-party actions, and clone the private repos after npm ci so no third-party or dependency install code runs with the token on disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tjcouch-sil
approved these changes
Sep 29, 2026
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm auditnow reports 0 vulnerabilities. Before this change it reported 30: 1 critical, 21 high, 3 moderate and 5 low.npm audit fixmakes semver-compatible lockfile bumps that clear most of the advisories. They include@xmldom/xmldom,picomatch,serialize-javascript,tar-fs,webpack,lodash,js-yaml,ajvandbrace-expansion.sqlite3goes from ^5.1.6 to ^6.0.1. This is a major version bump. 6.0.1 is the only release without the vulnerablenode-gyp,make-fetch-happen,cacacheandtarchain, which includes the criticaltaradvisories. The JS API we use is unchanged, and it needs Node >= 20.17.build-english-db.yml) or the runner default (test.yml), and@types/nodeis bumped to ^22.overridespinsminimatchto ^9.0.7 under@typescript-eslint/typescript-estree@6only. The v6 parser thateslint-config-erbpulls in pinsminimatch@9.0.3exactly, sonpm audit fixcannot update it. The override keeps lint behavior unchanged. Another fix is to drop the unusedeslint-config-erband move to typescript-eslint v8's parser and plugin, but that turns on new lint rules, so it belongs in a separate PR.sqlite36 Linux prebuild is linked against glibc 2.38. On Ubuntu 22.04, loading it fails withGLIBC_2.38' not found, so apostinstallscript (scripts/ensure-sqlite3.js) rebuilds sqlite3 from source only when the prebuilt binary fails to load for that reason. It exits immediately everywhere else, including CI onubuntu-latest(24.04). The README lists the build tools that older distros need.Verification
All of this was run locally after a clean
npm ci, against the current../marble-lexiconand../marble-indexeswith a pinned--version. The XML and DB comparisons ran on Node 20, before the Volta pin. The other checks were re-run on the pinned Node 22.22.1:npm citriggers the postinstall rebuild, and sqlite3 loads afterwards.npm testpasses (18/18), andnpm run lintandnpx tsc --noEmitare clean.convert-marble-lexiconfor SDBH and SDBG produces XML byte-identical to the output built with the old dependencies.import-lexicon-to-sqlitebuilds a DB with the same schema and the same content in every table. I compared them after resolving surrogate keys to natural keys (6.4M sense occurrences, 684K sense domains, 635K glosses and so on).Promise.all), soEntryKeyandSenseKeyvalues change from run to run even with the same dependencies.🤖 Generated with Claude Code
This change is