@socketsecurity/cli-with-sentry 1.0.101 → 1.0.102
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 +2 -2
- 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/fix/coana-fix.d.mts.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/external/@coana-tech/cli/cli.mjs +68 -62
- package/external/@coana-tech/cli/reachability-analyzers-cli.mjs +75 -69
- 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/external/@coana-tech/cli/repos/coana-tech/mambalade/dist/mambalade-0.3.11-py3-none-any.whl +0 -0
- package/package.json +2 -2
|
@@ -73587,22 +73587,22 @@ import { join as join3 } from "path";
|
|
|
73587
73587
|
// ../utils/src/command-utils.ts
|
|
73588
73588
|
import assert from "assert";
|
|
73589
73589
|
import { execFile } from "child_process";
|
|
73590
|
-
async function execAndLogOnFailure(cmd, dir, options) {
|
|
73590
|
+
async function execAndLogOnFailure(cmd, dir, options, logLevel = "info") {
|
|
73591
73591
|
const result = await execNeverFail(cmd, dir, options);
|
|
73592
|
-
if (result.error) logCommandOutput(result, cmd, dir);
|
|
73592
|
+
if (result.error) logCommandOutput(result, cmd, dir, logLevel);
|
|
73593
73593
|
return !result.error;
|
|
73594
73594
|
}
|
|
73595
|
-
function logCommandOutput(cmdResult, cmd, dir) {
|
|
73595
|
+
function logCommandOutput(cmdResult, cmd, dir, logLevel = "info") {
|
|
73596
73596
|
const { error, stdout, stderr } = cmdResult;
|
|
73597
|
-
logger
|
|
73598
|
-
logger
|
|
73597
|
+
logger[logLevel](error ? `Error running command: ${cmd}` : `Result of running command: ${cmd}`);
|
|
73598
|
+
logger[logLevel](`Directory: ${dir}`);
|
|
73599
73599
|
if (error) {
|
|
73600
73600
|
const em = error.message;
|
|
73601
|
-
logger
|
|
73601
|
+
logger[logLevel](`Error: ${em?.endsWith?.(`
|
|
73602
73602
|
${stderr}`) ? em.slice(0, -stderr.length - 1) : em}`);
|
|
73603
73603
|
}
|
|
73604
|
-
logger
|
|
73605
|
-
logger
|
|
73604
|
+
logger[logLevel](`stdout: ${stdout}`);
|
|
73605
|
+
logger[logLevel](`stderr: ${stderr}`);
|
|
73606
73606
|
}
|
|
73607
73607
|
async function execNeverFail(cmd, dir, options) {
|
|
73608
73608
|
return new Promise((resolve16) => {
|
|
@@ -73747,17 +73747,18 @@ function excludeFiles(excludedDirsRoot, filesRoot, files, excludeDirs) {
|
|
|
73747
73747
|
)
|
|
73748
73748
|
).map((f2) => relative(filesRoot, f2));
|
|
73749
73749
|
}
|
|
73750
|
-
function
|
|
73751
|
-
let curr = dir;
|
|
73752
|
-
let last2 = dir;
|
|
73750
|
+
function* parents(dir) {
|
|
73751
|
+
let [curr, last2] = [dir, dir];
|
|
73753
73752
|
do {
|
|
73754
|
-
|
|
73755
|
-
|
|
73756
|
-
last2 = curr;
|
|
73757
|
-
curr = resolve(curr, "..");
|
|
73753
|
+
yield curr;
|
|
73754
|
+
[last2, curr] = [curr, resolve(curr, "..")];
|
|
73758
73755
|
} while (curr !== last2);
|
|
73759
73756
|
return void 0;
|
|
73760
73757
|
}
|
|
73758
|
+
function findParent(dir, predicate, wholePath) {
|
|
73759
|
+
for (const parent2 of parents(dir))
|
|
73760
|
+
if (predicate(wholePath ? parent2 : basename(parent2))) return parent2;
|
|
73761
|
+
}
|
|
73761
73762
|
async function getFiles(dir, excludeDirs) {
|
|
73762
73763
|
async function helper(currDir, arrayOfFiles) {
|
|
73763
73764
|
for (const item of await readdir(currDir, { withFileTypes: true })) {
|
|
@@ -74201,6 +74202,7 @@ import { join as join4, resolve as resolve2 } from "path";
|
|
|
74201
74202
|
import util3 from "util";
|
|
74202
74203
|
var { once } = import_lodash4.default;
|
|
74203
74204
|
var systemPython = once(() => execFileSync("which", ["python"], { encoding: "utf8" }).trim());
|
|
74205
|
+
var hasPyenv = once(async () => !(await execNeverFail("which pyenv")).error);
|
|
74204
74206
|
async function getPythonVersion(executable) {
|
|
74205
74207
|
return runCommandResolveStdOut([executable, "-SIc", `import sys; print(*sys.version_info[:3], sep='.')`]);
|
|
74206
74208
|
}
|
|
@@ -74231,11 +74233,9 @@ var PythonVersionsManager = class _PythonVersionsManager {
|
|
|
74231
74233
|
// Extracts the python version specifier from the workspace and returns it as an array of semver parts.
|
|
74232
74234
|
async getPythonSpecifier(workspacePath, checkPyProject = true) {
|
|
74233
74235
|
const absPath = resolve2(this.projectDir, workspacePath);
|
|
74234
|
-
const
|
|
74235
|
-
const pyenvRoot = process.env.PYENV_ROOT ?? await runCommandResolveStdOut("pyenv root");
|
|
74236
|
-
if (pyenvOrigin !== join4(pyenvRoot, "version"))
|
|
74236
|
+
for (const parent2 of parents(absPath))
|
|
74237
74237
|
try {
|
|
74238
|
-
return [(await readFile3(
|
|
74238
|
+
return [(await readFile3(join4(parent2, ".python-version"), "utf-8")).split("\n")[0].trim()];
|
|
74239
74239
|
} catch (e) {
|
|
74240
74240
|
if (e.code !== "ENOENT") logger.warn("Failed to read python version file with error", e);
|
|
74241
74241
|
}
|
|
@@ -74283,7 +74283,12 @@ var PythonVersionsManager = class _PythonVersionsManager {
|
|
|
74283
74283
|
if (semVerSpec) {
|
|
74284
74284
|
const systemVer = await getPythonVersion(systemPython());
|
|
74285
74285
|
if (versionMatchesSemverParts(systemVer, semVerSpec)) return systemPython();
|
|
74286
|
-
|
|
74286
|
+
if (!await hasPyenv())
|
|
74287
|
+
throw Error(
|
|
74288
|
+
`System Python (${systemVer}) does not satisfy the specifier '${semVerSpec.join(", ")}'. A matching interpreter can automatically be installed if 'pyenv' is available.`
|
|
74289
|
+
);
|
|
74290
|
+
} else if (!await hasPyenv() || _PythonVersionsManager.getGlobalPythonVersion() === "system")
|
|
74291
|
+
return systemPython();
|
|
74287
74292
|
return resolve2(await _PythonVersionsManager.getPythonPrefixMatchingSpecifier(semVerSpec), "bin", "python");
|
|
74288
74293
|
}
|
|
74289
74294
|
// Throws an error if the python version is not installed.
|
|
@@ -77166,7 +77171,7 @@ __export(traversing_exports, {
|
|
|
77166
77171
|
nextUntil: () => nextUntil,
|
|
77167
77172
|
not: () => not,
|
|
77168
77173
|
parent: () => parent,
|
|
77169
|
-
parents: () =>
|
|
77174
|
+
parents: () => parents2,
|
|
77170
77175
|
parentsUntil: () => parentsUntil,
|
|
77171
77176
|
prev: () => prev,
|
|
77172
77177
|
prevAll: () => prevAll,
|
|
@@ -78428,7 +78433,7 @@ function _removeDuplicates(elems) {
|
|
|
78428
78433
|
return Array.from(new Set(elems));
|
|
78429
78434
|
}
|
|
78430
78435
|
var parent = _singleMatcher(({ parent: parent2 }) => parent2 && !isDocument(parent2) ? parent2 : null, _removeDuplicates);
|
|
78431
|
-
var
|
|
78436
|
+
var parents2 = _matcher((elem) => {
|
|
78432
78437
|
const matched = [];
|
|
78433
78438
|
while (elem.parent && !isDocument(elem.parent)) {
|
|
78434
78439
|
matched.push(elem.parent);
|
|
@@ -96448,9 +96453,9 @@ var PythonCodeAwareVulnerabilityScanner = class {
|
|
|
96448
96453
|
const packagesToExclude = heuristic.getPackagesToExcludeFromAnalysis?.(vulns);
|
|
96449
96454
|
const packagesToInstall = uniqBy(preInstalledDepInfos.filter((n) => !packagesToExclude?.has(n.packageName)), "packageName");
|
|
96450
96455
|
if (!await this.tryUsingPreinstalledVirtualEnv(packagesToInstall)) {
|
|
96451
|
-
logger.info(
|
|
96456
|
+
logger.info(`Setting up virtual environment`);
|
|
96452
96457
|
await this.prepareVirtualEnv(packagesToInstall);
|
|
96453
|
-
logger.
|
|
96458
|
+
logger.info("Done setting up virtual environment");
|
|
96454
96459
|
}
|
|
96455
96460
|
}
|
|
96456
96461
|
async runAnalysis(vulns, heuristic, analyzesAllVulns) {
|
|
@@ -96512,7 +96517,7 @@ runpy.run_module("mambalade", alter_sys=True)
|
|
|
96512
96517
|
"--",
|
|
96513
96518
|
...filesToAnalyze
|
|
96514
96519
|
];
|
|
96515
|
-
logger.
|
|
96520
|
+
logger.debug(`Running mambalade on ${filesToAnalyze.length} files for vulnerabilities:
|
|
96516
96521
|
${vulnAccPaths.join("\n")}`);
|
|
96517
96522
|
logger.debug(`Running python executable: ${pythonExecutable}`);
|
|
96518
96523
|
logger.debug(`With args: ${mambaladeArgs.slice(1).join(" ")}`);
|
|
@@ -96521,7 +96526,7 @@ ${vulnAccPaths.join("\n")}`);
|
|
|
96521
96526
|
logger.debug("Done running mambalade");
|
|
96522
96527
|
const errors = stderr.split("\n").filter((line) => line.startsWith("ERROR:") && !/^ERROR: Excluded distribution/.test(line));
|
|
96523
96528
|
if (errors.length > 0)
|
|
96524
|
-
logger.
|
|
96529
|
+
logger.debug(`Error messages from mambalade:
|
|
96525
96530
|
${errors.join("\n")}`);
|
|
96526
96531
|
const result = JSON.parse(await readFile10(vulnsOutputFile, "utf-8"));
|
|
96527
96532
|
logger.debug("Analysis result:", JSON.stringify(result, null, 2));
|
|
@@ -96546,8 +96551,8 @@ ${errors.join("\n")}`);
|
|
|
96546
96551
|
packageInstallationStats: this.virtualEnvInfo.packageInstallationStats
|
|
96547
96552
|
// Including stats in all analysis diagnostics since we might discard the first one that actually installs it due to analysis timeout.
|
|
96548
96553
|
};
|
|
96549
|
-
logger.
|
|
96550
|
-
logger.
|
|
96554
|
+
logger.debug("Analysis diagnostics:");
|
|
96555
|
+
logger.debug(JSON.stringify(omit(diagnostics, this.numberAnalysesRun === 0 ? [] : ["packageInstallationStats"]), null, 2));
|
|
96551
96556
|
return {
|
|
96552
96557
|
type: "success",
|
|
96553
96558
|
diagnostics,
|
|
@@ -96592,21 +96597,25 @@ ${msg}`;
|
|
|
96592
96597
|
rootWorkingDir: projectTmpDir,
|
|
96593
96598
|
reachabilityAnalysisOptions: options
|
|
96594
96599
|
}, projectTmpDir);
|
|
96595
|
-
|
|
96596
|
-
|
|
96597
|
-
|
|
96598
|
-
const
|
|
96599
|
-
|
|
96600
|
-
|
|
96601
|
-
|
|
96602
|
-
|
|
96603
|
-
|
|
96604
|
-
|
|
96605
|
-
|
|
96606
|
-
|
|
96607
|
-
|
|
96608
|
-
|
|
96609
|
-
|
|
96600
|
+
try {
|
|
96601
|
+
await scanner.prepareVirtualEnv([]);
|
|
96602
|
+
const sitePackagesDir = scanner.virtualEnvInfo.virtualEnvPathToSitePackages;
|
|
96603
|
+
for (const dep of dependencies) {
|
|
96604
|
+
const dependencyDir = join20(sitePackagesDir, basename9(dep));
|
|
96605
|
+
logger.info(`Copying ${dep} to ${dependencyDir}`);
|
|
96606
|
+
await cp5(dep, dependencyDir, { recursive: true });
|
|
96607
|
+
fileMappings.set(dependencyDir, dep);
|
|
96608
|
+
}
|
|
96609
|
+
const result = await scanner.runAnalysis([vuln], MambaladeHeuristics.ALL_PACKAGES, false);
|
|
96610
|
+
if (result.type === "error")
|
|
96611
|
+
return { error: result.message, terminatedEarly: true };
|
|
96612
|
+
return {
|
|
96613
|
+
detectedOccurrences: transformSourceLocations2(app, fileMappings, result.computeDetectedOccurrences({ ...vuln, url: "" })),
|
|
96614
|
+
terminatedEarly: result.terminatedEarly
|
|
96615
|
+
};
|
|
96616
|
+
} finally {
|
|
96617
|
+
await scanner.cleanup();
|
|
96618
|
+
}
|
|
96610
96619
|
});
|
|
96611
96620
|
}
|
|
96612
96621
|
static async runOnDependencyChain(chain, vuln, options) {
|
|
@@ -96628,7 +96637,7 @@ ${msg}`;
|
|
|
96628
96637
|
const candidate = findBestWheel(packageName, version3, meta);
|
|
96629
96638
|
if (candidate) {
|
|
96630
96639
|
const filename = candidate.url.split("/").at(-1);
|
|
96631
|
-
if (await downloadFile(candidate.url, join20(tmpDir, filename)) && await execAndLogOnFailure(["unzip", filename], tmpDir))
|
|
96640
|
+
if (await downloadFile(candidate.url, join20(tmpDir, filename)) && await execAndLogOnFailure(["unzip", filename], tmpDir, void 0, "debug"))
|
|
96632
96641
|
return;
|
|
96633
96642
|
}
|
|
96634
96643
|
await exec(cmdt`uv pip install --python-platform ${uvPythonPlatform} --target ${tmpDir} --no-deps ${packageName}==${version3}`);
|
|
@@ -96677,6 +96686,8 @@ ${msg}`;
|
|
|
96677
96686
|
}
|
|
96678
96687
|
// public for testing only
|
|
96679
96688
|
async prepareVirtualEnv(packages) {
|
|
96689
|
+
if (!await hasUv())
|
|
96690
|
+
throw new Error("uv (https://docs.astral.sh/uv/) is missing, but is required for Python analysis");
|
|
96680
96691
|
const tmpDir = await createTmpDirectory("coana-python-analysis-venv");
|
|
96681
96692
|
const virtualEnvFolder = join20(tmpDir, ".venv");
|
|
96682
96693
|
const pythonExecutable = await this.vm.getPythonExecutableForWorkspace(this.projectDir, false);
|
|
@@ -96709,12 +96720,12 @@ ${msg}`;
|
|
|
96709
96720
|
return true;
|
|
96710
96721
|
const filename = candidate.url.split("/").at(-1);
|
|
96711
96722
|
if (await downloadFile(candidate.url, join20(tmpDir, filename)) && await execAndLogOnFailure(cmdt`${uvTool(pythonExecutable)} --from installer==0.7.0 python -m installer
|
|
96712
|
-
--no-compile-bytecode --prefix .venv ${filename}`, tmpDir)) {
|
|
96723
|
+
--no-compile-bytecode --prefix .venv ${filename}`, tmpDir, void 0, "debug")) {
|
|
96713
96724
|
installStats.installedUsingSpecializedInstallCommand.push(packageName);
|
|
96714
96725
|
return false;
|
|
96715
96726
|
}
|
|
96716
96727
|
} catch (e) {
|
|
96717
|
-
logger.
|
|
96728
|
+
logger.debug(`Failed to construct specialized install command for ${packageName}==${version3}`, e);
|
|
96718
96729
|
}
|
|
96719
96730
|
return true;
|
|
96720
96731
|
}, 4);
|
|
@@ -96723,13 +96734,7 @@ ${msg}`;
|
|
|
96723
96734
|
const installPipDeps = once3(async () => exec([...uvInstallBase, "pip", "wheel"]));
|
|
96724
96735
|
for (const { packageName, version: version3, requirement } of failingPackages) {
|
|
96725
96736
|
const requirementToInstall = requirement ?? `${packageName}==${version3}`;
|
|
96726
|
-
let success = await execAndLogOnFailure([
|
|
96727
|
-
...uvInstallBase,
|
|
96728
|
-
"--no-deps",
|
|
96729
|
-
"--no-binary",
|
|
96730
|
-
packageName,
|
|
96731
|
-
requirementToInstall
|
|
96732
|
-
]);
|
|
96737
|
+
let success = await execAndLogOnFailure([...uvInstallBase, "--no-deps", "--no-binary", packageName, requirementToInstall], void 0, void 0, "debug");
|
|
96733
96738
|
if (!success) {
|
|
96734
96739
|
await installPipDeps();
|
|
96735
96740
|
success = await execAndLogOnFailure(
|
|
@@ -96738,7 +96743,9 @@ ${msg}`;
|
|
|
96738
96743
|
cmdt`.venv/bin/python -m pip
|
|
96739
96744
|
--no-input --require-virtualenv --disable-pip-version-check --no-cache-dir --isolated install
|
|
96740
96745
|
--no-deps --ignore-requires-python --no-compile --no-binary ${packageName} ${requirementToInstall}`,
|
|
96741
|
-
tmpDir
|
|
96746
|
+
tmpDir,
|
|
96747
|
+
void 0,
|
|
96748
|
+
"debug"
|
|
96742
96749
|
);
|
|
96743
96750
|
}
|
|
96744
96751
|
(success ? installStats.installedWithoutOnlyBinary : installStats.failedToInstall).push(packageName);
|
|
@@ -96829,7 +96836,7 @@ async function getPythonInterpreter() {
|
|
|
96829
96836
|
}
|
|
96830
96837
|
async function setupMambalade() {
|
|
96831
96838
|
const venvDir = await createTmpDirectory("mambalade-venv");
|
|
96832
|
-
logger.
|
|
96839
|
+
logger.debug("Creating Mambalade virtual environment");
|
|
96833
96840
|
const pythonInterpreter = await getPythonInterpreter();
|
|
96834
96841
|
await exec(cmdt`${pythonInterpreter} -SIm venv ${venvDir}`);
|
|
96835
96842
|
const mambaladeWheelsPath = join20(COANA_REPOS_PATH(), "mambalade", "dist");
|
|
@@ -96837,11 +96844,12 @@ async function setupMambalade() {
|
|
|
96837
96844
|
const mambaladeWheels = wheelFiles.filter((f2) => f2.endsWith(".whl")).map((f2) => join20(mambaladeWheelsPath, f2));
|
|
96838
96845
|
if (!mambaladeWheels.length)
|
|
96839
96846
|
throw new Error(`No mambalade wheel files found in ${mambaladeWheelsPath}`);
|
|
96840
|
-
logger.
|
|
96847
|
+
logger.debug(`Installing mambalade wheels: ${mambaladeWheels.join(", ")}`);
|
|
96841
96848
|
await exec(cmdt`${venvDir}/bin/pip install --no-deps ${mambaladeWheels}`);
|
|
96842
|
-
logger.
|
|
96849
|
+
logger.debug("Mambalade virtual environment setup complete");
|
|
96843
96850
|
return venvDir;
|
|
96844
96851
|
}
|
|
96852
|
+
var hasUv = once3(async () => !(await execNeverFail("which uv")).error);
|
|
96845
96853
|
|
|
96846
96854
|
// dist/whole-program-code-aware-vulnerability-scanner/python/phantom-deps.js
|
|
96847
96855
|
var { uniq: uniq8 } = import_lodash15.default;
|
|
@@ -96937,8 +96945,7 @@ var PipAnalyzer = class {
|
|
|
96937
96945
|
this.heuristic = MambaladeHeuristics.createOnlyVulnPathPackagesHeuristic(this.preInstalledDepInfos);
|
|
96938
96946
|
}
|
|
96939
96947
|
prepareScanner = once4(async () => {
|
|
96940
|
-
|
|
96941
|
-
await this.scanner.prepareDependencies(this.preInstalledDepInfos, vulnerabilities.filter((v) => Array.isArray(v.vulnerabilityAccessPaths)), this.heuristic);
|
|
96948
|
+
await this.scanner.prepareDependencies(this.preInstalledDepInfos, this.state.vulnerabilities.filter((v) => Array.isArray(v.vulnerabilityAccessPaths)), this.heuristic);
|
|
96942
96949
|
return this.scanner;
|
|
96943
96950
|
});
|
|
96944
96951
|
async runPhantomDependencyAnalysis() {
|
|
@@ -96970,14 +96977,13 @@ function getPreInstalledDepInfos(workspaceData) {
|
|
|
96970
96977
|
}));
|
|
96971
96978
|
} else {
|
|
96972
96979
|
workspaceData.type;
|
|
96973
|
-
|
|
96980
|
+
return workspaceData.data.artifacts.filter((a2) => {
|
|
96974
96981
|
if (!a2.version) {
|
|
96975
96982
|
logger.warn(`Artifact ${a2.name} has no version information`);
|
|
96976
96983
|
return false;
|
|
96977
96984
|
}
|
|
96978
96985
|
return true;
|
|
96979
|
-
});
|
|
96980
|
-
return artifactsWithVersion.map((a2) => ({ packageName: a2.name, version: a2.version }));
|
|
96986
|
+
}).map(({ name: name2, version: version3 }) => ({ packageName: name2, version: version3 }));
|
|
96981
96987
|
}
|
|
96982
96988
|
}
|
|
96983
96989
|
|
|
@@ -97168,6 +97174,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97168
97174
|
const enqueueWithoutSplitting = !allowSplitInBuckets && initialBucketContainingAllVulns && !state.reachabilityAnalysisOptions.timeoutInSeconds;
|
|
97169
97175
|
await sendErrorAnalysisMetadata(result.message, !allowSplitInBuckets && isLastHeuristic(bucket.heuristic.name) && !enqueueWithoutSplitting, !allowSplitInBuckets);
|
|
97170
97176
|
if (enqueueWithoutSplitting) {
|
|
97177
|
+
logger.info("Analysis failed, retrying different configuration.");
|
|
97171
97178
|
enqueueBucket(vulnDepIdentifiers);
|
|
97172
97179
|
return;
|
|
97173
97180
|
}
|
|
@@ -97177,6 +97184,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97177
97184
|
}
|
|
97178
97185
|
}
|
|
97179
97186
|
if (allowSplitInBuckets) {
|
|
97187
|
+
logger.info("Analysis failed, rerunning analysis multiple times with fewer vulnerabilities per run.");
|
|
97180
97188
|
const middle = Math.floor(vulnDepIdentifiers.length / 2);
|
|
97181
97189
|
enqueueBucket(vulnDepIdentifiers.slice(0, middle));
|
|
97182
97190
|
enqueueBucket(vulnDepIdentifiers.slice(middle));
|
|
@@ -97279,9 +97287,6 @@ function getHeuristicFromName(state, heuristicName, ecosystem) {
|
|
|
97279
97287
|
if (ecosystem === "NPM") {
|
|
97280
97288
|
return heuristics[heuristicName];
|
|
97281
97289
|
} else if (ecosystem === "PIP") {
|
|
97282
|
-
if (state.workspaceData.type !== "coana") {
|
|
97283
|
-
throw new Error("MambaladeHeuristics only supports Coana data for analysis");
|
|
97284
|
-
}
|
|
97285
97290
|
if (heuristicName in MambaladeHeuristics)
|
|
97286
97291
|
return MambaladeHeuristics[heuristicName];
|
|
97287
97292
|
else if (heuristicName === "ONLY_VULN_PATH_PACKAGES") {
|
|
@@ -97517,16 +97522,16 @@ function canDismissVulnerability(phantomDependencies, vulnChainDetails) {
|
|
|
97517
97522
|
const recHelper = (nodeIdentifier, depth) => {
|
|
97518
97523
|
if (depth === 0)
|
|
97519
97524
|
return void 0;
|
|
97520
|
-
const
|
|
97525
|
+
const parents3 = parentsMap.get(nodeIdentifier).filter((parent2) => parent2 !== ROOT_NODE_STR);
|
|
97521
97526
|
const thisReachabilityPrecomp = nodeIdentifier === vulnNodeIdentifier ? "Reachable" : vulnChainDetails.transitiveDependencies[nodeIdentifier].reachabilityPrecomp;
|
|
97522
97527
|
if (!thisReachabilityPrecomp)
|
|
97523
97528
|
return void 0;
|
|
97524
97529
|
const thisMayReachVulnerableNode = ["Reachable", "Unknown"].includes(thisReachabilityPrecomp);
|
|
97525
|
-
if (
|
|
97530
|
+
if (parents3.length === 0 && thisMayReachVulnerableNode) {
|
|
97526
97531
|
canDismiss = false;
|
|
97527
97532
|
}
|
|
97528
|
-
if (
|
|
97529
|
-
const parentsReachabilityPrecomp =
|
|
97533
|
+
if (parents3) {
|
|
97534
|
+
const parentsReachabilityPrecomp = parents3.map((p) => recHelper(p, depth - 1));
|
|
97530
97535
|
if (parentsReachabilityPrecomp.some((reachabilityPrecomp) => !reachabilityPrecomp) && thisMayReachVulnerableNode) {
|
|
97531
97536
|
canDismiss = false;
|
|
97532
97537
|
}
|
|
@@ -97555,6 +97560,7 @@ var dashboardAPI2 = new DashboardAPI(process.env.SOCKET_MODE === "true", process
|
|
|
97555
97560
|
async function runReachabilityAnalysis(state) {
|
|
97556
97561
|
const projectDir = resolve15(state.subprojectDir, state.workspacePath);
|
|
97557
97562
|
const ecosystem = state.workspaceData.data.type;
|
|
97563
|
+
logger.info(`Preparing for running reachability analysis for project at "${relative6(state.rootWorkingDir, projectDir) || "."}" (${ecosystem})`);
|
|
97558
97564
|
const constructor = ecosystemAnalyzer[ecosystem];
|
|
97559
97565
|
if (!constructor)
|
|
97560
97566
|
throw Error(`No analyzer associated with ecosystem ${ecosystem}`);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/external/@coana-tech/cli/repos/coana-tech/mambalade/dist/mambalade-0.3.11-py3-none-any.whl
CHANGED
|
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.102",
|
|
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.5",
|
|
90
90
|
"@cyclonedx/cdxgen": "11.6.0",
|
|
91
91
|
"@dotenvx/dotenvx": "1.49.0",
|
|
92
92
|
"@eslint/compat": "1.3.2",
|