correctover-scan 3.2.3 → 3.3.1
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/core/bundle-scanner.js +30 -0
- package/index.js +1 -1
- package/package.json +1 -1
package/core/bundle-scanner.js
CHANGED
|
@@ -289,6 +289,36 @@ const CHECKS = [
|
|
|
289
289
|
run: (f) => semiAuto(f, /fallback[_-]?model|retry[A-Z]|backoff|maxRetries/i,
|
|
290
290
|
'retry/fallback 信号', 'error-handling'),
|
|
291
291
|
},
|
|
292
|
+
|
|
293
|
+
{
|
|
294
|
+
id: 'entropy-rng', category: 'C2 输入验证', name: '弱熵 RNG 指纹 (code)', severity: 'critical', aisvs: 'C2.4',
|
|
295
|
+
fix: '密钥/盐/IV/nonce 生成路径改用 CSPRNG(crypto.getRandomValues / randomBytes / randomUUID),旧密钥必须轮换——升级不自愈',
|
|
296
|
+
run: (f) => {
|
|
297
|
+
const findings = [];
|
|
298
|
+
const pats = [
|
|
299
|
+
{ re: /0x3ade68b1|0x3ade67b7|0x9069\s*\*\s*\(m_z/g, msg: 'crypto-js 3.x WordArray.random 固定常量弱 PRNG(CVE-2026-71851 家族)', sev: 'fail' },
|
|
300
|
+
{ re: /rng_psize|Arcfour|new SecureRandom\s*\(/g, msg: 'jsbn SecureRandom 池指纹——Math.random 播种面(CVE-2026-73567 家族)', sev: 'warn' },
|
|
301
|
+
{ re: /\b(?:key|private|secret|token|salt|nonce|seed|iv|password)\b[^\n]{0,40}Math\.random|Math\.random[^\n]{0,40}\b(?:key|private|secret|token|salt|nonce|seed|iv)\b/gi, msg: 'Math.random 出现在密钥/盐/令牌语义邻域', sev: 'fail' },
|
|
302
|
+
{ re: /new Date\(\)\.getTime\(\)[^\n]{0,30}(?:token|key|id|seed)|(?:token|key|id|seed)[^\n]{0,30}new Date\(\)\.getTime\(\)/gi, msg: '毫秒时间戳作为 token/seed 来源', sev: 'warn' },
|
|
303
|
+
{ re: /uuid[^\n]{0,20}Math\.random|Math\.random[^\n]{0,20}uuid/gi, msg: 'uuid 库 Math.random 形态(pre-v4 实现)', sev: 'warn' },
|
|
304
|
+
];
|
|
305
|
+
const hasCsprng = /getRandomValues|randomBytes|randomUUID|crypto\.randomInt/.test(f.text);
|
|
306
|
+
for (const p of pats) {
|
|
307
|
+
const re = new RegExp(p.re.source, p.re.flags);
|
|
308
|
+
let m, count = 0, firstLine = 0;
|
|
309
|
+
while ((m = re.exec(f.text)) !== null) {
|
|
310
|
+
count++;
|
|
311
|
+
if (!firstLine) firstLine = f.text.slice(0, m.index).split('\n').length;
|
|
312
|
+
if (count > 20) break;
|
|
313
|
+
}
|
|
314
|
+
if (count > 0) {
|
|
315
|
+
const sev = (hasCsprng && p.sev === 'warn') ? 'info' : p.sev;
|
|
316
|
+
findings.push(mkFinding(f, firstLine, sev, p.msg + ' x' + count, { checkId: 'entropy-rng' }));
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return findings;
|
|
320
|
+
},
|
|
321
|
+
},
|
|
292
322
|
{
|
|
293
323
|
id: 'output-validation', category: 'C7 输出控制', name: '输出截断/过滤 (code, 半自动)', severity: 'medium', aisvs: 'C7.1',
|
|
294
324
|
fix: '确认输出截断/HTML转换不会丢弃安全相关内容(信号可见,过滤语义需人工确认)',
|
package/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const { recordCall, getUpgradeMessage } = require('./core/license');
|
|
|
15
15
|
const skillpay = require('./core/skillpay');
|
|
16
16
|
const { formatHTMLReport, normalizeConfigFindings, normalizeBundleFindings, failHint } = require('./core/report');
|
|
17
17
|
|
|
18
|
-
const VERSION = '3.
|
|
18
|
+
const VERSION = '3.3.1';
|
|
19
19
|
const PRODUCT = 'correctover-scan';
|
|
20
20
|
const JS_EXT = new Set(['.js', '.mjs', '.cjs', '.ts']);
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "correctover-scan",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "Correctover Security Scanner — CCS audit for MCP configurations AND published JS bundles/npm packages. Detects hardcoded secrets, RCE, SSRF, credential hijacking against OWASP AISVS 1.0.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|