Skip to content

fix(lifecycle): properly quote args#9018

Merged
zkochan merged 4 commits intopnpm:mainfrom
yoursunny:v10-lifecycle-quote
Jan 29, 2025
Merged

fix(lifecycle): properly quote args#9018
zkochan merged 4 commits intopnpm:mainfrom
yoursunny:v10-lifecycle-quote

Conversation

@yoursunny
Copy link
Contributor

fixes #8980
fixes #7641

@yoursunny yoursunny requested a review from zkochan as a code owner January 28, 2025 20:18
@yoursunny
Copy link
Contributor Author

Given that v10 has been released, this is a replacement of #8986 that targets v10 branch instead v9 branch.

Currently, the fixes are only applied to non-Windows platform.
Apparently, it is impossible to quote a command line argument that contains newline for Windows cmd.

@socket-security
Copy link

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@pnpm.e2e/pkg-with-1-dep@100.0.0 None 0 0 B
npm/axios@0.15.3 environment, network 0 292 kB nickuraltsev
npm/es6-iterator@2.0.1 Transitive: eval +3 559 kB medikoo
npm/express@2.5.11 🔁 npm/express@4.20.0 None +5 408 kB
npm/express@4.17.1 🔁 npm/express@4.20.0 None +20 890 kB dougwilson
npm/express@4.17.2 🔁 npm/express@4.20.0 Transitive: eval +50 1.69 MB dougwilson
npm/foo@1.0.0 None 0 474 B coolaj86
npm/ms@1.0.0 None 0 6.27 kB leo
npm/pnpm-default-reporter@0.14.7 Transitive: environment, eval +49 6.73 MB zkochan
npm/react-dom@18.2.0 environment +2 4.6 MB gnoff
npm/react@18.2.0 environment +1 322 kB gnoff
npm/rimraf@2.5.1 filesystem +1 65.9 kB isaacs
npm/svgicons2svgfont@5.0.2 Transitive: environment +12 1.42 MB nfroidure
npm/symlink-dir@2.0.2 Transitive: environment, eval, filesystem, network, shell +28 1.28 MB zkochan
npm/typescript@4.8.4 None 0 68.8 MB typescript-bot
npm/typescript@5.4.2 None 0 32.4 MB typescript-bot
npm/webpack@2.7.0 filesystem, unsafe Transitive: environment, eval, network, shell +188 15.2 MB sokra
npm/webpack@5.65.0 environment, filesystem, network, unsafe Transitive: eval, shell +72 15.7 MB sokra
npm/write-pkg@7.0.0 Transitive: environment, filesystem +24 1.88 MB sindresorhus

🚮 Removed packages: npm/@babel/core@7.25.2, npm/@babel/preset-typescript@7.24.7, npm/@babel/types@7.25.6, npm/@changesets/cli@2.27.12, npm/@commitlint/cli@17.8.1, npm/@commitlint/config-conventional@17.8.1, npm/@commitlint/prompt-cli@17.8.1, npm/@eslint/eslintrc@3.1.0, npm/@eslint/js@9.9.1, npm/@gwhitney/detect-indent@7.0.1, npm/@pnpm/builder.policy@3.0.0, npm/@pnpm/byline@1.0.0, npm/@pnpm/colorize-semver-diff@1.0.1, npm/@pnpm/config.env-replace@3.0.0, npm/@pnpm/exec@2.0.0, npm/@pnpm/fs.packlist@2.0.0, npm/@pnpm/hosted-git-info@1.0.0, npm/@pnpm/log.group@3.0.0, npm/@pnpm/logger@5.1.0, npm/@pnpm/meta-updater@2.0.3, npm/@pnpm/network.agent@2.0.0, npm/@pnpm/node-fetch@1.0.0, npm/@pnpm/nopt@0.2.1, npm/@pnpm/npm-conf@3.0.0, npm/@pnpm/npm-lifecycle@1000.0.1, npm/@pnpm/npm-package-arg@1.0.0, npm/@pnpm/os.env.path-extender@2.0.0, npm/@pnpm/patch-package@0.0.0, npm/@pnpm/ramda@0.28.1, npm/@pnpm/registry-mock@3.48.0, npm/@pnpm/semver-diff@1.1.0, npm/@pnpm/tabtab@0.5.4, npm/@pnpm/tgz-fixtures@0.0.0, npm/@pnpm/util.lex-comparator@3.0.0, npm/@pnpm/which@3.0.1, npm/@pnpm/workspace.find-packages@4.0.6, npm/@pnpm/workspace.read-manifest@2.2.0, npm/@reflink/reflink@0.1.18, npm/@rushstack/worker-pool@0.4.9, npm/@types/adm-zip@0.5.5, npm/@types/archy@0.0.33, npm/@types/byline@4.2.36, npm/@types/cross-spawn@6.0.6, npm/@types/fs-extra@9.0.13, npm/@types/graceful-fs@4.1.9, npm/@types/hosted-git-info@3.0.5, npm/@types/ini@1.3.31, npm/@types/is-gzip@2.0.0, npm/@types/is-windows@1.0.2, npm/@types/isexe@2.0.2, npm/@types/jest@29.5.12, npm/@types/js-yaml@4.0.9, npm/@types/lodash.clonedeep@4.5.9, npm/@types/lodash.throttle@4.1.7, npm/@types/micromatch@4.0.7, npm/@types/normalize-path@3.0.2, npm/@types/object-hash@3.0.6, npm/@types/parse-json@4.0.2, npm/@types/proxyquire@1.3.31, npm/@types/retry@0.12.5, npm/@types/rimraf@3.0.2, npm/@types/shell-quote@1.7.5, npm/@types/signal-exit@3.0.4, npm/@types/sinon@10.0.20, npm/@types/ssri@7.1.5, npm/@types/table@6.0.0, npm/@types/tar-stream@2.2.3, npm/@types/tar@6.1.13, npm/@types/touch@3.1.5, npm/@types/uuid@8.3.4, npm/@types/validate-npm-package-name@4.0.2, npm/@types/which@2.0.2, npm/@types/write-file-atomic@4.0.3, npm/@types/yarnpkg__lockfile@1.1.9, npm/@typescript-eslint/eslint-plugin@6.18.1, npm/@typescript-eslint/parser@6.18.1, npm/@yao-pkg/pkg@5.12.0, npm/@yarnpkg/core@4.0.5, npm/@yarnpkg/extensions@2.0.3, npm/@yarnpkg/lockfile@1.1.0, npm/@yarnpkg/nm@4.0.5, npm/@yarnpkg/parsers@3.0.0, npm/@yarnpkg/pnp@4.0.6, npm/@zkochan/cmd-shim@6.0.0, npm/@zkochan/diable@1.0.2, npm/@zkochan/js-yaml@0.0.7, npm/@zkochan/retry@0.2.0, npm/@zkochan/rimraf@3.0.2, npm/@zkochan/table@2.0.1, npm/adm-zip@0.5.14, npm/archy@1.0.0, npm/better-path-resolve@1.0.0, npm/bin-links@4.0.4, npm/bole@5.0.14, npm/boxen@5.1.2, npm/c8@7.14.0, npm/camelcase-keys@6.2.2, npm/can-link@2.0.0, npm/can-write-to-dir@1.1.1, npm/ci-info@3.9.0, npm/cli-columns@4.0.0, npm/cli-truncate@2.1.0, npm/cmd-extension@1.0.2, npm/comver-to-semver@1.0.0, npm/concurrently@8.2.1, npm/cross-env@7.0.3, npm/cross-spawn@7.0.5, npm/cspell@7.3.8, npm/deep-require-cwd@1.0.0, npm/delay@5.0.0, npm/didyoumean2@6.0.1, npm/dint@5.1.0, npm/dir-is-case-sensitive@2.0.0, npm/encode-registry@3.0.1, npm/enquirer@2.4.1, npm/esbuild@0.19.12, npm/escape-string-regexp@4.0.0, npm/eslint-config-standard-with-typescript@39.1.1, npm/eslint-plugin-import@2.30.0, npm/eslint-plugin-n@16.6.2, npm/eslint-plugin-node@11.1.0, npm/eslint-plugin-promise@6.6.0, npm/eslint@8.57.0, npm/exists-link@2.0.0, npm/fast-glob@3.3.2, npm/filenamify@4.3.0, npm/fs-extra@11.2.0, npm/fuse-native@2.2.6, npm/get-npm-tarball-url@2.1.0, npm/get-port@5.1.1, npm/ghooks@2.0.4, npm/graceful-git@4.0.0, npm/graph-cycles@1.2.1, npm/pkg-deb@1.1.2, npm/pkg-rpm@1.0.3

View full report↗︎

@socket-security
Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Critical CVE npm/minimist@0.0.8 ⚠︎
Critical CVE npm/minimist@1.2.0 ⚠︎
Critical CVE npm/loader-utils@0.2.17 ⚠︎
Critical CVE npm/webpack@5.65.0 ⚠︎
Critical CVE npm/thenify@3.3.0 ⚠︎
Protestware or potentially unwanted behavior npm/es5-ext@0.10.24
  • Note: This package prints a protestware console message on install regarding Ukraine for users with Russian language locale
⚠︎

View full report↗︎

Next steps

What is a critical CVE?

Contains a Critical Common Vulnerability and Exposure (CVE).

Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

What is protestware?

This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function.

Consider that consuming this package may come along with functionality unrelated to its primary purpose.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/minimist@0.0.8
  • @SocketSecurity ignore npm/minimist@1.2.0
  • @SocketSecurity ignore npm/loader-utils@0.2.17
  • @SocketSecurity ignore npm/webpack@5.65.0
  • @SocketSecurity ignore npm/thenify@3.3.0
  • @SocketSecurity ignore npm/es5-ext@0.10.24

@zkochan zkochan merged commit c0d1c01 into pnpm:main Jan 29, 2025
9 of 11 checks passed
@welcome
Copy link

welcome bot commented Jan 29, 2025

Congrats on merging your first pull request! 🎉🎉🎉

zkochan pushed a commit that referenced this pull request Jan 29, 2025
* fix(lifecycle): properly quote args

close #8980
close #7641
@zkochan
Copy link
Member

zkochan commented Jun 10, 2025

This change caused an issue: #9381

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.

pnpm run transforms "\n" to "\\n" Multi-line arguments don't get forwarded correctly to scripts

2 participants