muaddib-scanner 2.10.51 → 2.10.52
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/package.json +1 -1
- package/src/sandbox/index.js +29 -0
package/package.json
CHANGED
package/src/sandbox/index.js
CHANGED
|
@@ -487,6 +487,35 @@ async function runSingleSandbox(packageName, options = {}) {
|
|
|
487
487
|
if (f.type === 'canary_exfiltration') return s + 50;
|
|
488
488
|
return s;
|
|
489
489
|
}, score + preloadScore));
|
|
490
|
+
|
|
491
|
+
// ── Prevent false CLEAN when sandbox couldn't fully analyze ──
|
|
492
|
+
// If score is 0 but install or entry point failed, mark INCONCLUSIVE
|
|
493
|
+
// so downstream (monitor, webhook) doesn't treat this as confirmed benign.
|
|
494
|
+
if (finalScore === 0) {
|
|
495
|
+
const entryError = report.entrypoint_output &&
|
|
496
|
+
/\[ENTRY_ERROR\]/.test(report.entrypoint_output);
|
|
497
|
+
const installNotFound = report.exit_code !== 0 &&
|
|
498
|
+
report.exit_code !== undefined &&
|
|
499
|
+
report.install_output &&
|
|
500
|
+
/ERR! (?:code E404|404|code ETARGET|code ERESOLVE)/.test(report.install_output);
|
|
501
|
+
if (entryError || installNotFound) {
|
|
502
|
+
const reason = installNotFound
|
|
503
|
+
? `npm install failed (exit ${report.exit_code})`
|
|
504
|
+
: 'Entry point require() failed';
|
|
505
|
+
findings.push({
|
|
506
|
+
type: 'sandbox_incomplete',
|
|
507
|
+
severity: 'MEDIUM',
|
|
508
|
+
detail: `${reason} — behavioral analysis incomplete`,
|
|
509
|
+
evidence: ((installNotFound ? report.install_output : report.entrypoint_output) || '').substring(0, 300)
|
|
510
|
+
});
|
|
511
|
+
resolve({
|
|
512
|
+
score: -1, severity: 'INCONCLUSIVE', findings, raw_report: report,
|
|
513
|
+
suspicious: false, inconclusive: true
|
|
514
|
+
});
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
490
519
|
const severity = getSeverity(finalScore);
|
|
491
520
|
const result = { score: finalScore, severity, findings, raw_report: report, suspicious: finalScore > 0 };
|
|
492
521
|
|