@socketsecurity/cli-with-sentry 1.0.104 → 1.0.106
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 +25 -11
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/ci/handle-ci.d.mts.map +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-create.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts +1 -0
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +1 -1
- package/dist/types/commands/scan/reachability-flags.d.mts.map +1 -1
- package/dist/vendor.js +2 -2
- package/external/@coana-tech/cli/cli.mjs +11908 -11838
- package/external/@coana-tech/cli/reachability-analyzers-cli.mjs +212 -199
- package/external/@coana-tech/cli/repos/coana-tech/alucard/alucard.jar +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/external/@coana-tech/cli/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
- package/package.json +3 -3
|
@@ -73366,6 +73366,7 @@ async function registerAnalysisMetadataSocket(subprojectPath, workspacePath, eco
|
|
|
73366
73366
|
}
|
|
73367
73367
|
async function getLatestBucketsSocket(subprojectPath, workspacePath) {
|
|
73368
73368
|
try {
|
|
73369
|
+
if (!process.env.SOCKET_REPO_NAME || !process.env.SOCKET_BRANCH_NAME) return void 0;
|
|
73369
73370
|
const url2 = getSocketApiUrl("tier1-reachability-scan/latest-buckets");
|
|
73370
73371
|
const params = {
|
|
73371
73372
|
workspacePath,
|
|
@@ -73399,12 +73400,14 @@ async function getLatestBucketsSocket(subprojectPath, workspacePath) {
|
|
|
73399
73400
|
return void 0;
|
|
73400
73401
|
}
|
|
73401
73402
|
}
|
|
73402
|
-
async function registerAutofixOrUpgradePurlRun(manifestsTarHash,
|
|
73403
|
+
async function registerAutofixOrUpgradePurlRun(manifestsTarHash, options, cliCommand) {
|
|
73403
73404
|
try {
|
|
73404
73405
|
const url2 = getSocketApiUrl(`orgs/${process.env.SOCKET_ORG_SLUG}/fixes/register-autofix-or-upgrade-cli-run`);
|
|
73405
73406
|
const data2 = {
|
|
73406
73407
|
manifestsTarHash,
|
|
73407
|
-
|
|
73408
|
+
// disabling rule to also catch case where process.env.SOCKET_REPO_NAME is the empty string.
|
|
73409
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
73410
|
+
repositoryName: process.env.SOCKET_REPO_NAME || "unknown-repo",
|
|
73408
73411
|
options,
|
|
73409
73412
|
cliCommand
|
|
73410
73413
|
};
|
|
@@ -73986,201 +73989,6 @@ function getVulnReachability(c) {
|
|
|
73986
73989
|
return hasReachableMatches(c.detectedOccurrences) ? "REACHABLE" : "UNREACHABLE";
|
|
73987
73990
|
}
|
|
73988
73991
|
|
|
73989
|
-
// dist/env.js
|
|
73990
|
-
var COANA_API_KEY = process.env.COANA_API_KEY;
|
|
73991
|
-
var COANA_REPORT_ID = process.env.COANA_REPORT_ID;
|
|
73992
|
-
|
|
73993
|
-
// dist/whole-program-code-aware-vulnerability-scanner/dotnet/heuristics.js
|
|
73994
|
-
var CocoaHeuristics = {
|
|
73995
|
-
ALL_PACKAGES: {
|
|
73996
|
-
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
73997
|
-
name: "ALL_PACKAGES",
|
|
73998
|
-
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
73999
|
-
splitAnalysisInBuckets: false
|
|
74000
|
-
},
|
|
74001
|
-
ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES: {
|
|
74002
|
-
// analyse only application source fil
|
|
74003
|
-
name: "ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES",
|
|
74004
|
-
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
74005
|
-
splitAnalysisInBuckets: false
|
|
74006
|
-
}
|
|
74007
|
-
};
|
|
74008
|
-
|
|
74009
|
-
// dist/whole-program-code-aware-vulnerability-scanner/go/heuristics.js
|
|
74010
|
-
var GoanaHeuristics = {
|
|
74011
|
-
DEFAULT: {
|
|
74012
|
-
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
74013
|
-
name: "DEFAULT",
|
|
74014
|
-
includeTests: true,
|
|
74015
|
-
splitAnalysisInBuckets: false
|
|
74016
|
-
},
|
|
74017
|
-
NO_TESTS: {
|
|
74018
|
-
name: "NO_TESTS",
|
|
74019
|
-
includeTests: false,
|
|
74020
|
-
splitAnalysisInBuckets: false
|
|
74021
|
-
},
|
|
74022
|
-
IMPORT_REACHABILITY: {
|
|
74023
|
-
// pre-analysis to filter out vulnerabilities that are unreachable based on the import graph
|
|
74024
|
-
name: "IMPORT_REACHABILITY",
|
|
74025
|
-
includeTests: true,
|
|
74026
|
-
splitAnalysisInBuckets: false
|
|
74027
|
-
}
|
|
74028
|
-
};
|
|
74029
|
-
|
|
74030
|
-
// dist/whole-program-code-aware-vulnerability-scanner/java/heuristics.js
|
|
74031
|
-
var AlucardHeuristics = {
|
|
74032
|
-
ALL_PACKAGES: {
|
|
74033
|
-
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
74034
|
-
name: "ALL_PACKAGES",
|
|
74035
|
-
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
74036
|
-
splitAnalysisInBuckets: false
|
|
74037
|
-
},
|
|
74038
|
-
ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES: {
|
|
74039
|
-
// analyse only application source fil
|
|
74040
|
-
name: "ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES",
|
|
74041
|
-
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
74042
|
-
splitAnalysisInBuckets: false
|
|
74043
|
-
}
|
|
74044
|
-
};
|
|
74045
|
-
|
|
74046
|
-
// dist/whole-program-code-aware-vulnerability-scanner/js/heuristics.js
|
|
74047
|
-
var AllPackagesHeuristic = {
|
|
74048
|
-
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed
|
|
74049
|
-
name: "ALL_PACKAGES",
|
|
74050
|
-
getOptions: getAllPackagesHeuristicOptions,
|
|
74051
|
-
splitAnalysisInBuckets: false
|
|
74052
|
-
};
|
|
74053
|
-
var DefaultOptionsHeuristic = {
|
|
74054
|
-
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed
|
|
74055
|
-
name: "DEFAULT_OPTIONS",
|
|
74056
|
-
getOptions: () => ({}),
|
|
74057
|
-
splitAnalysisInBuckets: false
|
|
74058
|
-
};
|
|
74059
|
-
var MaxRounds2Heuristic = {
|
|
74060
|
-
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed and limiting the number of rounds to 3
|
|
74061
|
-
name: "MAX_ROUNDS_2",
|
|
74062
|
-
getOptions: () => getMaxRoundsHeuristicOptions(2),
|
|
74063
|
-
splitAnalysisInBuckets: false
|
|
74064
|
-
};
|
|
74065
|
-
var MaxRounds3Heuristic = {
|
|
74066
|
-
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed and limiting the number of rounds to 3
|
|
74067
|
-
name: "MAX_ROUNDS_3",
|
|
74068
|
-
getOptions: () => getMaxRoundsHeuristicOptions(3),
|
|
74069
|
-
splitAnalysisInBuckets: false
|
|
74070
|
-
};
|
|
74071
|
-
var MaxRounds5Heuristic = {
|
|
74072
|
-
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed and limiting the number of rounds to 5
|
|
74073
|
-
name: "MAX_ROUNDS_5",
|
|
74074
|
-
getOptions: () => getMaxRoundsHeuristicOptions(5),
|
|
74075
|
-
splitAnalysisInBuckets: false
|
|
74076
|
-
};
|
|
74077
|
-
var OnlyVulnPathPackagesExceptVulnerablePackageHeuristic = {
|
|
74078
|
-
// Analyzing only packages that are in the path of the vulnerabilities being analyzed
|
|
74079
|
-
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE",
|
|
74080
|
-
getOptions: getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions,
|
|
74081
|
-
splitAnalysisInBuckets: true
|
|
74082
|
-
};
|
|
74083
|
-
var OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds2Heuristic = {
|
|
74084
|
-
// Analyzing only packages that are in the path of the vulnerabilities being analyzed and limiting the number of rounds to 2
|
|
74085
|
-
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_2",
|
|
74086
|
-
getOptions: (vulnerabilities) => ({
|
|
74087
|
-
...getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities),
|
|
74088
|
-
...getMaxRoundsHeuristicOptions(2)
|
|
74089
|
-
}),
|
|
74090
|
-
splitAnalysisInBuckets: true
|
|
74091
|
-
};
|
|
74092
|
-
var OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds3Heuristic = {
|
|
74093
|
-
// Analyzing only packages that are in the path of the vulnerabilities being analyzed and limiting the number of rounds to 3
|
|
74094
|
-
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_3",
|
|
74095
|
-
getOptions: (vulnerabilities) => ({
|
|
74096
|
-
...getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities),
|
|
74097
|
-
...getMaxRoundsHeuristicOptions(3)
|
|
74098
|
-
}),
|
|
74099
|
-
splitAnalysisInBuckets: true
|
|
74100
|
-
};
|
|
74101
|
-
var OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds8Heuristic = {
|
|
74102
|
-
// Analyzing only packages that are in the path of the vulnerabilities being analyzed and limiting the number of rounds to 8
|
|
74103
|
-
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_8",
|
|
74104
|
-
getOptions: (vulnerabilities) => ({
|
|
74105
|
-
...getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities),
|
|
74106
|
-
...getMaxRoundsHeuristicOptions(8)
|
|
74107
|
-
}),
|
|
74108
|
-
splitAnalysisInBuckets: true
|
|
74109
|
-
};
|
|
74110
|
-
var IgnoreDependenciesAndMaxRounds3Heuristic = {
|
|
74111
|
-
name: "IGNORE_DEPENDENCIES_AND_MAX_ROUNDS_3",
|
|
74112
|
-
getOptions: () => ({ includePackages: ["some_non_existing_package"], ...getMaxRoundsHeuristicOptions(3) }),
|
|
74113
|
-
// This heuristic will ignore all dependencies, but we need to provide a package name to have a value for the --include-packages option
|
|
74114
|
-
splitAnalysisInBuckets: false
|
|
74115
|
-
};
|
|
74116
|
-
var heuristics = {
|
|
74117
|
-
ALL_PACKAGES: AllPackagesHeuristic,
|
|
74118
|
-
DEFAULT_OPTIONS: DefaultOptionsHeuristic,
|
|
74119
|
-
MAX_ROUNDS_2: MaxRounds2Heuristic,
|
|
74120
|
-
MAX_ROUNDS_3: MaxRounds3Heuristic,
|
|
74121
|
-
MAX_ROUNDS_5: MaxRounds5Heuristic,
|
|
74122
|
-
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE: OnlyVulnPathPackagesExceptVulnerablePackageHeuristic,
|
|
74123
|
-
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_2: OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds2Heuristic,
|
|
74124
|
-
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_3: OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds3Heuristic,
|
|
74125
|
-
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_8: OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds8Heuristic,
|
|
74126
|
-
createIncludePackagesHeuristic: (packageNames, options) => ({
|
|
74127
|
-
// Create a heuristic for only analyzing the packages in the packageNames array
|
|
74128
|
-
name: `INCLUDE_PACKAGES_${packageNames.join("_")}`,
|
|
74129
|
-
getOptions: () => ({ ...options, includePackages: packageNames }),
|
|
74130
|
-
splitAnalysisInBuckets: true
|
|
74131
|
-
}),
|
|
74132
|
-
IGNORE_DEPENDENCIES_AND_MAX_ROUNDS_3: IgnoreDependenciesAndMaxRounds3Heuristic
|
|
74133
|
-
};
|
|
74134
|
-
function getAllPackagesHeuristicOptions() {
|
|
74135
|
-
return {};
|
|
74136
|
-
}
|
|
74137
|
-
function getMaxRoundsHeuristicOptions(maxRounds) {
|
|
74138
|
-
return {
|
|
74139
|
-
maxIndirections: maxRounds
|
|
74140
|
-
};
|
|
74141
|
-
}
|
|
74142
|
-
function getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities) {
|
|
74143
|
-
return {
|
|
74144
|
-
includePackages: computePackagesOnVulnPathExcludingVulnerablePackage(vulnerabilities)
|
|
74145
|
-
};
|
|
74146
|
-
}
|
|
74147
|
-
function computePackagesOnVulnPathExcludingVulnerablePackage(vulnerabilities) {
|
|
74148
|
-
const packagesToAnalyze = /* @__PURE__ */ new Set();
|
|
74149
|
-
vulnerabilities.filter((v) => !v.vulnerabilityAccessPaths || typeof v.vulnerabilityAccessPaths !== "string").forEach((v) => {
|
|
74150
|
-
const visitedIdentifiers = [];
|
|
74151
|
-
const helper = (node) => {
|
|
74152
|
-
if (node.children && node.children.length > 0)
|
|
74153
|
-
packagesToAnalyze.add(node.packageName);
|
|
74154
|
-
node.children?.filter((c) => !visitedIdentifiers.includes(c)).forEach((c) => {
|
|
74155
|
-
visitedIdentifiers.push(c);
|
|
74156
|
-
helper(v.vulnChainDetails.transitiveDependencies[c]);
|
|
74157
|
-
});
|
|
74158
|
-
};
|
|
74159
|
-
helper(v.vulnChainDetails);
|
|
74160
|
-
});
|
|
74161
|
-
return [...packagesToAnalyze];
|
|
74162
|
-
}
|
|
74163
|
-
|
|
74164
|
-
// dist/whole-program-code-aware-vulnerability-scanner/python/heuristics.js
|
|
74165
|
-
var MambaladeHeuristics = {
|
|
74166
|
-
ALL_PACKAGES: {
|
|
74167
|
-
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
74168
|
-
name: "ALL_PACKAGES",
|
|
74169
|
-
splitAnalysisInBuckets: false
|
|
74170
|
-
},
|
|
74171
|
-
createOnlyVulnPathPackagesHeuristic(depInfos) {
|
|
74172
|
-
return {
|
|
74173
|
-
// analyzes only packages that are in the path of the vulnerabilities being analyzed
|
|
74174
|
-
name: "ONLY_VULN_PATH_PACKAGES",
|
|
74175
|
-
getPackagesToExcludeFromAnalysis: (vulnerabilities) => {
|
|
74176
|
-
const packagesToAnalyze = new Set(vulnerabilities.flatMap((v) => Object.values(v.vulnChainDetails?.transitiveDependencies ?? {}).map((d) => d.packageName)));
|
|
74177
|
-
return new Set(depInfos.map((d) => d.packageName).filter((name2) => !packagesToAnalyze.has(name2)));
|
|
74178
|
-
},
|
|
74179
|
-
splitAnalysisInBuckets: true
|
|
74180
|
-
};
|
|
74181
|
-
}
|
|
74182
|
-
};
|
|
74183
|
-
|
|
74184
73992
|
// dist/analyzers/pip-analyzer.js
|
|
74185
73993
|
var import_lodash16 = __toESM(require_lodash(), 1);
|
|
74186
73994
|
import assert7 from "assert";
|
|
@@ -74402,6 +74210,26 @@ function uvTool(executable) {
|
|
|
74402
74210
|
return ["uv", "tool", "run", "--python", executable ?? systemPython()];
|
|
74403
74211
|
}
|
|
74404
74212
|
|
|
74213
|
+
// dist/whole-program-code-aware-vulnerability-scanner/python/heuristics.js
|
|
74214
|
+
var MambaladeHeuristics = {
|
|
74215
|
+
ALL_PACKAGES: {
|
|
74216
|
+
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
74217
|
+
name: "ALL_PACKAGES",
|
|
74218
|
+
splitAnalysisInBuckets: false
|
|
74219
|
+
},
|
|
74220
|
+
createOnlyVulnPathPackagesHeuristic(depInfos) {
|
|
74221
|
+
return {
|
|
74222
|
+
// analyzes only packages that are in the path of the vulnerabilities being analyzed
|
|
74223
|
+
name: "ONLY_VULN_PATH_PACKAGES",
|
|
74224
|
+
getPackagesToExcludeFromAnalysis: (vulnerabilities) => {
|
|
74225
|
+
const packagesToAnalyze = new Set(vulnerabilities.flatMap((v) => Object.values(v.vulnChainDetails?.transitiveDependencies ?? {}).map((d) => d.packageName)));
|
|
74226
|
+
return new Set(depInfos.map((d) => d.packageName).filter((name2) => !packagesToAnalyze.has(name2)));
|
|
74227
|
+
},
|
|
74228
|
+
splitAnalysisInBuckets: true
|
|
74229
|
+
};
|
|
74230
|
+
}
|
|
74231
|
+
};
|
|
74232
|
+
|
|
74405
74233
|
// dist/whole-program-code-aware-vulnerability-scanner/python/phantom-deps.js
|
|
74406
74234
|
var import_lodash15 = __toESM(require_lodash(), 1);
|
|
74407
74235
|
import fs11 from "fs/promises";
|
|
@@ -74592,6 +74420,22 @@ function assertDefined(value) {
|
|
|
74592
74420
|
return value;
|
|
74593
74421
|
}
|
|
74594
74422
|
|
|
74423
|
+
// dist/whole-program-code-aware-vulnerability-scanner/dotnet/heuristics.js
|
|
74424
|
+
var CocoaHeuristics = {
|
|
74425
|
+
ALL_PACKAGES: {
|
|
74426
|
+
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
74427
|
+
name: "ALL_PACKAGES",
|
|
74428
|
+
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
74429
|
+
splitAnalysisInBuckets: false
|
|
74430
|
+
},
|
|
74431
|
+
ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES: {
|
|
74432
|
+
// analyse only application source fil
|
|
74433
|
+
name: "ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES",
|
|
74434
|
+
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
74435
|
+
splitAnalysisInBuckets: false
|
|
74436
|
+
}
|
|
74437
|
+
};
|
|
74438
|
+
|
|
74595
74439
|
// dist/whole-program-code-aware-vulnerability-scanner/dotnet/dotnet-code-aware-vulnerability-scanner.js
|
|
74596
74440
|
var import_adm_zip = __toESM(require_adm_zip(), 1);
|
|
74597
74441
|
import { mkdir, readFile as readFile5, writeFile as writeFile3 } from "fs/promises";
|
|
@@ -88440,6 +88284,22 @@ async function findArtifactsForPackageInRemoteRepository(repository, groupId, ar
|
|
|
88440
88284
|
}
|
|
88441
88285
|
}
|
|
88442
88286
|
|
|
88287
|
+
// dist/whole-program-code-aware-vulnerability-scanner/java/heuristics.js
|
|
88288
|
+
var AlucardHeuristics = {
|
|
88289
|
+
ALL_PACKAGES: {
|
|
88290
|
+
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
88291
|
+
name: "ALL_PACKAGES",
|
|
88292
|
+
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
88293
|
+
splitAnalysisInBuckets: false
|
|
88294
|
+
},
|
|
88295
|
+
ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES: {
|
|
88296
|
+
// analyse only application source fil
|
|
88297
|
+
name: "ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES",
|
|
88298
|
+
getPackagesToAnalyze: (_vulnerabilities) => void 0,
|
|
88299
|
+
splitAnalysisInBuckets: false
|
|
88300
|
+
}
|
|
88301
|
+
};
|
|
88302
|
+
|
|
88443
88303
|
// dist/whole-program-code-aware-vulnerability-scanner/java/java-code-aware-vulnerability-scanner.js
|
|
88444
88304
|
var import_packageurl_js5 = __toESM(require_packageurl_js(), 1);
|
|
88445
88305
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -94950,6 +94810,124 @@ async function createSymlinksForEachDependency(dependencyInfosForDependenciesToI
|
|
|
94950
94810
|
}
|
|
94951
94811
|
}
|
|
94952
94812
|
|
|
94813
|
+
// dist/whole-program-code-aware-vulnerability-scanner/js/heuristics.js
|
|
94814
|
+
var AllPackagesHeuristic = {
|
|
94815
|
+
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed
|
|
94816
|
+
name: "ALL_PACKAGES",
|
|
94817
|
+
getOptions: getAllPackagesHeuristicOptions,
|
|
94818
|
+
splitAnalysisInBuckets: false
|
|
94819
|
+
};
|
|
94820
|
+
var DefaultOptionsHeuristic = {
|
|
94821
|
+
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed
|
|
94822
|
+
name: "DEFAULT_OPTIONS",
|
|
94823
|
+
getOptions: () => ({}),
|
|
94824
|
+
splitAnalysisInBuckets: false
|
|
94825
|
+
};
|
|
94826
|
+
var MaxRounds2Heuristic = {
|
|
94827
|
+
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed and limiting the number of rounds to 3
|
|
94828
|
+
name: "MAX_ROUNDS_2",
|
|
94829
|
+
getOptions: () => getMaxRoundsHeuristicOptions(2),
|
|
94830
|
+
splitAnalysisInBuckets: false
|
|
94831
|
+
};
|
|
94832
|
+
var MaxRounds3Heuristic = {
|
|
94833
|
+
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed and limiting the number of rounds to 3
|
|
94834
|
+
name: "MAX_ROUNDS_3",
|
|
94835
|
+
getOptions: () => getMaxRoundsHeuristicOptions(3),
|
|
94836
|
+
splitAnalysisInBuckets: false
|
|
94837
|
+
};
|
|
94838
|
+
var MaxRounds5Heuristic = {
|
|
94839
|
+
// Analyzing all packages disregarding what vulnerabilities affect the project being analyzed and limiting the number of rounds to 5
|
|
94840
|
+
name: "MAX_ROUNDS_5",
|
|
94841
|
+
getOptions: () => getMaxRoundsHeuristicOptions(5),
|
|
94842
|
+
splitAnalysisInBuckets: false
|
|
94843
|
+
};
|
|
94844
|
+
var OnlyVulnPathPackagesExceptVulnerablePackageHeuristic = {
|
|
94845
|
+
// Analyzing only packages that are in the path of the vulnerabilities being analyzed
|
|
94846
|
+
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE",
|
|
94847
|
+
getOptions: getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions,
|
|
94848
|
+
splitAnalysisInBuckets: true
|
|
94849
|
+
};
|
|
94850
|
+
var OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds2Heuristic = {
|
|
94851
|
+
// Analyzing only packages that are in the path of the vulnerabilities being analyzed and limiting the number of rounds to 2
|
|
94852
|
+
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_2",
|
|
94853
|
+
getOptions: (vulnerabilities) => ({
|
|
94854
|
+
...getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities),
|
|
94855
|
+
...getMaxRoundsHeuristicOptions(2)
|
|
94856
|
+
}),
|
|
94857
|
+
splitAnalysisInBuckets: true
|
|
94858
|
+
};
|
|
94859
|
+
var OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds3Heuristic = {
|
|
94860
|
+
// Analyzing only packages that are in the path of the vulnerabilities being analyzed and limiting the number of rounds to 3
|
|
94861
|
+
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_3",
|
|
94862
|
+
getOptions: (vulnerabilities) => ({
|
|
94863
|
+
...getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities),
|
|
94864
|
+
...getMaxRoundsHeuristicOptions(3)
|
|
94865
|
+
}),
|
|
94866
|
+
splitAnalysisInBuckets: true
|
|
94867
|
+
};
|
|
94868
|
+
var OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds8Heuristic = {
|
|
94869
|
+
// Analyzing only packages that are in the path of the vulnerabilities being analyzed and limiting the number of rounds to 8
|
|
94870
|
+
name: "ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_8",
|
|
94871
|
+
getOptions: (vulnerabilities) => ({
|
|
94872
|
+
...getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities),
|
|
94873
|
+
...getMaxRoundsHeuristicOptions(8)
|
|
94874
|
+
}),
|
|
94875
|
+
splitAnalysisInBuckets: true
|
|
94876
|
+
};
|
|
94877
|
+
var IgnoreDependenciesAndMaxRounds3Heuristic = {
|
|
94878
|
+
name: "IGNORE_DEPENDENCIES_AND_MAX_ROUNDS_3",
|
|
94879
|
+
getOptions: () => ({ includePackages: ["some_non_existing_package"], ...getMaxRoundsHeuristicOptions(3) }),
|
|
94880
|
+
// This heuristic will ignore all dependencies, but we need to provide a package name to have a value for the --include-packages option
|
|
94881
|
+
splitAnalysisInBuckets: false
|
|
94882
|
+
};
|
|
94883
|
+
var heuristics = {
|
|
94884
|
+
ALL_PACKAGES: AllPackagesHeuristic,
|
|
94885
|
+
DEFAULT_OPTIONS: DefaultOptionsHeuristic,
|
|
94886
|
+
MAX_ROUNDS_2: MaxRounds2Heuristic,
|
|
94887
|
+
MAX_ROUNDS_3: MaxRounds3Heuristic,
|
|
94888
|
+
MAX_ROUNDS_5: MaxRounds5Heuristic,
|
|
94889
|
+
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE: OnlyVulnPathPackagesExceptVulnerablePackageHeuristic,
|
|
94890
|
+
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_2: OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds2Heuristic,
|
|
94891
|
+
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_3: OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds3Heuristic,
|
|
94892
|
+
ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_8: OnlyVulnPathPackagesExceptVulnerablePackageAndMaxRounds8Heuristic,
|
|
94893
|
+
createIncludePackagesHeuristic: (packageNames, options) => ({
|
|
94894
|
+
// Create a heuristic for only analyzing the packages in the packageNames array
|
|
94895
|
+
name: `INCLUDE_PACKAGES_${packageNames.join("_")}`,
|
|
94896
|
+
getOptions: () => ({ ...options, includePackages: packageNames }),
|
|
94897
|
+
splitAnalysisInBuckets: true
|
|
94898
|
+
}),
|
|
94899
|
+
IGNORE_DEPENDENCIES_AND_MAX_ROUNDS_3: IgnoreDependenciesAndMaxRounds3Heuristic
|
|
94900
|
+
};
|
|
94901
|
+
function getAllPackagesHeuristicOptions() {
|
|
94902
|
+
return {};
|
|
94903
|
+
}
|
|
94904
|
+
function getMaxRoundsHeuristicOptions(maxRounds) {
|
|
94905
|
+
return {
|
|
94906
|
+
maxIndirections: maxRounds
|
|
94907
|
+
};
|
|
94908
|
+
}
|
|
94909
|
+
function getOnlyPackagesInVulnPathsWithoutLeafPackagesHeuristicOptions(vulnerabilities) {
|
|
94910
|
+
return {
|
|
94911
|
+
includePackages: computePackagesOnVulnPathExcludingVulnerablePackage(vulnerabilities)
|
|
94912
|
+
};
|
|
94913
|
+
}
|
|
94914
|
+
function computePackagesOnVulnPathExcludingVulnerablePackage(vulnerabilities) {
|
|
94915
|
+
const packagesToAnalyze = /* @__PURE__ */ new Set();
|
|
94916
|
+
vulnerabilities.filter((v) => !v.vulnerabilityAccessPaths || typeof v.vulnerabilityAccessPaths !== "string").forEach((v) => {
|
|
94917
|
+
const visitedIdentifiers = [];
|
|
94918
|
+
const helper = (node) => {
|
|
94919
|
+
if (node.children && node.children.length > 0)
|
|
94920
|
+
packagesToAnalyze.add(node.packageName);
|
|
94921
|
+
node.children?.filter((c) => !visitedIdentifiers.includes(c)).forEach((c) => {
|
|
94922
|
+
visitedIdentifiers.push(c);
|
|
94923
|
+
helper(v.vulnChainDetails.transitiveDependencies[c]);
|
|
94924
|
+
});
|
|
94925
|
+
};
|
|
94926
|
+
helper(v.vulnChainDetails);
|
|
94927
|
+
});
|
|
94928
|
+
return [...packagesToAnalyze];
|
|
94929
|
+
}
|
|
94930
|
+
|
|
94953
94931
|
// dist/whole-program-code-aware-vulnerability-scanner/js/js-code-aware-vulnerability-scanner.js
|
|
94954
94932
|
var JSCodeAwareVulnerabilityScanner = class _JSCodeAwareVulnerabilityScanner {
|
|
94955
94933
|
mainProjectDir;
|
|
@@ -95126,6 +95104,29 @@ import { existsSync as existsSync9, createReadStream, createWriteStream as creat
|
|
|
95126
95104
|
import { readFile as readFile8, rm as rm4, cp as cp4 } from "fs/promises";
|
|
95127
95105
|
import zlib2 from "zlib";
|
|
95128
95106
|
import { join as join17, resolve as resolve9, sep } from "path";
|
|
95107
|
+
|
|
95108
|
+
// dist/whole-program-code-aware-vulnerability-scanner/go/heuristics.js
|
|
95109
|
+
var GoanaHeuristics = {
|
|
95110
|
+
DEFAULT: {
|
|
95111
|
+
// analyzes all packages disregarding what vulnerabilities affect the project being analyzed
|
|
95112
|
+
name: "DEFAULT",
|
|
95113
|
+
includeTests: true,
|
|
95114
|
+
splitAnalysisInBuckets: false
|
|
95115
|
+
},
|
|
95116
|
+
NO_TESTS: {
|
|
95117
|
+
name: "NO_TESTS",
|
|
95118
|
+
includeTests: false,
|
|
95119
|
+
splitAnalysisInBuckets: false
|
|
95120
|
+
},
|
|
95121
|
+
IMPORT_REACHABILITY: {
|
|
95122
|
+
// pre-analysis to filter out vulnerabilities that are unreachable based on the import graph
|
|
95123
|
+
name: "IMPORT_REACHABILITY",
|
|
95124
|
+
includeTests: true,
|
|
95125
|
+
splitAnalysisInBuckets: false
|
|
95126
|
+
}
|
|
95127
|
+
};
|
|
95128
|
+
|
|
95129
|
+
// dist/whole-program-code-aware-vulnerability-scanner/go/go-code-aware-vulnerability-scanner.js
|
|
95129
95130
|
import { pipeline } from "stream/promises";
|
|
95130
95131
|
var { uniq: uniq5 } = import_lodash11.default;
|
|
95131
95132
|
var GoCodeAwareVulnerabilityScanner = class {
|
|
@@ -96987,15 +96988,20 @@ function getPreInstalledDepInfos(workspaceData) {
|
|
|
96987
96988
|
}
|
|
96988
96989
|
}
|
|
96989
96990
|
|
|
96991
|
+
// dist/env.js
|
|
96992
|
+
var COANA_API_KEY = process.env.COANA_API_KEY;
|
|
96993
|
+
var COANA_REPORT_ID = process.env.COANA_REPORT_ID;
|
|
96994
|
+
|
|
96990
96995
|
// dist/whole-program-code-aware-vulnerability-scanner/analyze-in-buckets.js
|
|
96991
96996
|
var { groupBy } = import_lodash17.default;
|
|
96992
96997
|
var CLI_VERSION_TO_USE_CACHING_FROM = { PIP: "14.9.15" };
|
|
96993
96998
|
var CLI_VERSION_TO_USE_CACHING_FROM_DEFAULT = "13.16.6";
|
|
96999
|
+
var SOCKET_MODE = process.env.SOCKET_MODE === "true";
|
|
96994
97000
|
function assertVulnChainDetails(vs) {
|
|
96995
97001
|
assert8(vs.every((v) => v.vulnChainDetails));
|
|
96996
97002
|
}
|
|
96997
97003
|
var apiKey = COANA_API_KEY ? { type: "present", value: COANA_API_KEY } : { type: "missing" };
|
|
96998
|
-
var dashboardAPI = new DashboardAPI(
|
|
97004
|
+
var dashboardAPI = new DashboardAPI(SOCKET_MODE, process.env.DISABLE_ANALYTICS_SHARING === "true");
|
|
96999
97005
|
async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecomputeForTimeoutsAndAborts, codeAwareScanner, analysisMetadataCollector, statusUpdater) {
|
|
97000
97006
|
logger.debug("Starting analyzeWithHeuristics");
|
|
97001
97007
|
assertVulnChainDetails(vulns);
|
|
@@ -97083,7 +97089,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97083
97089
|
}
|
|
97084
97090
|
}
|
|
97085
97091
|
async function getBucketsBasedOnPreviousResults() {
|
|
97086
|
-
if (
|
|
97092
|
+
if (state.otherAnalysisOptions.skipCacheUsage || !SOCKET_MODE && (!COANA_REPORT_ID || apiKey.type === "missing"))
|
|
97087
97093
|
return void 0;
|
|
97088
97094
|
const bucketsFromLastAnalysisAndCliVersion = await dashboardAPI.getBucketsForLastReport(relative5(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, vulnerabilities[0].ecosystem ?? "NPM", COANA_REPORT_ID, apiKey);
|
|
97089
97095
|
if (!bucketsFromLastAnalysisAndCliVersion)
|
|
@@ -97319,6 +97325,13 @@ function augmentVulnsWithDetectedOccurrences(vulns, codeAwareScanner, heuristic,
|
|
|
97319
97325
|
for (const v of vulns) {
|
|
97320
97326
|
const detectedOccurrences = result.computeDetectedOccurrences(v);
|
|
97321
97327
|
if (Array.isArray(detectedOccurrences) ? detectedOccurrences.length === 0 : detectedOccurrences.stacks.length === 0) {
|
|
97328
|
+
if (SOCKET_MODE && result.terminatedEarly && !result.reachedDependencies && Object.keys(v.vulnChainDetails.transitiveDependencies).length > 1) {
|
|
97329
|
+
v.results = {
|
|
97330
|
+
type: "analysisError",
|
|
97331
|
+
message: "Analysis terminated early and did not reach any dependencies"
|
|
97332
|
+
};
|
|
97333
|
+
continue;
|
|
97334
|
+
}
|
|
97322
97335
|
const packageOnPathFailedToInstall = Object.values(v.vulnChainDetails.transitiveDependencies).map((p) => p.packageName).find((p) => packagesFailedToInstall.includes(p));
|
|
97323
97336
|
if (packageOnPathFailedToInstall) {
|
|
97324
97337
|
v.results = {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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.106",
|
|
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",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@babel/preset-typescript": "7.27.1",
|
|
87
87
|
"@babel/runtime": "7.28.3",
|
|
88
88
|
"@biomejs/biome": "2.2.2",
|
|
89
|
-
"@coana-tech/cli": "14.12.
|
|
89
|
+
"@coana-tech/cli": "14.12.12",
|
|
90
90
|
"@cyclonedx/cdxgen": "11.6.0",
|
|
91
91
|
"@dotenvx/dotenvx": "1.49.0",
|
|
92
92
|
"@eslint/compat": "1.3.2",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"@socketregistry/packageurl-js": "1.0.9",
|
|
115
115
|
"@socketsecurity/config": "3.0.1",
|
|
116
116
|
"@socketsecurity/registry": "1.0.275",
|
|
117
|
-
"@socketsecurity/sdk": "1.4.
|
|
117
|
+
"@socketsecurity/sdk": "1.4.80",
|
|
118
118
|
"@types/blessed": "0.1.25",
|
|
119
119
|
"@types/cmd-shim": "5.0.2",
|
|
120
120
|
"@types/js-yaml": "4.0.9",
|