@openrewrite/recipes-nodejs 0.36.0-20251211-172625 → 0.36.0-20251212-170419
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/advisories-npm.csv +5357 -0
- package/dist/security/dependency-vulnerability-check.d.ts +63 -0
- package/dist/security/dependency-vulnerability-check.d.ts.map +1 -0
- package/dist/security/dependency-vulnerability-check.js +639 -0
- package/dist/security/dependency-vulnerability-check.js.map +1 -0
- package/dist/security/index.d.ts +3 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +19 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/vulnerability.d.ts +33 -0
- package/dist/security/vulnerability.d.ts.map +1 -0
- package/dist/security/vulnerability.js +182 -0
- package/dist/security/vulnerability.js.map +1 -0
- package/package.json +6 -3
- package/src/index.ts +2 -0
- package/src/security/dependency-vulnerability-check.ts +934 -0
- package/src/security/index.ts +8 -0
- package/src/security/vulnerability.ts +265 -0
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.DependencyVulnerabilityCheck = void 0;
|
|
52
|
+
const rewrite_1 = require("@openrewrite/rewrite");
|
|
53
|
+
const json_1 = require("@openrewrite/rewrite/json");
|
|
54
|
+
const rewrite_2 = require("@openrewrite/rewrite");
|
|
55
|
+
const text_1 = require("@openrewrite/rewrite/text");
|
|
56
|
+
const yaml_1 = require("@openrewrite/rewrite/yaml");
|
|
57
|
+
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
58
|
+
const semver = __importStar(require("semver"));
|
|
59
|
+
const path = __importStar(require("path"));
|
|
60
|
+
const vulnerability_1 = require("./vulnerability");
|
|
61
|
+
class VulnerabilityReportRow {
|
|
62
|
+
constructor(sourcePath, cve, packageName, version, fixedVersion, lastAffectedVersion, upgradeable, summary, severity, depth, cwes, isDirect, dependencyPath) {
|
|
63
|
+
this.sourcePath = sourcePath;
|
|
64
|
+
this.cve = cve;
|
|
65
|
+
this.packageName = packageName;
|
|
66
|
+
this.version = version;
|
|
67
|
+
this.fixedVersion = fixedVersion;
|
|
68
|
+
this.lastAffectedVersion = lastAffectedVersion;
|
|
69
|
+
this.upgradeable = upgradeable;
|
|
70
|
+
this.summary = summary;
|
|
71
|
+
this.severity = severity;
|
|
72
|
+
this.depth = depth;
|
|
73
|
+
this.cwes = cwes;
|
|
74
|
+
this.isDirect = isDirect;
|
|
75
|
+
this.dependencyPath = dependencyPath;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, rewrite_1.Column)({
|
|
80
|
+
displayName: "Source Path",
|
|
81
|
+
description: "Path to the package.json file where the vulnerability was found"
|
|
82
|
+
})
|
|
83
|
+
], VulnerabilityReportRow.prototype, "sourcePath", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, rewrite_1.Column)({
|
|
86
|
+
displayName: "CVE",
|
|
87
|
+
description: "The CVE identifier of the vulnerability"
|
|
88
|
+
})
|
|
89
|
+
], VulnerabilityReportRow.prototype, "cve", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, rewrite_1.Column)({
|
|
92
|
+
displayName: "Package",
|
|
93
|
+
description: "The name of the vulnerable package"
|
|
94
|
+
})
|
|
95
|
+
], VulnerabilityReportRow.prototype, "packageName", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, rewrite_1.Column)({
|
|
98
|
+
displayName: "Version",
|
|
99
|
+
description: "The resolved version of the package"
|
|
100
|
+
})
|
|
101
|
+
], VulnerabilityReportRow.prototype, "version", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, rewrite_1.Column)({
|
|
104
|
+
displayName: "Fixed Version",
|
|
105
|
+
description: "The version that fixes the vulnerability"
|
|
106
|
+
})
|
|
107
|
+
], VulnerabilityReportRow.prototype, "fixedVersion", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, rewrite_1.Column)({
|
|
110
|
+
displayName: "Last Affected",
|
|
111
|
+
description: "The last version affected by the vulnerability"
|
|
112
|
+
})
|
|
113
|
+
], VulnerabilityReportRow.prototype, "lastAffectedVersion", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, rewrite_1.Column)({
|
|
116
|
+
displayName: "Upgradeable",
|
|
117
|
+
description: "Whether the vulnerability can be fixed with a version upgrade within the maximum delta"
|
|
118
|
+
})
|
|
119
|
+
], VulnerabilityReportRow.prototype, "upgradeable", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, rewrite_1.Column)({
|
|
122
|
+
displayName: "Summary",
|
|
123
|
+
description: "Brief description of the vulnerability"
|
|
124
|
+
})
|
|
125
|
+
], VulnerabilityReportRow.prototype, "summary", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, rewrite_1.Column)({
|
|
128
|
+
displayName: "Severity",
|
|
129
|
+
description: "Severity level of the vulnerability"
|
|
130
|
+
})
|
|
131
|
+
], VulnerabilityReportRow.prototype, "severity", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, rewrite_1.Column)({
|
|
134
|
+
displayName: "Depth",
|
|
135
|
+
description: "Depth in the dependency tree (0 = direct, 1+ = transitive)"
|
|
136
|
+
})
|
|
137
|
+
], VulnerabilityReportRow.prototype, "depth", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, rewrite_1.Column)({
|
|
140
|
+
displayName: "CWEs",
|
|
141
|
+
description: "CWE identifiers associated with this vulnerability"
|
|
142
|
+
})
|
|
143
|
+
], VulnerabilityReportRow.prototype, "cwes", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, rewrite_1.Column)({
|
|
146
|
+
displayName: "Is Direct",
|
|
147
|
+
description: "Whether this is a direct dependency"
|
|
148
|
+
})
|
|
149
|
+
], VulnerabilityReportRow.prototype, "isDirect", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, rewrite_1.Column)({
|
|
152
|
+
displayName: "Dependency Path",
|
|
153
|
+
description: "Path showing how the vulnerable dependency is brought in (e.g., 'dependencies > lodash@4.0.0 > vulnerable-pkg@1.0.0')"
|
|
154
|
+
})
|
|
155
|
+
], VulnerabilityReportRow.prototype, "dependencyPath", void 0);
|
|
156
|
+
class DependencyVulnerabilityCheck extends rewrite_1.ScanningRecipe {
|
|
157
|
+
constructor() {
|
|
158
|
+
super(...arguments);
|
|
159
|
+
this.name = "org.openrewrite.node.dependency-vulnerability-check";
|
|
160
|
+
this.displayName = "Find and fix vulnerable npm dependencies";
|
|
161
|
+
this.description = "This software composition analysis (SCA) tool detects and upgrades dependencies with publicly " +
|
|
162
|
+
"disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and " +
|
|
163
|
+
"upgrades to newer versions with fixes. This recipe by default only upgrades to the latest **patch** version. " +
|
|
164
|
+
"If a minor or major upgrade is required to reach the fixed version, this can be controlled using the `maximumUpgradeDelta` option. " +
|
|
165
|
+
"Vulnerability information comes from the GitHub Security Advisory Database.";
|
|
166
|
+
this.vulnerabilityReport = new rewrite_1.DataTable("org.openrewrite.nodejs.table.VulnerabilityReport", "Vulnerability Report", "Lists all vulnerabilities found in project dependencies.", VulnerabilityReportRow);
|
|
167
|
+
}
|
|
168
|
+
initialValue(_ctx) {
|
|
169
|
+
return Object.assign(Object.assign({}, (0, javascript_1.createDependencyRecipeAccumulator)()), { db: vulnerability_1.VulnerabilityDatabase.load(), vulnerableByProject: new Map(), fixesByProject: new Map() });
|
|
170
|
+
}
|
|
171
|
+
getMinimumSeverity() {
|
|
172
|
+
return this.minimumSeverity ? (0, vulnerability_1.parseSeverity)(this.minimumSeverity) : vulnerability_1.Severity.LOW;
|
|
173
|
+
}
|
|
174
|
+
getMaximumUpgradeDelta() {
|
|
175
|
+
return this.maximumUpgradeDelta || 'patch';
|
|
176
|
+
}
|
|
177
|
+
isReportOnly() {
|
|
178
|
+
return this.getMaximumUpgradeDelta() === 'none';
|
|
179
|
+
}
|
|
180
|
+
matchesCvePattern(vulnerability) {
|
|
181
|
+
if (!this.cvePattern) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
const regex = new RegExp(this.cvePattern);
|
|
186
|
+
return regex.test(vulnerability.cve);
|
|
187
|
+
}
|
|
188
|
+
catch (_a) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
isVersionAffected(version, vulnerability) {
|
|
193
|
+
try {
|
|
194
|
+
const v = semver.parse(version);
|
|
195
|
+
if (!v)
|
|
196
|
+
return false;
|
|
197
|
+
if (vulnerability.introducedVersion && vulnerability.introducedVersion !== '0') {
|
|
198
|
+
const introduced = semver.parse(vulnerability.introducedVersion);
|
|
199
|
+
if (introduced && semver.lt(v, introduced)) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (vulnerability.fixedVersion) {
|
|
204
|
+
const fixed = semver.parse(vulnerability.fixedVersion);
|
|
205
|
+
if (fixed && semver.gte(v, fixed)) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
if (vulnerability.lastAffectedVersion) {
|
|
211
|
+
const lastAffected = semver.parse(vulnerability.lastAffectedVersion);
|
|
212
|
+
if (lastAffected && semver.gt(v, lastAffected)) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
catch (_a) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
isUpgradeableWithinDelta(currentVersion, vulnerability) {
|
|
224
|
+
if (this.isReportOnly()) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
const current = semver.parse(currentVersion);
|
|
229
|
+
if (!current)
|
|
230
|
+
return false;
|
|
231
|
+
const delta = this.getMaximumUpgradeDelta();
|
|
232
|
+
if (vulnerability.fixedVersion) {
|
|
233
|
+
const fixed = semver.parse(vulnerability.fixedVersion);
|
|
234
|
+
if (!fixed)
|
|
235
|
+
return false;
|
|
236
|
+
switch (delta) {
|
|
237
|
+
case 'patch':
|
|
238
|
+
return current.major === fixed.major && current.minor === fixed.minor;
|
|
239
|
+
case 'minor':
|
|
240
|
+
return current.major === fixed.major;
|
|
241
|
+
case 'major':
|
|
242
|
+
return true;
|
|
243
|
+
case 'none':
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (vulnerability.lastAffectedVersion) {
|
|
248
|
+
const lastAffected = semver.parse(vulnerability.lastAffectedVersion);
|
|
249
|
+
if (!lastAffected)
|
|
250
|
+
return false;
|
|
251
|
+
switch (delta) {
|
|
252
|
+
case 'patch':
|
|
253
|
+
return current.major === lastAffected.major &&
|
|
254
|
+
current.minor === lastAffected.minor;
|
|
255
|
+
case 'minor':
|
|
256
|
+
return current.major === lastAffected.major;
|
|
257
|
+
case 'major':
|
|
258
|
+
return true;
|
|
259
|
+
case 'none':
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
catch (_a) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
getUpgradeVersion(vulnerability) {
|
|
270
|
+
if (vulnerability.fixedVersion) {
|
|
271
|
+
return vulnerability.fixedVersion;
|
|
272
|
+
}
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
275
|
+
renderPath(scope, path) {
|
|
276
|
+
const parts = [];
|
|
277
|
+
if (scope) {
|
|
278
|
+
parts.push(scope);
|
|
279
|
+
}
|
|
280
|
+
for (const seg of path) {
|
|
281
|
+
parts.push(`${seg.name}@${seg.version}`);
|
|
282
|
+
}
|
|
283
|
+
return parts.join(' > ');
|
|
284
|
+
}
|
|
285
|
+
findVulnerabilities(resolved, db, depth, isDirect, scope, path, visited, results) {
|
|
286
|
+
const key = `${resolved.name}@${resolved.version}`;
|
|
287
|
+
if (visited.has(key))
|
|
288
|
+
return;
|
|
289
|
+
visited.add(key);
|
|
290
|
+
const currentPath = [...path, { name: resolved.name, version: resolved.version }];
|
|
291
|
+
const vulns = db.getVulnerabilities(resolved.name);
|
|
292
|
+
for (const vuln of vulns) {
|
|
293
|
+
if ((0, vulnerability_1.severityOrdinal)(vuln.severity) < (0, vulnerability_1.severityOrdinal)(this.getMinimumSeverity())) {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
if (!this.matchesCvePattern(vuln)) {
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (this.isVersionAffected(resolved.version, vuln)) {
|
|
300
|
+
results.push({
|
|
301
|
+
resolved,
|
|
302
|
+
vulnerability: vuln,
|
|
303
|
+
depth,
|
|
304
|
+
isDirect,
|
|
305
|
+
scope,
|
|
306
|
+
path: currentPath
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (this.overrideTransitive) {
|
|
311
|
+
const transitives = [
|
|
312
|
+
...(resolved.dependencies || []),
|
|
313
|
+
...(resolved.devDependencies || []),
|
|
314
|
+
...(resolved.peerDependencies || []),
|
|
315
|
+
...(resolved.optionalDependencies || [])
|
|
316
|
+
];
|
|
317
|
+
for (const dep of transitives) {
|
|
318
|
+
if (dep.resolved) {
|
|
319
|
+
this.findVulnerabilities(dep.resolved, db, depth + 1, false, scope, currentPath, visited, results);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
computeFixes(vulnerabilities) {
|
|
325
|
+
if (this.isReportOnly()) {
|
|
326
|
+
return [];
|
|
327
|
+
}
|
|
328
|
+
const byPackage = new Map();
|
|
329
|
+
for (const vuln of vulnerabilities) {
|
|
330
|
+
const existing = byPackage.get(vuln.resolved.name) || [];
|
|
331
|
+
existing.push(vuln);
|
|
332
|
+
byPackage.set(vuln.resolved.name, existing);
|
|
333
|
+
}
|
|
334
|
+
const fixes = [];
|
|
335
|
+
for (const [packageName, vulns] of byPackage) {
|
|
336
|
+
let highestFixVersion;
|
|
337
|
+
const cves = [];
|
|
338
|
+
let isTransitive = true;
|
|
339
|
+
let scope;
|
|
340
|
+
for (const vuln of vulns) {
|
|
341
|
+
if (!this.isUpgradeableWithinDelta(vuln.resolved.version, vuln.vulnerability)) {
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
const fixVersion = this.getUpgradeVersion(vuln.vulnerability);
|
|
345
|
+
if (fixVersion) {
|
|
346
|
+
if (!highestFixVersion || semver.gt(fixVersion, highestFixVersion)) {
|
|
347
|
+
highestFixVersion = fixVersion;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
cves.push(vuln.vulnerability.cve);
|
|
351
|
+
if (vuln.isDirect) {
|
|
352
|
+
isTransitive = false;
|
|
353
|
+
scope = vuln.scope;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (highestFixVersion && cves.length > 0) {
|
|
357
|
+
fixes.push({
|
|
358
|
+
packageName,
|
|
359
|
+
newVersion: highestFixVersion,
|
|
360
|
+
isTransitive,
|
|
361
|
+
cves,
|
|
362
|
+
scope
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return fixes;
|
|
367
|
+
}
|
|
368
|
+
scanner(acc) {
|
|
369
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
370
|
+
const recipe = this;
|
|
371
|
+
return new class extends json_1.JsonVisitor {
|
|
372
|
+
visitDocument(doc, _ctx) {
|
|
373
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
+
var _a;
|
|
375
|
+
if (!doc.sourcePath.endsWith('package.json')) {
|
|
376
|
+
return doc;
|
|
377
|
+
}
|
|
378
|
+
const marker = (0, javascript_1.findNodeResolutionResult)(doc);
|
|
379
|
+
if (!marker) {
|
|
380
|
+
return doc;
|
|
381
|
+
}
|
|
382
|
+
const vulnerabilities = [];
|
|
383
|
+
const visited = new Set();
|
|
384
|
+
const scopesToCheck = recipe.scope
|
|
385
|
+
? [recipe.scope]
|
|
386
|
+
: ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
|
|
387
|
+
for (const scope of scopesToCheck) {
|
|
388
|
+
const deps = marker[scope] || [];
|
|
389
|
+
for (const dep of deps) {
|
|
390
|
+
if (dep.resolved) {
|
|
391
|
+
recipe.findVulnerabilities(dep.resolved, acc.db, 0, true, scope, [], visited, vulnerabilities);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (vulnerabilities.length > 0) {
|
|
396
|
+
acc.vulnerableByProject.set(doc.sourcePath, vulnerabilities);
|
|
397
|
+
const fixes = recipe.computeFixes(vulnerabilities);
|
|
398
|
+
if (fixes.length > 0) {
|
|
399
|
+
acc.fixesByProject.set(doc.sourcePath, fixes);
|
|
400
|
+
const projectDir = path.dirname(path.resolve(doc.sourcePath));
|
|
401
|
+
const pm = (_a = marker.packageManager) !== null && _a !== void 0 ? _a : "Npm";
|
|
402
|
+
acc.projectsToUpdate.set(doc.sourcePath, {
|
|
403
|
+
projectDir,
|
|
404
|
+
packageJsonPath: doc.sourcePath,
|
|
405
|
+
originalPackageJson: yield this.printDocument(doc),
|
|
406
|
+
packageManager: pm
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return doc;
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
printDocument(doc) {
|
|
414
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
415
|
+
return rewrite_2.TreePrinters.print(doc);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
getRecipeList() {
|
|
422
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
423
|
+
return [];
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
editorWithData(acc) {
|
|
427
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
428
|
+
const recipe = this;
|
|
429
|
+
const YAML_LOCK_FILES = ['pnpm-lock.yaml', 'yarn.lock'];
|
|
430
|
+
return new class extends rewrite_1.TreeVisitor {
|
|
431
|
+
accept(tree, ctx) {
|
|
432
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
433
|
+
if ((0, json_1.isJson)(tree) && tree.kind === json_1.Json.Kind.Document) {
|
|
434
|
+
return this.handleJsonDocument(tree, ctx);
|
|
435
|
+
}
|
|
436
|
+
if ((0, yaml_1.isYaml)(tree) && (0, yaml_1.isDocuments)(tree)) {
|
|
437
|
+
const basename = path.basename(tree.sourcePath);
|
|
438
|
+
if (YAML_LOCK_FILES.includes(basename)) {
|
|
439
|
+
return this.handleYamlLockFile(tree, ctx);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if ((0, text_1.isPlainText)(tree)) {
|
|
443
|
+
const basename = path.basename(tree.sourcePath);
|
|
444
|
+
if (basename === 'yarn.lock') {
|
|
445
|
+
return this.handlePlainTextLockFile(tree, ctx);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return tree;
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
handleJsonDocument(doc, ctx) {
|
|
452
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
453
|
+
const sourcePath = doc.sourcePath;
|
|
454
|
+
if (sourcePath.endsWith('package.json')) {
|
|
455
|
+
return this.handlePackageJson(doc, ctx);
|
|
456
|
+
}
|
|
457
|
+
const updatedLockContent = (0, javascript_1.getUpdatedLockFileContent)(sourcePath, acc);
|
|
458
|
+
if (updatedLockContent) {
|
|
459
|
+
return yield new json_1.JsonParser({}).parseOne({
|
|
460
|
+
text: updatedLockContent,
|
|
461
|
+
sourcePath: doc.sourcePath
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
return doc;
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
handleYamlLockFile(docs, _ctx) {
|
|
468
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
469
|
+
const sourcePath = docs.sourcePath;
|
|
470
|
+
const updatedLockContent = (0, javascript_1.getUpdatedLockFileContent)(sourcePath, acc);
|
|
471
|
+
if (updatedLockContent) {
|
|
472
|
+
return yield new yaml_1.YamlParser({}).parseOne({
|
|
473
|
+
text: updatedLockContent,
|
|
474
|
+
sourcePath: docs.sourcePath
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
return docs;
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
handlePlainTextLockFile(text, _ctx) {
|
|
481
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
482
|
+
const sourcePath = text.sourcePath;
|
|
483
|
+
const updatedLockContent = (0, javascript_1.getUpdatedLockFileContent)(sourcePath, acc);
|
|
484
|
+
if (updatedLockContent) {
|
|
485
|
+
const parsed = yield new text_1.PlainTextParser({}).parseOne({
|
|
486
|
+
text: updatedLockContent,
|
|
487
|
+
sourcePath: text.sourcePath
|
|
488
|
+
});
|
|
489
|
+
return parsed;
|
|
490
|
+
}
|
|
491
|
+
return text;
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
handlePackageJson(doc, ctx) {
|
|
495
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
496
|
+
const vulnerabilities = acc.vulnerableByProject.get(doc.sourcePath);
|
|
497
|
+
if (!vulnerabilities || vulnerabilities.length === 0) {
|
|
498
|
+
return doc;
|
|
499
|
+
}
|
|
500
|
+
for (const vuln of vulnerabilities) {
|
|
501
|
+
const upgradeable = recipe.isUpgradeableWithinDelta(vuln.resolved.version, vuln.vulnerability);
|
|
502
|
+
recipe.vulnerabilityReport.insertRow(ctx, new VulnerabilityReportRow(doc.sourcePath, vuln.vulnerability.cve, vuln.resolved.name, vuln.resolved.version, vuln.vulnerability.fixedVersion || '', vuln.vulnerability.lastAffectedVersion || '', upgradeable, vuln.vulnerability.summary, vuln.vulnerability.severity, vuln.depth, vuln.vulnerability.cwes, vuln.isDirect, recipe.renderPath(vuln.scope, vuln.path)));
|
|
503
|
+
}
|
|
504
|
+
if (recipe.isReportOnly()) {
|
|
505
|
+
return doc;
|
|
506
|
+
}
|
|
507
|
+
const fixes = acc.fixesByProject.get(doc.sourcePath);
|
|
508
|
+
const updateInfo = acc.projectsToUpdate.get(doc.sourcePath);
|
|
509
|
+
if (!fixes || fixes.length === 0 || !updateInfo) {
|
|
510
|
+
return doc;
|
|
511
|
+
}
|
|
512
|
+
const failureMessage = yield (0, javascript_1.runInstallIfNeeded)(doc.sourcePath, acc, () => recipe.runPackageManagerInstall(acc, updateInfo, fixes));
|
|
513
|
+
if (failureMessage) {
|
|
514
|
+
return (0, rewrite_1.markupWarn)(doc, `Failed to fix vulnerabilities in ${doc.sourcePath}`, failureMessage);
|
|
515
|
+
}
|
|
516
|
+
let result = doc;
|
|
517
|
+
for (const fix of fixes) {
|
|
518
|
+
if (!fix.isTransitive && fix.scope) {
|
|
519
|
+
const visitor = new UpdateVersionVisitor(fix.packageName, fix.newVersion, fix.scope);
|
|
520
|
+
result = (yield visitor.visit(result, undefined));
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return (0, javascript_1.updateNodeResolutionMarker)(result, updateInfo, acc);
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
runPackageManagerInstall(acc, updateInfo, fixes) {
|
|
530
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
531
|
+
const modifiedPackageJson = this.createModifiedPackageJson(updateInfo.originalPackageJson, fixes);
|
|
532
|
+
const result = yield (0, javascript_1.runInstallInTempDir)(updateInfo.projectDir, updateInfo.packageManager, modifiedPackageJson);
|
|
533
|
+
(0, javascript_1.storeInstallResult)(result, acc, updateInfo, modifiedPackageJson);
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
createModifiedPackageJson(originalContent, fixes) {
|
|
537
|
+
const packageJson = JSON.parse(originalContent);
|
|
538
|
+
for (const fix of fixes) {
|
|
539
|
+
if (!fix.isTransitive && fix.scope) {
|
|
540
|
+
if (packageJson[fix.scope] && packageJson[fix.scope][fix.packageName]) {
|
|
541
|
+
packageJson[fix.scope][fix.packageName] = fix.newVersion;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return JSON.stringify(packageJson, null, 2);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
exports.DependencyVulnerabilityCheck = DependencyVulnerabilityCheck;
|
|
549
|
+
__decorate([
|
|
550
|
+
(0, rewrite_1.Option)({
|
|
551
|
+
displayName: "Scope",
|
|
552
|
+
description: "Match dependencies with the specified scope. Default includes all scopes. " +
|
|
553
|
+
"Use 'dependencies' for production dependencies, 'devDependencies' for development only, etc.",
|
|
554
|
+
required: false,
|
|
555
|
+
example: "dependencies",
|
|
556
|
+
valid: ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]
|
|
557
|
+
})
|
|
558
|
+
], DependencyVulnerabilityCheck.prototype, "scope", void 0);
|
|
559
|
+
__decorate([
|
|
560
|
+
(0, rewrite_1.Option)({
|
|
561
|
+
displayName: "Override transitives",
|
|
562
|
+
description: "When enabled, transitive dependencies with vulnerabilities will have their versions overridden " +
|
|
563
|
+
"using npm overrides, yarn resolutions, or pnpm overrides. " +
|
|
564
|
+
"By default only direct dependencies have their version numbers upgraded.",
|
|
565
|
+
required: false,
|
|
566
|
+
example: "true"
|
|
567
|
+
})
|
|
568
|
+
], DependencyVulnerabilityCheck.prototype, "overrideTransitive", void 0);
|
|
569
|
+
__decorate([
|
|
570
|
+
(0, rewrite_1.Option)({
|
|
571
|
+
displayName: "Maximum upgrade delta",
|
|
572
|
+
description: "The maximum difference to allow when upgrading a dependency version. " +
|
|
573
|
+
"Use 'none' to only report vulnerabilities without making any changes. " +
|
|
574
|
+
"Patch version upgrades are the default and safest option. " +
|
|
575
|
+
"Minor version upgrades can introduce new features but typically no breaking changes. " +
|
|
576
|
+
"Major version upgrades may require code changes.",
|
|
577
|
+
required: false,
|
|
578
|
+
example: "patch",
|
|
579
|
+
valid: ["none", "patch", "minor", "major"]
|
|
580
|
+
})
|
|
581
|
+
], DependencyVulnerabilityCheck.prototype, "maximumUpgradeDelta", void 0);
|
|
582
|
+
__decorate([
|
|
583
|
+
(0, rewrite_1.Option)({
|
|
584
|
+
displayName: "Minimum severity",
|
|
585
|
+
description: "Only fix vulnerabilities with a severity level equal to or higher than the specified minimum. " +
|
|
586
|
+
"Vulnerabilities are classified as LOW, MODERATE, HIGH, or CRITICAL based on their potential impact. " +
|
|
587
|
+
"Default is LOW, which includes all severity levels.",
|
|
588
|
+
required: false,
|
|
589
|
+
example: "MODERATE",
|
|
590
|
+
valid: ["LOW", "MODERATE", "HIGH", "CRITICAL"]
|
|
591
|
+
})
|
|
592
|
+
], DependencyVulnerabilityCheck.prototype, "minimumSeverity", void 0);
|
|
593
|
+
__decorate([
|
|
594
|
+
(0, rewrite_1.Option)({
|
|
595
|
+
displayName: "CVE pattern",
|
|
596
|
+
description: "Only fix vulnerabilities matching this regular expression pattern. " +
|
|
597
|
+
"This allows filtering to specific CVEs or CVE ranges. " +
|
|
598
|
+
"For example, 'CVE-2023-.*' will only check for CVEs from 2023. " +
|
|
599
|
+
"If not specified, all CVEs will be checked.",
|
|
600
|
+
required: false,
|
|
601
|
+
example: "CVE-2023-.*"
|
|
602
|
+
})
|
|
603
|
+
], DependencyVulnerabilityCheck.prototype, "cvePattern", void 0);
|
|
604
|
+
class UpdateVersionVisitor extends json_1.JsonVisitor {
|
|
605
|
+
constructor(packageName, newVersion, targetScope) {
|
|
606
|
+
super();
|
|
607
|
+
this.inTargetScope = false;
|
|
608
|
+
this.packageName = packageName;
|
|
609
|
+
this.newVersion = newVersion;
|
|
610
|
+
this.targetScope = targetScope;
|
|
611
|
+
}
|
|
612
|
+
visitMember(member, p) {
|
|
613
|
+
const _super = Object.create(null, {
|
|
614
|
+
visitMember: { get: () => super.visitMember }
|
|
615
|
+
});
|
|
616
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
617
|
+
const keyName = (0, json_1.getMemberKeyName)(member);
|
|
618
|
+
if (keyName === this.targetScope) {
|
|
619
|
+
this.inTargetScope = true;
|
|
620
|
+
const result = yield _super.visitMember.call(this, member, p);
|
|
621
|
+
this.inTargetScope = false;
|
|
622
|
+
return result;
|
|
623
|
+
}
|
|
624
|
+
if (this.inTargetScope && keyName === this.packageName) {
|
|
625
|
+
return this.updateVersion(member);
|
|
626
|
+
}
|
|
627
|
+
return _super.visitMember.call(this, member, p);
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
updateVersion(member) {
|
|
631
|
+
const value = member.value;
|
|
632
|
+
if (!(0, json_1.isLiteral)(value)) {
|
|
633
|
+
return member;
|
|
634
|
+
}
|
|
635
|
+
const newLiteral = Object.assign(Object.assign({}, value), { source: `"${this.newVersion}"`, value: this.newVersion });
|
|
636
|
+
return Object.assign(Object.assign({}, member), { value: newLiteral });
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
//# sourceMappingURL=dependency-vulnerability-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-vulnerability-check.js","sourceRoot":"","sources":["../../src/security/dependency-vulnerability-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,kDAAwI;AACxI,oDAA6G;AAC7G,kDAAkD;AAClD,oDAAkF;AAClF,oDAAgF;AAChF,gEAYyC;AACzC,+CAAiC;AACjC,2CAA6B;AAC7B,mDAA+G;AAW/G,MAAM,sBAAsB;IA+ExB,YACI,UAAkB,EAClB,GAAW,EACX,WAAmB,EACnB,OAAe,EACf,YAAoB,EACpB,mBAA2B,EAC3B,WAAoB,EACpB,OAAe,EACf,QAAgB,EAChB,KAAa,EACb,IAAY,EACZ,QAAiB,EACjB,cAAsB;QAEtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;CACJ;AAvGG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