Skip to content

Commit 5aa16f8

Browse files
fix: update glob to v10.5.0 to resolve CVE-2025-64756 (#910)
### Summary This PR updates the `glob` package to version `^10.5.0` to resolve the command injection vulnerability [CVE-2025-64756](https://nvd.nist.gov/vuln/detail/CVE-2025-64756). Changes included: - Updated `glob` dependency in `packages/react-native-builder-bob` from `^8.0.3` to `^10.5.0`. - Refactored `src/utils/compile.ts` to use the new `globSync` named export from `glob` v10 API. - Removed `@types/glob` from `devDependencies` as `glob` v10 includes built-in type definitions, and the old types caused conflicts. - Added a `resolution` in the root `package.json` to force `glob@^10.5.0` across the monorepo, ensuring no vulnerable versions remain in the lockfile. ### Test plan 1. **Automated Tests**: Ran `yarn test` in `packages/react-native-builder-bob`. All tests passed. ```bash yarn workspace react-native-builder-bob test ``` 2. **Type Check**: Ran `yarn typecheck` to verify that removing `@types/glob` and using built-in types works correctly. ```bash yarn typecheck ``` 3. **Lint Check**: Ran `yarn lint` to ensure no linting errors. ```bash yarn lint ``` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Updates `glob` to ^10.5.0, refactors to use `globSync`, and removes `@types/glob` now that types are bundled. > > - **Dependencies** > - Bump `glob` in `packages/react-native-builder-bob/package.json` from `^8.0.3` to `^10.5.0`. > - Remove `@types/glob` from `devDependencies` (types included in `glob` v10). > - **Build utils** > - Refactor `packages/react-native-builder-bob/src/utils/compile.ts` to import `{ globSync }` from `glob` and replace `glob.sync` call. > - **Lockfile** > - Update `yarn.lock` to reflect `[email protected]` and updated transitive dependencies. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1f1c339. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Ram <[email protected]>
1 parent 35eab2b commit 5aa16f8

File tree

3 files changed

+27
-51
lines changed

3 files changed

+27
-51
lines changed

packages/react-native-builder-bob/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"del": "^6.1.1",
5555
"escape-string-regexp": "^4.0.0",
5656
"fs-extra": "^10.1.0",
57-
"glob": "^8.0.3",
57+
"glob": "^10.5.0",
5858
"is-git-dirty": "^2.0.1",
5959
"json5": "^2.2.1",
6060
"kleur": "^4.1.4",
@@ -71,7 +71,6 @@
7171
"@types/dedent": "^0.7.0",
7272
"@types/del": "^4.0.0",
7373
"@types/fs-extra": "^9.0.13",
74-
"@types/glob": "^7.2.0",
7574
"@types/json5": "^2.2.0",
7675
"@types/mock-fs": "^4.13.4",
7776
"@types/prompts": "^2.0.14",

packages/react-native-builder-bob/src/utils/compile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'path';
22
import fs from 'fs-extra';
33
import kleur from 'kleur';
44
import * as babel from '@babel/core';
5-
import glob from 'glob';
5+
import { globSync } from 'glob';
66
import type { Input, Variants } from '../types';
77
import { isCodegenSpec } from './isCodegenSpec';
88

@@ -39,7 +39,7 @@ export default async function compile({
3939
jsxRuntime = 'automatic',
4040
variants,
4141
}: Options) {
42-
const files = glob.sync('**/*', {
42+
const files = globSync('**/*', {
4343
cwd: source,
4444
absolute: true,
4545
nodir: true,

yarn.lock

Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,16 +4292,6 @@ __metadata:
42924292
languageName: node
42934293
linkType: hard
42944294

4295-
"@types/glob@npm:^7.2.0":
4296-
version: 7.2.0
4297-
resolution: "@types/glob@npm:7.2.0"
4298-
dependencies:
4299-
"@types/minimatch": "npm:*"
4300-
"@types/node": "npm:*"
4301-
checksum: 10c0/a8eb5d5cb5c48fc58c7ca3ff1e1ddf771ee07ca5043da6e4871e6757b4472e2e73b4cfef2644c38983174a4bc728c73f8da02845c28a1212f98cabd293ecae98
4302-
languageName: node
4303-
linkType: hard
4304-
43054295
"@types/hast@npm:^3.0.0, @types/hast@npm:^3.0.4":
43064296
version: 3.0.4
43074297
resolution: "@types/hast@npm:3.0.4"
@@ -4368,13 +4358,6 @@ __metadata:
43684358
languageName: node
43694359
linkType: hard
43704360

4371-
"@types/minimatch@npm:*":
4372-
version: 5.1.2
4373-
resolution: "@types/minimatch@npm:5.1.2"
4374-
checksum: 10c0/83cf1c11748891b714e129de0585af4c55dd4c2cafb1f1d5233d79246e5e1e19d1b5ad9e8db449667b3ffa2b6c80125c429dbee1054e9efb45758dbc4e118562
4375-
languageName: node
4376-
linkType: hard
4377-
43784361
"@types/minimist@npm:^1.2.0":
43794362
version: 1.2.2
43804363
resolution: "@types/minimist@npm:1.2.2"
@@ -8131,18 +8114,19 @@ __metadata:
81318114
languageName: node
81328115
linkType: hard
81338116

8134-
"glob@npm:^10.2.2":
8135-
version: 10.3.4
8136-
resolution: "glob@npm:10.3.4"
8117+
"glob@npm:^10.2.2, glob@npm:^10.5.0":
8118+
version: 10.5.0
8119+
resolution: "glob@npm:10.5.0"
81378120
dependencies:
81388121
foreground-child: "npm:^3.1.0"
8139-
jackspeak: "npm:^2.0.3"
8140-
minimatch: "npm:^9.0.1"
8141-
minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0"
8142-
path-scurry: "npm:^1.10.1"
8122+
jackspeak: "npm:^3.1.2"
8123+
minimatch: "npm:^9.0.4"
8124+
minipass: "npm:^7.1.2"
8125+
package-json-from-dist: "npm:^1.0.0"
8126+
path-scurry: "npm:^1.11.1"
81438127
bin:
8144-
glob: dist/cjs/src/bin.js
8145-
checksum: 10c0/fe075f8109749cb0c264fd6eee8bf0cc8bb23a02305619b7a88bf1f79766218cc3ef66a3e8f3cd2e826006f047a3a8833c1694f167e978a6e37c34a8c053e48e
8128+
glob: dist/esm/bin.mjs
8129+
checksum: 10c0/100705eddbde6323e7b35e1d1ac28bcb58322095bd8e63a7d0bef1a2cdafe0d0f7922a981b2b48369a4f8c1b077be5c171804534c3509dfe950dde15fbe6d828
81468130
languageName: node
81478131
linkType: hard
81488132

@@ -8160,19 +8144,6 @@ __metadata:
81608144
languageName: node
81618145
linkType: hard
81628146

8163-
"glob@npm:^8.0.3":
8164-
version: 8.1.0
8165-
resolution: "glob@npm:8.1.0"
8166-
dependencies:
8167-
fs.realpath: "npm:^1.0.0"
8168-
inflight: "npm:^1.0.4"
8169-
inherits: "npm:2"
8170-
minimatch: "npm:^5.0.1"
8171-
once: "npm:^1.3.0"
8172-
checksum: 10c0/cb0b5cab17a59c57299376abe5646c7070f8acb89df5595b492dba3bfb43d301a46c01e5695f01154e6553168207cb60d4eaf07d3be4bc3eb9b0457c5c561d0f
8173-
languageName: node
8174-
linkType: hard
8175-
81768147
"global-dirs@npm:^0.1.1":
81778148
version: 0.1.1
81788149
resolution: "global-dirs@npm:0.1.1"
@@ -9234,16 +9205,16 @@ __metadata:
92349205
languageName: node
92359206
linkType: hard
92369207

9237-
"jackspeak@npm:^2.0.3":
9238-
version: 2.3.3
9239-
resolution: "jackspeak@npm:2.3.3"
9208+
"jackspeak@npm:^3.1.2":
9209+
version: 3.4.3
9210+
resolution: "jackspeak@npm:3.4.3"
92409211
dependencies:
92419212
"@isaacs/cliui": "npm:^8.0.2"
92429213
"@pkgjs/parseargs": "npm:^0.11.0"
92439214
dependenciesMeta:
92449215
"@pkgjs/parseargs":
92459216
optional: true
9246-
checksum: 10c0/787b0617dcc534ef793ba685b92347b1b3d634d888b2833a57b140e97eb1f628ec3e460ba1a68fd99bd148004442625db7519be186b38ff51f4951e7c99b52d7
9217+
checksum: 10c0/6acc10d139eaefdbe04d2f679e6191b3abf073f111edf10b1de5302c97ec93fffeb2fdd8681ed17f16268aa9dd4f8c588ed9d1d3bffbbfa6e8bf897cbb3149b9
92479218
languageName: node
92489219
linkType: hard
92499220

@@ -10909,7 +10880,7 @@ __metadata:
1090910880
languageName: node
1091010881
linkType: hard
1091110882

10912-
"minimatch@npm:^9.0.0, minimatch@npm:^9.0.1, minimatch@npm:^9.0.3, minimatch@npm:^9.0.4, minimatch@npm:^9.0.5":
10883+
"minimatch@npm:^9.0.0, minimatch@npm:^9.0.3, minimatch@npm:^9.0.4, minimatch@npm:^9.0.5":
1091310884
version: 9.0.5
1091410885
resolution: "minimatch@npm:9.0.5"
1091510886
dependencies:
@@ -11642,6 +11613,13 @@ __metadata:
1164211613
languageName: node
1164311614
linkType: hard
1164411615

11616+
"package-json-from-dist@npm:^1.0.0":
11617+
version: 1.0.1
11618+
resolution: "package-json-from-dist@npm:1.0.1"
11619+
checksum: 10c0/62ba2785eb655fec084a257af34dbe24292ab74516d6aecef97ef72d4897310bc6898f6c85b5cd22770eaa1ce60d55a0230e150fb6a966e3ecd6c511e23d164b
11620+
languageName: node
11621+
linkType: hard
11622+
1164511623
"pacote@npm:^21.0.0":
1164611624
version: 21.0.0
1164711625
resolution: "pacote@npm:21.0.0"
@@ -11825,7 +11803,7 @@ __metadata:
1182511803
languageName: node
1182611804
linkType: hard
1182711805

11828-
"path-scurry@npm:^1.10.1":
11806+
"path-scurry@npm:^1.11.1":
1182911807
version: 1.11.1
1183011808
resolution: "path-scurry@npm:1.11.1"
1183111809
dependencies:
@@ -12214,7 +12192,6 @@ __metadata:
1221412192
"@types/dedent": "npm:^0.7.0"
1221512193
"@types/del": "npm:^4.0.0"
1221612194
"@types/fs-extra": "npm:^9.0.13"
12217-
"@types/glob": "npm:^7.2.0"
1221812195
"@types/json5": "npm:^2.2.0"
1221912196
"@types/mock-fs": "npm:^4.13.4"
1222012197
"@types/prompts": "npm:^2.0.14"
@@ -12229,7 +12206,7 @@ __metadata:
1222912206
del: "npm:^6.1.1"
1223012207
escape-string-regexp: "npm:^4.0.0"
1223112208
fs-extra: "npm:^10.1.0"
12232-
glob: "npm:^8.0.3"
12209+
glob: "npm:^10.5.0"
1223312210
is-git-dirty: "npm:^2.0.1"
1223412211
json5: "npm:^2.2.1"
1223512212
kleur: "npm:^4.1.4"

0 commit comments

Comments
 (0)