Repository navigation
chore(deps): patch vulnerable transitive npm dependencies - #1792
Merged
Merged
Conversation
Move transitive packages flagged by Dependabot to patched versions that already satisfy the ranges their parents declare, in pnpm-lock.yaml and tests/e2e/pnpm-lock.yaml. No manifest changes.
This was referenced Sep 14, 2026
Resolve the pnpm-lock.yaml conflict with #1793 (drop the unused node-sass peer) and #1794 (move terser-webpack-plugin to devDependencies). Start from this branch's lockfile and reconcile it to develop's manifest with pnpm 9.15.4 `install --lockfile-only` (prefer-offline off). All 20 patched package versions are kept; the header and importers match develop.
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.
Problem
Dependabot has 109 open alerts on
develop. In 79 of them, a patched release already fits the version range the parent package declares, so no manifest change is needed. The lockfiles simply still pin the vulnerable versions: 51 alerts inpnpm-lock.yamland 28 intests/e2e/pnpm-lock.yaml.Only one of these packages ships in the desktop app:
@xmldom/xmldom@0.8.12. It comes in throughmammoth, which converts.docxfiles for the file viewer and git-diff binary previews. Its parser has quadratic time/memory and regex-backtracking bugs reachable fromDOMParser.parseFromString(GHSA-965w-775f-mr7g, GHSA-8344-3jmq-59r6, GHSA-x4fp-j954-r2f4, GHSA-93r5-fhx6-vmg9). A crafted.docxin a repository or branch can therefore hang the webview when previewed. Its remaining advisories concernXMLSerializer, which mammoth does not use.Everything else is build, lint, unit-test, and WebdriverIO tooling.
Solution
This updates only the flagged packages, each to the newest patched version inside its existing range, using the pinned pnpm 9.15.4.
pnpm-lock.yaml:@xmldom/xmldom(runtime, via mammoth)svgoundicifast-urijs-yamlimmutableflattedpostcss-selector-parserlinkify-it@babel/plugin-transform-modules-systemjsbrace-expansionbrowserslist4.28.9, together with itsbaseline-browser-mapping,electron-to-chromium,node-releases, andupdate-browserslist-dbdata packageslodash-es4.18.1ws8.21.3css-select@6.0.0,css-what@7.0.0, andsax@1.6.1.tests/e2e/pnpm-lock.yaml:undici6.25.0 / 7.25.0 → 6.28.1 / 7.29.1ws8.20.1 → 8.21.3js-yaml4.1.1 → 4.3.2ip-address10.2.0 → 10.7.0esbuild0.28.0 → 0.28.2, plus its platform binariesbrace-expansion1.1.14 / 2.1.0 → 1.1.18 / 2.1.4No
package.jsonchanges, and both lockfiles'importerssections are unchanged.pnpm updatealso re-resolvednan(a build dependency of node-sass) and the e2ereact-isalias, and rewrote some e2e peer suffixes. Those entries were restored to whatdeveloppins, and pnpm accepts the result as consistent.Note for anyone regenerating these files:
.npmrcsetsprefer-offline=true. With a stale local metadata cache,pnpm updatesilently downgraded unrelated packages (for example@codemirror/state6.7.4 → 6.7.1). Run it withnpm_config_prefer_offline=false.The other 30 alerts are out of scope. Each needs a parent upgrade, has no patched release, or is in a Rust lockfile:
node-sasspeer (removed separately in build(deps): stop installing unused node-sass #1793)Potential risks
.docxparsing. xmldom 0.8.15 reports a not-well-formed end tag (for example</w:body junk>) as an error. mammoth turns any parser error into an exception, so such a file now shows the preview error state instead of rendering. Word, LibreOffice, and Google Docs do not write that markup, and well-formed documents convert byte-identically (see Verification).ip-address. 10.7.0 rejects IPv4 octets with leading zeros. In the e2e tree it is reached only throughsocksfor SOCKS-proxied browser downloads; the suite talks to a local tauri-driver.node-sasspeer) and build(deps): declare terser-webpack-plugin as a dev dependency #1794 (moveterser-webpack-pluginto devDependencies) also editpnpm-lock.yaml. build(deps): stop installing unused node-sass #1793 overlaps this diff (for example thebrace-expansionentries), so whichever of the two merges second needs a rebase pluspnpm install --lockfile-only.Verification
Installs.
pnpm install --frozen-lockfilesucceeds at the root and intests/e2e(with--ignore-workspace).pnpm install --lockfile-onlyleaves both lockfiles byte-identical.Alert coverage. Re-evaluated every Dependabot alert's vulnerable range against the new lockfiles:
New advisories. Checked each newly added version (15 root, 34 e2e) against the GitHub Advisory Database: 0 matches.
Production build. Ran
pnpm build(webpack, production, cold cache) in the same worktree before and after:<script>reference inindex.htmlandmobile.html..docxconversion. Compared mammoth output with xmldom 0.8.12 vs 0.8.15 on generated fixtures, and HTML plus conversion messages were identical. The fixtures cover:A malformed end tag now errors, as described above.
Unit tests.
pnpm run test(Vitest 4.1.11): 1899 files passed; 14102 tests passed, 3 expected failures, 1 skipped.Lint. ESLint (
--max-warnings 0, cache written then read back) andprettier --checkon four source files: clean.markdown-it 14.2.0 + linkify-it 5.0.2. Loads; linkify stays off by default and works when enabled.
e2e smoke script. Passes against the updated tree:
ip-addresscallssocksmakes, with results identical to 10.2.0 for valid addresseswdio --versionNot run.
Hooks. Committed from a git worktree. Hooks ran (lint-staged had nothing to do; no TypeScript or Rust was staged), but the
Pre-commit hook ran.trailer is not appended in a worktree.