Patch tar DoS advisories by dropping pinyin's nodejieba (SNYK-JS-TAR-17909068, SNYK-JS-TAR-17909152)#1057
Merged
Merged
Conversation
…17909068, SNYK-JS-TAR-17909152)
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
kevinushey
added a commit
to rstudio/rstudio
that referenced
this pull request
Jul 14, 2026
* raise node heap for panmirror vite build quarto-dev/quarto#1057 bumped pinyin to 4.x, which bundles several MB of dictionary data into panmirror.js (4.8 MB -> 13 MB). Rendering the bundle and its sourcemap now exceeds node's default ~2GB heap on the GitHub macOS runners, so every PR build OOMs in 'Building GWT sources'. Verified locally: the build fails with --max-old-space-size=2048 and succeeds with 4096. * preserve caller-provided NODE_OPTIONS ant's <env> replaces the variable outright, which would drop e.g. proxy or heap settings from the caller's environment. splice the inherited value in after our flag so caller flags take precedence (node applies the last occurrence of a flag).
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.
Bump
pinyinfrom^2.10.2to^4.0.0inpackages/editorand drop the now-redundant@types/pinyindevDependency, closing the two remaining tar advisories from #1052:The third vulnerability in the Snyk PR, the js-yaml merge-key DoS (SNYK-JS-JSYAML-17900054), was already resolved by the lockfile re-resolution in #1056, so editor's
js-yaml: ^4.1.0already resolves to the patched 4.3.0 and no js-yaml change is needed here.Unlike the earlier dependency advisories, the tar fix is only available in tar 7.5.18/7.5.19; there is no patched 6.x release, so a within-major lockfile re-resolution is not possible. The vulnerable tar 6.1.13 is pulled in transitively along a single path:
editor -> pinyin -> nodejieba (optionalDependency) -> @mapbox/node-pre-gyp -> tar. Rather than force tar 7 through node-pre-gyp 1.x (which pinstar ^6.1.11and is not compatible with tar 7's API/engine changes), bumping pinyin to 4.0.0 removes the entire native subtree: pinyin 4 drops thenodejiebaoptional dependency, which eliminatesnodejieba,@mapbox/node-pre-gyp, andtarfrom the lockfile altogether (about 160 fewer lockfile lines and no native install-time build step).This supersedes Snyk PR #1052, which bumped pinyin in
package.jsonbut did not updateyarn.lockand left the stale@types/pinyinbehind.There is no behavior change from this change. The editor uses pinyin at a single call site (
createUniqueCiteIdincite.ts) to romanize an individual Hanzi character into an ASCII citekey. pinyin 4 returns byte-identical romanizations for that call, its CJS build sets__esModuleand its ESM build exports the callable asdefault, so the existingimport pinyin from 'pinyin'default import resolves correctly under both the TypeScript esModuleInterop path and the Vite/Rollup bundle. All working correctly, shown here with a search for the DOI10.1142/9789814285780:The dropped
nodejiebaonly ever affected multi-charactersegmentmode, which this single-character call never used. Verified withtsc --noEmitonpackages/editorand a fullvscode-editorbuild.Closes #1052