Skip to content

Commit 1edf705

Browse files
fix!: replace uuid dependency with crypto.randomUUID() (#153)
* 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 uuid package is removed from dependencies entirely. BREAKING CHANGE: Node >=14.17.0 is now required at runtime (crypto.randomUUID was introduced in that release). The engines field remains >=10.0.0; a separate PR will bump it to reflect the new minimum. All 426 existing tests pass. * chore(npm): update package-lock.json --------- Co-authored-by: Manuel Beck <manuelbeck87@outlook.de>
1 parent 7451fc6 commit 1edf705

3 files changed

Lines changed: 5 additions & 15 deletions

File tree

lib/pbxProject.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const util = require('util');
2121
const f = util.format;
2222
const EventEmitter = require('events').EventEmitter;
2323
const path = require('path');
24-
const uuid = require('uuid');
24+
const crypto = require('crypto');
2525
const fork = require('child_process').fork;
2626
const PBXWriter = require('./pbxWriter');
2727
const PBXFile = require('./pbxFile');
@@ -88,7 +88,7 @@ PBXProject.prototype.allUuids = function () {
8888
};
8989

9090
PBXProject.prototype.generateUuid = function () {
91-
const id = uuid.v4()
91+
const id = crypto.randomUUID()
9292
.replace(/-/g, '')
9393
.substr(0, 24)
9494
.toUpperCase();

package-lock.json

Lines changed: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"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
"@cordova/eslint-config": "^6.0.1",

0 commit comments

Comments
 (0)