Repository navigation
Update ws, mysql2 and minimatch past their new advisories - #248
Merged
Merged
Conversation
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.
What this changes
Moves three production dependencies past advisories published on 1 December, which failed the nightly's Snyk scan and dependency audit on
main:mysql2@shardlens/collectorws@discordjs/ws) and@discordjs/voiceminimatch(underglob)globTwo more lockfile entries change with them:
sql-escaper1.9.1 → 1.10.0.mysql23.25.0 asks for^1.10.0, and it is the only package that uses it.named-placeholdersis removed.mysql23.25.0 no longer uses it, and nothing else does.Every package that brings these in already accepts the new versions, so no
overridespin was needed:@shardlens/collectorasks formysql2^3.24.6.@discordjs/wsand@discordjs/voiceask forws^8.17.0and^8.19.0.globasks forminimatch^11.0.5.The change is
package-lock.jsononly.Why
mainfailed on Snyk (one critical and three high findings) and on the dependency audit (two high), all from these packages.mysql2only runs when the collector uses MySQL storage, and this bot's collector uses MongoDB.wsis only ever a client to Discord, never a server.minimatchonly ever sees file patterns from the bot's own code.How the new versions were checked
Each fix was published within the last three weeks,
mysql2's two days ago, so each was read before it was taken:mysql2,minimatchandsql-escapercarry npm build provenance from their own repositories:sidorares/node-mysql2,isaacs/minimatchatv11.0.9, andmysqljs/sql-escaper.wslists only lpinca as a maintainer now, where it used to list four people. He also published 8.21.1, and its whole diff was read for that reason.mysql2drops one.evalcall.ws: themaxPendingAutoPongslimit (default 60), and Node's ownhttp.websocketMaskwhere Node has it.minimatch: a bounded pattern cache, and caps on brace expansion and**recursion.mysql2andsql-escaper: placeholder expansion moved inside them, plus a statement cache and TLS session handling.sql-escaper1.10.2, published today, changes about ten times as many lines as 1.10.0.sha512, which is what the lockfile records.The lockfile was edited directly rather than with
npm update, because the local npm is older than the one that wrote it and would remove itslibcfields. Parsing and re-serialising the lockfile reproduces it byte for byte, so the edit was made structurally.How to verify
npm ciinstalls the new versions, leaves the lockfile unchanged and no longer installsnamed-placeholders.npm ls --allreports no invalid, missing or extraneous packages.npm run auditpasses.npm run checkpasses with 4,142 tests.npm run buildpasses,dist/has no unrewritten aliases, and the loader smoke test registers everything (53 buttons, 107 aliases, 4 menus), withwsand@shardlens/collector/mongodbloading.wsusing Node's native masking. Local Node 22 lackshttp.websocketMask, so it keeps its JavaScript masking here. The image's Node 24 takes the native path only if that release has it.minimatchadvisory on the root copy (10.2.6, development-only, througheslint-plugin-import-xand Jest's coverage). Its only fix is minimatch 11, which those packages don't accept yet.Checklist
develop, and this pull request targetsdevelopnpm run checkpassessave()on numeric fieldsembed()factoryconsole.*src/config/env.tsandscripts/setupEnv.tsnpm run docs:commandsre-run if a command changedGenerated by Claude Code