muaddib-scanner 2.10.74 → 2.10.77
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/shared/bundle-detect.js +32 -4
package/package.json
CHANGED
|
@@ -39,16 +39,37 @@
|
|
|
39
39
|
// fesm*/, esm/, esm5/, esm2015/, esm2020/, bundles/, assets/, chunks/, _app/)
|
|
40
40
|
// - Basename suffixes (.min.js, .bundle.js, .umd.js, .esm.js, .es.js,
|
|
41
41
|
// .common.js, .max.js, .prod.js, .production.js, + .cjs / .mjs variants)
|
|
42
|
+
// - Double-extension bundler outputs (index.cjs.js, index.esm.js, index.umd.js
|
|
43
|
+
// at package root — common pattern for @equinor/*, tsdx/rollup bundled libs)
|
|
42
44
|
// - Hash-suffixed chunks (esbuild/vite/rollup/webpack convention):
|
|
43
45
|
// `basename-[a-f0-9]{6,16}.js|mjs|cjs`
|
|
46
|
+
// - Tool-specific subdirectories that contain vendored bundles (v2.10.75):
|
|
47
|
+
// * `lib/[name]Bundle*/` — Playwright-style `lib/utilsBundleImpl/`
|
|
48
|
+
// * `.yarn/releases/` — vendored yarn/pnpm releases shipped in template packages
|
|
49
|
+
// * `sys/(node|browser|deno)/` — Stencil-style platform-specific bundle
|
|
50
|
+
// * `compiled/` — SWC/Stencil compiled output
|
|
51
|
+
// * `typings/` — only if matches a .d.ts file (defensive)
|
|
44
52
|
const BUNDLE_PATH_RE = new RegExp(
|
|
45
|
-
// Path prefix group
|
|
53
|
+
// Path prefix group (directories that almost always contain bundled output)
|
|
46
54
|
'(?:^|[/\\\\])' +
|
|
47
|
-
'(?:dist|build|out|output|browser|bundles|assets|chunks|_app|' +
|
|
55
|
+
'(?:dist|build|out|output|browser|bundles|assets|chunks|_app|compiled|' +
|
|
48
56
|
'lib[/\\\\]bundled|fesm\\d*|esm|esm5|esm2015|esm2020)' +
|
|
49
57
|
'[/\\\\]' +
|
|
50
|
-
// OR
|
|
51
|
-
|
|
58
|
+
// OR Playwright-style lib/xxxBundle*/ (e.g. lib/utilsBundleImpl/, lib/mcpBundleImpl/,
|
|
59
|
+
// lib/transform/babelBundleImpl.js) — matches the directory form
|
|
60
|
+
// `lib/.../xxxBundleImpl/index.js` and the flat form `lib/.../xxxBundleImpl.js`
|
|
61
|
+
// at any depth under lib/.
|
|
62
|
+
'|(?:^|[/\\\\])lib[/\\\\][^\\n]*[Bb]undle[\\w-]*(?:[/\\\\]|\\.(?:m?js|cjs)$)' +
|
|
63
|
+
// OR vendored yarn/pnpm releases (@backstage/create-app templates etc.)
|
|
64
|
+
'|(?:^|[/\\\\])\\.yarn[/\\\\]releases[/\\\\]' +
|
|
65
|
+
'|(?:^|[/\\\\])\\.pnpm[/\\\\](?:releases|dist)[/\\\\]' +
|
|
66
|
+
// OR Stencil-style sys/(node|browser|deno) containing compiled platform bundles
|
|
67
|
+
'|(?:^|[/\\\\])sys[/\\\\](?:node|browser|deno)[/\\\\]' +
|
|
68
|
+
// OR basename suffix group (single extension)
|
|
69
|
+
'|\\.(?:min|bundle|umd|esm|es|cjs|common|max|prod|production|iife)\\.(?:m?js|cjs)$' +
|
|
70
|
+
// OR double-extension bundler outputs at root: index.cjs.js, index.esm.js, etc.
|
|
71
|
+
// Anchored by `^` or path separator + basename with exactly the double extension.
|
|
72
|
+
'|(?:^|[/\\\\])[\\w-]+\\.(?:cjs|esm|umd|es|iife|min)\\.js$' +
|
|
52
73
|
// OR hash-suffixed chunk
|
|
53
74
|
'|(?:^|[/\\\\])[\\w-]+[-.][a-f0-9]{6,16}\\.(?:m?js|cjs)$',
|
|
54
75
|
'i'
|
|
@@ -131,6 +152,13 @@ function hasBundleVetoSignal(threats, targetFile) {
|
|
|
131
152
|
if (!Array.isArray(threats) || !targetFile) return false;
|
|
132
153
|
for (const t of threats) {
|
|
133
154
|
if (t.file !== targetFile) continue;
|
|
155
|
+
// v2.10.75 fix: a LOW severity threat should never block the bundle downgrade
|
|
156
|
+
// of unrelated co-occurring threats. Typical regression case: a locale file
|
|
157
|
+
// (locales/fa-IR/*.js) contains `unicode_invisible_injection` at LOW (already
|
|
158
|
+
// downgraded by `isLocaleFile` in obfuscation.js) but also contains bundler
|
|
159
|
+
// helpers. Before this fix, the LOW unicode signal vetoed the bundle downgrade
|
|
160
|
+
// of the other threats, so the package scored higher than pre-v2.10.74.
|
|
161
|
+
if (t.severity === 'LOW') continue;
|
|
134
162
|
if (VETO_TYPES.has(t.type)) return true;
|
|
135
163
|
if (t.type === 'env_access' && t.message && SENSITIVE_ENV_RE.test(t.message)) {
|
|
136
164
|
return true;
|