@socketsecurity/cli-with-sentry 1.0.90 → 1.0.92
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/cli.js +67 -80
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/utils.js +10 -6
- package/dist/utils.js.map +1 -1
- package/external/@coana-tech/cli/cli.mjs +38998 -38939
- package/external/@coana-tech/cli/coana-repos/goana/bin/goana-darwin-amd64.gz +0 -0
- package/external/@coana-tech/cli/coana-repos/goana/bin/goana-darwin-arm64.gz +0 -0
- package/external/@coana-tech/cli/coana-repos/goana/bin/goana-linux-amd64.gz +0 -0
- package/external/@coana-tech/cli/coana-repos/goana/bin/goana-linux-arm64.gz +0 -0
- package/external/@coana-tech/cli/reachability-analyzers-cli.mjs +80 -61
- package/package.json +7 -7
- package/translations.json +32 -8
|
@@ -9234,7 +9234,7 @@ var require_pipeline = __commonJS({
|
|
|
9234
9234
|
if (typeof streams[streams.length - 1] !== "function") return noop4;
|
|
9235
9235
|
return streams.pop();
|
|
9236
9236
|
}
|
|
9237
|
-
function
|
|
9237
|
+
function pipeline2() {
|
|
9238
9238
|
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9239
9239
|
streams[_key] = arguments[_key];
|
|
9240
9240
|
}
|
|
@@ -9257,7 +9257,7 @@ var require_pipeline = __commonJS({
|
|
|
9257
9257
|
});
|
|
9258
9258
|
return streams.reduce(pipe);
|
|
9259
9259
|
}
|
|
9260
|
-
module.exports =
|
|
9260
|
+
module.exports = pipeline2;
|
|
9261
9261
|
}
|
|
9262
9262
|
});
|
|
9263
9263
|
|
|
@@ -11444,7 +11444,7 @@ var require_file = __commonJS({
|
|
|
11444
11444
|
var fs12 = __require("fs");
|
|
11445
11445
|
var path9 = __require("path");
|
|
11446
11446
|
var asyncSeries = require_series();
|
|
11447
|
-
var
|
|
11447
|
+
var zlib3 = __require("zlib");
|
|
11448
11448
|
var { MESSAGE } = require_triple_beam();
|
|
11449
11449
|
var { Stream: Stream2, PassThrough } = require_readable();
|
|
11450
11450
|
var TransportStream = require_winston_transport();
|
|
@@ -12013,7 +12013,7 @@ var require_file = __commonJS({
|
|
|
12013
12013
|
if (err) {
|
|
12014
12014
|
return callback();
|
|
12015
12015
|
}
|
|
12016
|
-
var gzip =
|
|
12016
|
+
var gzip = zlib3.createGzip();
|
|
12017
12017
|
var inp = fs12.createReadStream(src);
|
|
12018
12018
|
var out = fs12.createWriteStream(dest);
|
|
12019
12019
|
out.on("finish", () => {
|
|
@@ -43748,7 +43748,7 @@ var require_client = __commonJS({
|
|
|
43748
43748
|
var assert9 = __require("assert");
|
|
43749
43749
|
var net = __require("net");
|
|
43750
43750
|
var http2 = __require("http");
|
|
43751
|
-
var { pipeline } = __require("stream");
|
|
43751
|
+
var { pipeline: pipeline2 } = __require("stream");
|
|
43752
43752
|
var util6 = require_util2();
|
|
43753
43753
|
var timers = require_timers();
|
|
43754
43754
|
var Request2 = require_request();
|
|
@@ -45166,7 +45166,7 @@ upgrade: ${upgrade}\r
|
|
|
45166
45166
|
let onPipeData = function(chunk2) {
|
|
45167
45167
|
request.onBodySent(chunk2);
|
|
45168
45168
|
};
|
|
45169
|
-
const pipe =
|
|
45169
|
+
const pipe = pipeline2(
|
|
45170
45170
|
body,
|
|
45171
45171
|
h2stream,
|
|
45172
45172
|
(err) => {
|
|
@@ -46926,7 +46926,7 @@ var require_api_pipeline = __commonJS({
|
|
|
46926
46926
|
util6.destroy(ret, err);
|
|
46927
46927
|
}
|
|
46928
46928
|
};
|
|
46929
|
-
function
|
|
46929
|
+
function pipeline2(opts, handler) {
|
|
46930
46930
|
try {
|
|
46931
46931
|
const pipelineHandler = new PipelineHandler(opts, handler);
|
|
46932
46932
|
this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
|
|
@@ -46935,7 +46935,7 @@ var require_api_pipeline = __commonJS({
|
|
|
46935
46935
|
return new PassThrough().destroy(err);
|
|
46936
46936
|
}
|
|
46937
46937
|
}
|
|
46938
|
-
module.exports =
|
|
46938
|
+
module.exports = pipeline2;
|
|
46939
46939
|
}
|
|
46940
46940
|
});
|
|
46941
46941
|
|
|
@@ -49832,7 +49832,7 @@ var require_fetch = __commonJS({
|
|
|
49832
49832
|
} = require_response();
|
|
49833
49833
|
var { Headers } = require_headers();
|
|
49834
49834
|
var { Request: Request2, makeRequest } = require_request2();
|
|
49835
|
-
var
|
|
49835
|
+
var zlib3 = __require("zlib");
|
|
49836
49836
|
var {
|
|
49837
49837
|
bytesMatch,
|
|
49838
49838
|
makePolicyContainer,
|
|
@@ -49876,7 +49876,7 @@ var require_fetch = __commonJS({
|
|
|
49876
49876
|
} = require_constants3();
|
|
49877
49877
|
var { kHeadersList } = require_symbols();
|
|
49878
49878
|
var EE3 = __require("events");
|
|
49879
|
-
var { Readable: Readable2, pipeline } = __require("stream");
|
|
49879
|
+
var { Readable: Readable2, pipeline: pipeline2 } = __require("stream");
|
|
49880
49880
|
var { addAbortListener, isErrored, isReadable: isReadable2, nodeMajor, nodeMinor } = require_util2();
|
|
49881
49881
|
var { dataURLProcessor, serializeAMimeType } = require_dataURL();
|
|
49882
49882
|
var { TransformStream } = __require("stream/web");
|
|
@@ -50773,18 +50773,18 @@ var require_fetch = __commonJS({
|
|
|
50773
50773
|
if (request.method !== "HEAD" && request.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) {
|
|
50774
50774
|
for (const coding of codings) {
|
|
50775
50775
|
if (coding === "x-gzip" || coding === "gzip") {
|
|
50776
|
-
decoders.push(
|
|
50776
|
+
decoders.push(zlib3.createGunzip({
|
|
50777
50777
|
// Be less strict when decoding compressed responses, since sometimes
|
|
50778
50778
|
// servers send slightly invalid responses that are still accepted
|
|
50779
50779
|
// by common browsers.
|
|
50780
50780
|
// Always using Z_SYNC_FLUSH is what cURL does.
|
|
50781
|
-
flush:
|
|
50782
|
-
finishFlush:
|
|
50781
|
+
flush: zlib3.constants.Z_SYNC_FLUSH,
|
|
50782
|
+
finishFlush: zlib3.constants.Z_SYNC_FLUSH
|
|
50783
50783
|
}));
|
|
50784
50784
|
} else if (coding === "deflate") {
|
|
50785
|
-
decoders.push(
|
|
50785
|
+
decoders.push(zlib3.createInflate());
|
|
50786
50786
|
} else if (coding === "br") {
|
|
50787
|
-
decoders.push(
|
|
50787
|
+
decoders.push(zlib3.createBrotliDecompress());
|
|
50788
50788
|
} else {
|
|
50789
50789
|
decoders.length = 0;
|
|
50790
50790
|
break;
|
|
@@ -50795,7 +50795,7 @@ var require_fetch = __commonJS({
|
|
|
50795
50795
|
status,
|
|
50796
50796
|
statusText,
|
|
50797
50797
|
headersList: headers[kHeadersList],
|
|
50798
|
-
body: decoders.length ?
|
|
50798
|
+
body: decoders.length ? pipeline2(this.body, ...decoders, () => {
|
|
50799
50799
|
}) : this.body.on("error", () => {
|
|
50800
50800
|
})
|
|
50801
50801
|
});
|
|
@@ -59413,7 +59413,7 @@ var require_upload_gzip = __commonJS({
|
|
|
59413
59413
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59414
59414
|
exports.createGZipFileInBuffer = exports.createGZipFileOnDisk = void 0;
|
|
59415
59415
|
var fs12 = __importStar(__require("fs"));
|
|
59416
|
-
var
|
|
59416
|
+
var zlib3 = __importStar(__require("zlib"));
|
|
59417
59417
|
var util_1 = __require("util");
|
|
59418
59418
|
var stat3 = (0, util_1.promisify)(fs12.stat);
|
|
59419
59419
|
var gzipExemptFileExtensions = [
|
|
@@ -59449,7 +59449,7 @@ var require_upload_gzip = __commonJS({
|
|
|
59449
59449
|
}
|
|
59450
59450
|
return new Promise((resolve17, reject) => {
|
|
59451
59451
|
const inputStream = fs12.createReadStream(originalFilePath);
|
|
59452
|
-
const gzip =
|
|
59452
|
+
const gzip = zlib3.createGzip();
|
|
59453
59453
|
const outputStream = fs12.createWriteStream(tempFilePath);
|
|
59454
59454
|
inputStream.pipe(gzip).pipe(outputStream);
|
|
59455
59455
|
outputStream.on("finish", () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -59469,7 +59469,7 @@ var require_upload_gzip = __commonJS({
|
|
|
59469
59469
|
return new Promise((resolve17) => __awaiter(this, void 0, void 0, function* () {
|
|
59470
59470
|
var _a2, e_1, _b, _c;
|
|
59471
59471
|
const inputStream = fs12.createReadStream(originalFilePath);
|
|
59472
|
-
const gzip =
|
|
59472
|
+
const gzip = zlib3.createGzip();
|
|
59473
59473
|
inputStream.pipe(gzip);
|
|
59474
59474
|
const chunks = [];
|
|
59475
59475
|
try {
|
|
@@ -60071,7 +60071,7 @@ var require_download_http_client = __commonJS({
|
|
|
60071
60071
|
exports.DownloadHttpClient = void 0;
|
|
60072
60072
|
var fs12 = __importStar(__require("fs"));
|
|
60073
60073
|
var core = __importStar(require_core());
|
|
60074
|
-
var
|
|
60074
|
+
var zlib3 = __importStar(__require("zlib"));
|
|
60075
60075
|
var utils_1 = require_utils3();
|
|
60076
60076
|
var url_1 = __require("url");
|
|
60077
60077
|
var status_reporter_1 = require_status_reporter();
|
|
@@ -60249,7 +60249,7 @@ var require_download_http_client = __commonJS({
|
|
|
60249
60249
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60250
60250
|
yield new Promise((resolve17, reject) => {
|
|
60251
60251
|
if (isGzip) {
|
|
60252
|
-
const gunzip =
|
|
60252
|
+
const gunzip = zlib3.createGunzip();
|
|
60253
60253
|
response.message.on("error", (error) => {
|
|
60254
60254
|
core.info(`An error occurred while attempting to read the response stream`);
|
|
60255
60255
|
gunzip.close();
|
|
@@ -66504,14 +66504,14 @@ var require_headers2 = __commonJS({
|
|
|
66504
66504
|
var require_deflater = __commonJS({
|
|
66505
66505
|
"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/deflater.js"(exports, module) {
|
|
66506
66506
|
module.exports = function(inbuf) {
|
|
66507
|
-
var
|
|
66507
|
+
var zlib3 = __require("zlib");
|
|
66508
66508
|
var opts = { chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024 };
|
|
66509
66509
|
return {
|
|
66510
66510
|
deflate: function() {
|
|
66511
|
-
return
|
|
66511
|
+
return zlib3.deflateRawSync(inbuf, opts);
|
|
66512
66512
|
},
|
|
66513
66513
|
deflateAsync: function(callback) {
|
|
66514
|
-
var tmp =
|
|
66514
|
+
var tmp = zlib3.createDeflateRaw(opts), parts = [], total = 0;
|
|
66515
66515
|
tmp.on("data", function(data2) {
|
|
66516
66516
|
parts.push(data2);
|
|
66517
66517
|
total += data2.length;
|
|
@@ -66538,14 +66538,14 @@ var require_inflater = __commonJS({
|
|
|
66538
66538
|
"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/inflater.js"(exports, module) {
|
|
66539
66539
|
var version3 = +(process.versions ? process.versions.node : "").split(".")[0] || 0;
|
|
66540
66540
|
module.exports = function(inbuf, expectedLength) {
|
|
66541
|
-
var
|
|
66541
|
+
var zlib3 = __require("zlib");
|
|
66542
66542
|
const option = version3 >= 15 && expectedLength > 0 ? { maxOutputLength: expectedLength } : {};
|
|
66543
66543
|
return {
|
|
66544
66544
|
inflate: function() {
|
|
66545
|
-
return
|
|
66545
|
+
return zlib3.inflateRawSync(inbuf, option);
|
|
66546
66546
|
},
|
|
66547
66547
|
inflateAsync: function(callback) {
|
|
66548
|
-
var tmp =
|
|
66548
|
+
var tmp = zlib3.createInflateRaw(option), parts = [], total = 0;
|
|
66549
66549
|
tmp.on("data", function(data2) {
|
|
66550
66550
|
parts.push(data2);
|
|
66551
66551
|
total += data2.length;
|
|
@@ -94983,32 +94983,48 @@ function transformSourceLocations(fileMappings, detectedOccurrences) {
|
|
|
94983
94983
|
// dist/whole-program-code-aware-vulnerability-scanner/go/go-code-aware-vulnerability-scanner.js
|
|
94984
94984
|
var import_lodash11 = __toESM(require_lodash(), 1);
|
|
94985
94985
|
import assert4 from "assert";
|
|
94986
|
-
import { existsSync as existsSync9 } from "fs";
|
|
94986
|
+
import { existsSync as existsSync9, createReadStream, createWriteStream as createWriteStream2 } from "fs";
|
|
94987
94987
|
import { readFile as readFile7, rm as rm4, cp as cp4 } from "fs/promises";
|
|
94988
|
+
import zlib2 from "zlib";
|
|
94988
94989
|
import { join as join13, resolve as resolve10, sep } from "path";
|
|
94990
|
+
import { pipeline } from "stream/promises";
|
|
94989
94991
|
var { uniq: uniq5 } = import_lodash11.default;
|
|
94990
94992
|
var GoCodeAwareVulnerabilityScanner = class {
|
|
94991
94993
|
projectDir;
|
|
94992
|
-
|
|
94994
|
+
options;
|
|
94993
94995
|
name = "GOANA";
|
|
94994
|
-
constructor(projectDir,
|
|
94996
|
+
constructor(projectDir, options = {}) {
|
|
94995
94997
|
this.projectDir = projectDir;
|
|
94996
|
-
this.
|
|
94998
|
+
this.options = options;
|
|
94999
|
+
}
|
|
95000
|
+
get compressedGoanaBinaryName() {
|
|
95001
|
+
const { platform: platform6, arch } = process;
|
|
95002
|
+
const rarch = arch === "arm" ? "arm64" : arch === "x64" ? "amd64" : arch;
|
|
95003
|
+
return `goana-${platform6}-${rarch}.gz`;
|
|
94997
95004
|
}
|
|
94998
95005
|
async runAnalysis(vulns, heuristic, _analyzesAllVulns) {
|
|
94999
95006
|
logger.info("Started instantiating Go code-aware analysis");
|
|
95000
95007
|
if (!existsSync9(join13(this.projectDir, "go.mod")))
|
|
95001
95008
|
throw new Error("go.mod file not found in the project directory");
|
|
95009
|
+
const { timeoutInSeconds, memoryLimitInMB } = this.options;
|
|
95002
95010
|
const tmpDir = await createTmpDirectory("goana-output");
|
|
95003
95011
|
const vulnsOutputFile = join13(tmpDir, "vulns.json");
|
|
95004
95012
|
const diagnosticsOutputFile = join13(tmpDir, "diagnostics.json");
|
|
95005
95013
|
try {
|
|
95014
|
+
const binaryName = this.compressedGoanaBinaryName;
|
|
95015
|
+
const binaryPath = join13(COANA_REPOS_PATH(), "goana/bin", binaryName);
|
|
95016
|
+
if (!await exists(binaryPath))
|
|
95017
|
+
throw new Error(`goana binary '${binaryName}' not found`);
|
|
95018
|
+
await pipeline(createReadStream(binaryPath), zlib2.createGunzip(), createWriteStream2(join13(tmpDir, "goana"), { mode: 493 }));
|
|
95006
95019
|
const vulnAccPaths = uniq5(vulns.flatMap((v) => v.vulnerabilityAccessPaths));
|
|
95007
|
-
const { error, stderr } = await execNeverFail(cmdt`${
|
|
95020
|
+
const { error, stderr } = await execNeverFail(cmdt`${join13(tmpDir, "goana")}
|
|
95008
95021
|
-output-vulnerabilities ${vulnsOutputFile}
|
|
95009
95022
|
-output-diagnostics ${diagnosticsOutputFile}
|
|
95010
95023
|
-topk=4 ${heuristic.includeTests && "-tests"}
|
|
95011
|
-
${this.projectDir} ${vulnAccPaths}`, void 0, {
|
|
95024
|
+
${this.projectDir} ${vulnAccPaths}`, void 0, {
|
|
95025
|
+
timeout: timeoutInSeconds ? timeoutInSeconds * 1e3 : void 0,
|
|
95026
|
+
env: memoryLimitInMB ? { ...process.env, GOMEMLIMIT: `${memoryLimitInMB}MiB` } : void 0
|
|
95027
|
+
});
|
|
95012
95028
|
if (error) {
|
|
95013
95029
|
logger.error("Error running Go code-aware analysis", error);
|
|
95014
95030
|
const timeout = !!error.killed;
|
|
@@ -95045,7 +95061,7 @@ ${stderr}`);
|
|
|
95045
95061
|
await rm4(tmpDir, { recursive: true, force: true });
|
|
95046
95062
|
}
|
|
95047
95063
|
}
|
|
95048
|
-
static async runOnDependencyChain([first2, ...rest], vuln,
|
|
95064
|
+
static async runOnDependencyChain([first2, ...rest], vuln, options = {}) {
|
|
95049
95065
|
assert4(first2.version);
|
|
95050
95066
|
const { Dir, GoMod } = JSON.parse(await runCommandResolveStdOut(cmdt`go mod download -json ${first2.packageName}@v${first2.version}`));
|
|
95051
95067
|
const projectDir = await createTmpDirectory("go-run-on-dependency-chain-");
|
|
@@ -95062,7 +95078,7 @@ ${stderr}`);
|
|
|
95062
95078
|
await runGoModTidy(projectDir);
|
|
95063
95079
|
}
|
|
95064
95080
|
const heuristic = GoanaHeuristics.NO_TESTS;
|
|
95065
|
-
const result = await new this(projectDir,
|
|
95081
|
+
const result = await new this(projectDir, options).runAnalysis([vuln], heuristic, true);
|
|
95066
95082
|
if (result.type === "error")
|
|
95067
95083
|
return {
|
|
95068
95084
|
error: result.message,
|
|
@@ -95078,7 +95094,7 @@ ${stderr}`);
|
|
|
95078
95094
|
await rm4(projectDir, { recursive: true, force: true });
|
|
95079
95095
|
}
|
|
95080
95096
|
}
|
|
95081
|
-
static async runOnAlreadyDownloadedPackages(packages, vuln,
|
|
95097
|
+
static async runOnAlreadyDownloadedPackages(packages, vuln, options = {}) {
|
|
95082
95098
|
for (const pkg of packages)
|
|
95083
95099
|
assert4(existsSync9(join13(pkg, "go.mod")), `${pkg} does not contain a go.mod file`);
|
|
95084
95100
|
const [app, ...dependencies] = packages;
|
|
@@ -95095,7 +95111,7 @@ ${stderr}`);
|
|
|
95095
95111
|
await runGoModTidy(projectDir);
|
|
95096
95112
|
}
|
|
95097
95113
|
const heuristic = GoanaHeuristics.NO_TESTS;
|
|
95098
|
-
const result = await new this(projectDir,
|
|
95114
|
+
const result = await new this(projectDir, options).runAnalysis([vuln], heuristic, true);
|
|
95099
95115
|
if (result.type === "error")
|
|
95100
95116
|
return {
|
|
95101
95117
|
error: result.message,
|
|
@@ -96170,7 +96186,10 @@ async function analyzePackages(ecosystem, packages, vulnerability, options) {
|
|
|
96170
96186
|
break;
|
|
96171
96187
|
case "GO":
|
|
96172
96188
|
analysisName = "Goana";
|
|
96173
|
-
result = await GoCodeAwareVulnerabilityScanner.runOnDependencyChain(packages, vulnerability,
|
|
96189
|
+
result = await GoCodeAwareVulnerabilityScanner.runOnDependencyChain(packages, vulnerability, {
|
|
96190
|
+
timeoutInSeconds: options?.timeoutInSeconds ?? 60,
|
|
96191
|
+
memoryLimitInMB: options?.memoryLimitInMB ?? 16384
|
|
96192
|
+
});
|
|
96174
96193
|
break;
|
|
96175
96194
|
case "RUST":
|
|
96176
96195
|
analysisName = "Rustica";
|
|
@@ -96215,7 +96234,10 @@ async function analyzeAlreadyInstalledPackages(ecosystem, packages, vulnerabilit
|
|
|
96215
96234
|
break;
|
|
96216
96235
|
case "GO":
|
|
96217
96236
|
analysisName = "Goana";
|
|
96218
|
-
result = await GoCodeAwareVulnerabilityScanner.runOnAlreadyDownloadedPackages(packages, vulnerability,
|
|
96237
|
+
result = await GoCodeAwareVulnerabilityScanner.runOnAlreadyDownloadedPackages(packages, vulnerability, {
|
|
96238
|
+
timeoutInSeconds: options?.timeoutInSeconds ?? 60,
|
|
96239
|
+
memoryLimitInMB: options?.memoryLimitInMB ?? 16384
|
|
96240
|
+
});
|
|
96219
96241
|
break;
|
|
96220
96242
|
case "RUST":
|
|
96221
96243
|
analysisName = "Rustica";
|
|
@@ -96270,7 +96292,7 @@ async function getVersion(analysisName) {
|
|
|
96270
96292
|
// dist/whole-program-code-aware-vulnerability-scanner/python/python-code-aware-vulnerability-scanner.js
|
|
96271
96293
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
96272
96294
|
var { omit, once: once3, pick, sortedUniq, uniqBy } = import_lodash14.default;
|
|
96273
|
-
var PythonCodeAwareVulnerabilityScanner = class
|
|
96295
|
+
var PythonCodeAwareVulnerabilityScanner = class {
|
|
96274
96296
|
state;
|
|
96275
96297
|
projectDir;
|
|
96276
96298
|
name = "MAMBALADE";
|
|
@@ -96295,9 +96317,7 @@ var PythonCodeAwareVulnerabilityScanner = class _PythonCodeAwareVulnerabilitySca
|
|
|
96295
96317
|
async runAnalysis(vulns, heuristic, analyzesAllVulns) {
|
|
96296
96318
|
if (!this.virtualEnvInfo)
|
|
96297
96319
|
throw new Error("Virtual environment not set up");
|
|
96298
|
-
|
|
96299
|
-
await this.setupMambalade();
|
|
96300
|
-
}
|
|
96320
|
+
this.mambaladeVenvPath ??= await setupMambalade();
|
|
96301
96321
|
logger.info("Started instantiating Python code-aware analysis");
|
|
96302
96322
|
logger.debug(`Trying to find files to analyze from projectDir: ${this.projectDir}`);
|
|
96303
96323
|
const { rootWorkingDir, reachabilityAnalysisOptions } = this.state;
|
|
@@ -96429,7 +96449,7 @@ ${msg}`;
|
|
|
96429
96449
|
logger.info(`Copying ${app} to ${projectDir}`);
|
|
96430
96450
|
await cp5(app, projectDir, { recursive: true });
|
|
96431
96451
|
fileMappings.set(projectDir, app);
|
|
96432
|
-
const scanner = new
|
|
96452
|
+
const scanner = new this({
|
|
96433
96453
|
rootWorkingDir: projectTmpDir,
|
|
96434
96454
|
reachabilityAnalysisOptions: options
|
|
96435
96455
|
}, projectTmpDir);
|
|
@@ -96608,22 +96628,6 @@ ${msg}`;
|
|
|
96608
96628
|
getVirtualEnvInfo() {
|
|
96609
96629
|
return this.virtualEnvInfo;
|
|
96610
96630
|
}
|
|
96611
|
-
async setupMambalade() {
|
|
96612
|
-
const venvDir = await createTmpDirectory("mambalade-venv");
|
|
96613
|
-
logger.info("Creating Mambalade virtual environment");
|
|
96614
|
-
const pythonInterpreter = await getPythonInterpreter();
|
|
96615
|
-
await exec(cmdt`${pythonInterpreter} -SIm venv ${venvDir}`);
|
|
96616
|
-
const mambaladeWheelsPath = join15(COANA_REPOS_PATH(), "mambalade", "dist");
|
|
96617
|
-
const wheelFiles = await readdir3(mambaladeWheelsPath);
|
|
96618
|
-
const mambaladeWheels = wheelFiles.filter((f2) => f2.endsWith(".whl")).map((f2) => join15(mambaladeWheelsPath, f2));
|
|
96619
|
-
if (mambaladeWheels.length === 0) {
|
|
96620
|
-
throw new Error(`No mambalade wheel files found in ${mambaladeWheelsPath}`);
|
|
96621
|
-
}
|
|
96622
|
-
logger.info(`Installing mambalade wheels: ${mambaladeWheels.join(", ")}`);
|
|
96623
|
-
await exec(cmdt`${venvDir}/bin/pip install --no-deps ${mambaladeWheels}`);
|
|
96624
|
-
this.mambaladeVenvPath = venvDir;
|
|
96625
|
-
logger.info("Mambalade virtual environment setup complete");
|
|
96626
|
-
}
|
|
96627
96631
|
// async [Symbol.asyncDispose]() {
|
|
96628
96632
|
async cleanup() {
|
|
96629
96633
|
if (this.virtualEnvInfo?.temporary) {
|
|
@@ -96684,6 +96688,21 @@ async function getPythonInterpreter() {
|
|
|
96684
96688
|
return "python3";
|
|
96685
96689
|
throw new Error(`No Python ${pythonVersionRequired} interpreter found`);
|
|
96686
96690
|
}
|
|
96691
|
+
async function setupMambalade() {
|
|
96692
|
+
const venvDir = await createTmpDirectory("mambalade-venv");
|
|
96693
|
+
logger.info("Creating Mambalade virtual environment");
|
|
96694
|
+
const pythonInterpreter = await getPythonInterpreter();
|
|
96695
|
+
await exec(cmdt`${pythonInterpreter} -SIm venv ${venvDir}`);
|
|
96696
|
+
const mambaladeWheelsPath = join15(COANA_REPOS_PATH(), "mambalade", "dist");
|
|
96697
|
+
const wheelFiles = await readdir3(mambaladeWheelsPath);
|
|
96698
|
+
const mambaladeWheels = wheelFiles.filter((f2) => f2.endsWith(".whl")).map((f2) => join15(mambaladeWheelsPath, f2));
|
|
96699
|
+
if (!mambaladeWheels.length)
|
|
96700
|
+
throw new Error(`No mambalade wheel files found in ${mambaladeWheelsPath}`);
|
|
96701
|
+
logger.info(`Installing mambalade wheels: ${mambaladeWheels.join(", ")}`);
|
|
96702
|
+
await exec(cmdt`${venvDir}/bin/pip install --no-deps ${mambaladeWheels}`);
|
|
96703
|
+
logger.info("Mambalade virtual environment setup complete");
|
|
96704
|
+
return venvDir;
|
|
96705
|
+
}
|
|
96687
96706
|
|
|
96688
96707
|
// dist/whole-program-code-aware-vulnerability-scanner/python/phantom-deps.js
|
|
96689
96708
|
var { uniq: uniq8 } = import_lodash15.default;
|
|
@@ -97208,7 +97227,7 @@ var GoAnalyzer = class {
|
|
|
97208
97227
|
const vulnerablePackages = uniq9(vulns.flatMap((v) => v.vulnerabilityAccessPaths.map((vap) => vap.split(":")[0])));
|
|
97209
97228
|
const irrelevantPackages = new Set(await getIrrelevantPackages(this.projectDir, vulnerablePackages));
|
|
97210
97229
|
const [unreachableVulns, otherVulns] = partition2(vulns, (v) => v.vulnerabilityAccessPaths.every((vap) => irrelevantPackages.has(vap.split(":")[0])));
|
|
97211
|
-
const res = otherVulns.length ? await analyzeWithHeuristics(this.state, otherVulns, [GoanaHeuristics.DEFAULT], false, new GoCodeAwareVulnerabilityScanner(this.projectDir, this.state.reachabilityAnalysisOptions
|
|
97230
|
+
const res = otherVulns.length ? await analyzeWithHeuristics(this.state, otherVulns, [GoanaHeuristics.DEFAULT], false, new GoCodeAwareVulnerabilityScanner(this.projectDir, this.state.reachabilityAnalysisOptions), analysisMetadataCollector, statusUpdater) : [];
|
|
97212
97231
|
if (unreachableVulns.length) {
|
|
97213
97232
|
const heuristicName = GoanaHeuristics.IMPORT_REACHABILITY.name;
|
|
97214
97233
|
const detectedOccurrences = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/cli-with-sentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.92",
|
|
4
4
|
"description": "CLI for Socket.dev, includes Sentry error handling, otherwise identical to the regular `socket` package",
|
|
5
5
|
"homepage": "https://github.com/SocketDev/socket-cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"@babel/preset-typescript": "7.27.1",
|
|
86
86
|
"@babel/runtime": "7.28.3",
|
|
87
87
|
"@biomejs/biome": "2.2.0",
|
|
88
|
-
"@coana-tech/cli": "14.11.
|
|
89
|
-
"@cyclonedx/cdxgen": "11.
|
|
88
|
+
"@coana-tech/cli": "14.11.14",
|
|
89
|
+
"@cyclonedx/cdxgen": "11.6.0",
|
|
90
90
|
"@dotenvx/dotenvx": "1.48.4",
|
|
91
91
|
"@eslint/compat": "1.3.2",
|
|
92
92
|
"@eslint/js": "9.33.0",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"@types/semver": "7.7.0",
|
|
127
127
|
"@types/which": "3.0.4",
|
|
128
128
|
"@types/yargs-parser": "21.0.3",
|
|
129
|
-
"@typescript-eslint/parser": "8.
|
|
129
|
+
"@typescript-eslint/parser": "8.40.0",
|
|
130
130
|
"@typescript/native-preview": "7.0.0-dev.20250529.1",
|
|
131
131
|
"@vitest/coverage-v8": "3.2.4",
|
|
132
132
|
"blessed": "0.1.81",
|
|
@@ -159,18 +159,18 @@
|
|
|
159
159
|
"npm-package-arg": "13.0.0",
|
|
160
160
|
"npm-run-all2": "8.0.4",
|
|
161
161
|
"open": "10.2.0",
|
|
162
|
-
"oxlint": "1.
|
|
162
|
+
"oxlint": "1.12.0",
|
|
163
163
|
"pony-cause": "2.1.11",
|
|
164
164
|
"registry-auth-token": "5.1.0",
|
|
165
165
|
"registry-url": "7.2.0",
|
|
166
|
-
"rollup": "4.46.
|
|
166
|
+
"rollup": "4.46.3",
|
|
167
167
|
"semver": "7.7.2",
|
|
168
168
|
"synp": "1.9.14",
|
|
169
169
|
"terminal-link": "2.1.1",
|
|
170
170
|
"tiny-updater": "3.5.3",
|
|
171
171
|
"trash": "9.0.0",
|
|
172
172
|
"type-coverage": "2.29.7",
|
|
173
|
-
"typescript-eslint": "8.
|
|
173
|
+
"typescript-eslint": "8.40.0",
|
|
174
174
|
"unplugin-purge-polyfills": "0.1.0",
|
|
175
175
|
"vitest": "3.2.4",
|
|
176
176
|
"which": "5.0.0",
|
package/translations.json
CHANGED
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"emoji": "🎈"
|
|
170
170
|
},
|
|
171
171
|
"gitDependency": {
|
|
172
|
-
"description": "Contains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.",
|
|
172
|
+
"description": "Contains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.",
|
|
173
173
|
"suggestion": "Publish the git dependency to npm or a private package repository and consume it from there.",
|
|
174
174
|
"title": "Git dependency",
|
|
175
175
|
"emoji": "🍣"
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
},
|
|
213
213
|
"highEntropyStrings": {
|
|
214
214
|
"description": "Contains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.",
|
|
215
|
-
"suggestion": "Please inspect these strings to check if
|
|
215
|
+
"suggestion": "Please inspect these strings to check if they are benign. Maintainers should clarify the purpose and existence of high entropy strings if there is a legitimate purpose.",
|
|
216
216
|
"title": "High entropy strings",
|
|
217
217
|
"emoji": "⚠️"
|
|
218
218
|
},
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
"emoji": "⚠️"
|
|
278
278
|
},
|
|
279
279
|
"malware": {
|
|
280
|
-
"description": "This package is malware.
|
|
280
|
+
"description": "This package is identified as malware. It has been flagged either by Socket's AI scanner and confirmed by our threat research team, or is listed as malicious in security databases and other sources.",
|
|
281
281
|
"title": "Known malware",
|
|
282
282
|
"suggestion": "It is strongly recommended that malware is removed from your codebase.",
|
|
283
283
|
"emoji": "☠️"
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
"emoji": "⚠️"
|
|
392
392
|
},
|
|
393
393
|
"noV1": {
|
|
394
|
-
"description": "Package is not semver
|
|
394
|
+
"description": "Package is not semver \u003E=1. This means it is not stable and does not support ^ ranges.",
|
|
395
395
|
"suggestion": "If the package sees any general use, it should begin releasing at version 1.0.0 or later to benefit from semver.",
|
|
396
396
|
"title": "No v1",
|
|
397
397
|
"emoji": "⚠️"
|
|
@@ -488,7 +488,7 @@
|
|
|
488
488
|
},
|
|
489
489
|
"suspiciousString": {
|
|
490
490
|
"description": "This package contains suspicious text patterns which are commonly associated with bad behavior.",
|
|
491
|
-
"suggestion": "The package code should be reviewed before installing",
|
|
491
|
+
"suggestion": "The package code should be reviewed before installing.",
|
|
492
492
|
"title": "Suspicious strings",
|
|
493
493
|
"emoji": "⚠️"
|
|
494
494
|
},
|
|
@@ -560,7 +560,7 @@
|
|
|
560
560
|
},
|
|
561
561
|
"unstableOwnership": {
|
|
562
562
|
"description": "A new collaborator has begun publishing package versions. Package stability and security risk may be elevated.",
|
|
563
|
-
"suggestion": "Try to reduce the
|
|
563
|
+
"suggestion": "Try to reduce the number of authors you depend on to reduce the risk to malicious actors gaining access to your supply chain. Packages should remove inactive collaborators with publishing rights from packages on npm.",
|
|
564
564
|
"title": "Unstable ownership",
|
|
565
565
|
"emoji": "⚠️"
|
|
566
566
|
},
|
|
@@ -571,8 +571,8 @@
|
|
|
571
571
|
"emoji": "⚠️"
|
|
572
572
|
},
|
|
573
573
|
"urlStrings": {
|
|
574
|
-
"description": "Package contains fragments of external URLs or IP addresses, which
|
|
575
|
-
"suggestion": "
|
|
574
|
+
"description": "Package contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.",
|
|
575
|
+
"suggestion": "Review all remote URLs to ensure they are intentional, pointing to trusted sources, and not being used for data exfiltration or loading untrusted code at runtime.",
|
|
576
576
|
"title": "URL strings",
|
|
577
577
|
"emoji": "⚠️"
|
|
578
578
|
},
|
|
@@ -587,6 +587,30 @@
|
|
|
587
587
|
"suggestion": "Packages should remove unnecessary zero width unicode characters and use their visible counterparts.",
|
|
588
588
|
"title": "Zero width unicode chars",
|
|
589
589
|
"emoji": "⚠️"
|
|
590
|
+
},
|
|
591
|
+
"chromePermission": {
|
|
592
|
+
"description": "This Chrome extension uses the '{permission}' permission.",
|
|
593
|
+
"suggestion": "Does this extensions need these permissions? Read more about what they mean at https://developer.chrome.com/docs/extensions/reference/permissions-list",
|
|
594
|
+
"title": "Chrome Extension Permission",
|
|
595
|
+
"emoji": "⚠️"
|
|
596
|
+
},
|
|
597
|
+
"chromeHostPermission": {
|
|
598
|
+
"description": "This Chrome extension requests access to '{host}'.",
|
|
599
|
+
"suggestion": "Review the host permission request and ensure it's necessary for the extension's functionality. Consider if the extension could work with more restrictive host permissions.",
|
|
600
|
+
"title": "Chrome Extension Host Permission",
|
|
601
|
+
"emoji": "⚠️"
|
|
602
|
+
},
|
|
603
|
+
"chromeWildcardHostPermission": {
|
|
604
|
+
"description": "This Chrome extension requests broad access to websites with the pattern '{host}'.",
|
|
605
|
+
"suggestion": "Wildcard host permissions like '*://*/*' give the extension access to all websites. This is a significant security risk and should be carefully reviewed. Consider if the extension could work with more restrictive host permissions.",
|
|
606
|
+
"title": "Chrome Extension Wildcard Host Permission",
|
|
607
|
+
"emoji": "⚠️"
|
|
608
|
+
},
|
|
609
|
+
"chromeContentScript": {
|
|
610
|
+
"description": "This Chrome extension includes a content script '{scriptFile}' that runs on websites matching '{matches}'.",
|
|
611
|
+
"suggestion": "Content scripts can modify web pages and access page content. Review the content script code to understand what it does on the websites it targets.",
|
|
612
|
+
"title": "Chrome Extension Content Script",
|
|
613
|
+
"emoji": "⚠️"
|
|
590
614
|
}
|
|
591
615
|
}
|
|
592
616
|
}
|