Skip to content

Commit b9f82b7

Browse files
committed
fix: replace uuid dependency with crypto.randomUUID()
uuid <14.0.0 is flagged by GHSA-w5hq-g745-h8pq (missing buffer bounds check in v3/v5/v6 when buf is provided). The only upstream fix is uuid v14, but v14 dropped CommonJS support, which would break this package. Since only uuid.v4() is used here (in generateUuid()), replace it with Node's built-in crypto.randomUUID() — available since Node 14.17.0, produces the same RFC 4122 v4 UUID format, and requires no external dependency. The engines field is updated accordingly. All 426 existing tests pass.
1 parent b27fbd4 commit b9f82b7

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

lib/pbxProject.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ var util = require('util'),
2121
f = util.format,
2222
EventEmitter = require('events').EventEmitter,
2323
path = require('path'),
24-
uuid = require('uuid'),
2524
fork = require('child_process').fork,
2625
pbxWriter = require('./pbxWriter'),
2726
pbxFile = require('./pbxFile'),
@@ -89,7 +88,7 @@ pbxProject.prototype.allUuids = function() {
8988
}
9089

9190
pbxProject.prototype.generateUuid = function() {
92-
var id = uuid.v4()
91+
var id = require('crypto').randomUUID()
9392
.replace(/-/g, '')
9493
.substr(0, 24)
9594
.toUpperCase()

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
"repository": "github:apache/cordova-node-xcode",
88
"bugs": "https://github.com/apache/cordova-node-xcode/issues",
99
"engines": {
10-
"node": ">=10.0.0"
10+
"node": ">=14.17.0"
1111
},
1212
"dependencies": {
13-
"simple-plist": "^1.1.0",
14-
"uuid": "^7.0.3"
13+
"simple-plist": "^1.1.0"
1514
},
1615
"devDependencies": {
1716
"pegjs": "^0.10.0"

0 commit comments

Comments
 (0)