Repository navigation
fix(malware-scan): cut false positives from vendor bundles and require() calls - #30
Merged
Merged
Conversation
…e() calls WHITESPACE_PADDING is now low outside config files when nothing code-like is hidden after the padding and either the hidden text is short or the line is a comment (aligned JSDoc/tables in vendor bundles and .d.ts files, e.g. Elementor's " * @PARAM {Object}<155 spaces>options"). Low is hidden by default. It stays high when code-like tokens (require(, global[, eval(, fromCharCode, _$_xxxx, URLs) or 200+ characters of non-comment text are hidden, and always high in config files. GLOBAL_REQUIRE no longer matches storing a require() call result (global.performance = require("perf_hooks")); it still matches assigning the require function itself (global['r'] = require), as the payload does. Checked against 10 real infected samples (all still 4-6 high, same rules) and 3 false-positive sets (Elementor AI bundles, Figma .d.ts, Moodle ogv.js WASM decoders: 20 high -> 0 high). kdn-website: 12 high -> 0 high. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
Author
|
Made some changes to remove some white listing false cases - came from KDN website |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cuts false HIGH findings from the malware scanner without weakening detection of the real payload. On kdn-website the scanner reported 12 HIGH, all from JSDoc comments in Elementor's bundled AI scripts, such as
ai-admin.js:16199:That's formatting inside a comment, not hidden code.
Changes (
malware-scan/scan_malicious.py)WHITESPACE_PADDING: now low (hidden by default) outside config files when nothing code-like follows the padding and either:*,//,/*,#).It stays high when code-like tokens are hidden (
require(,global[/global.,eval(,Function(,fromCharCode,child_process,_$_xxxx,import(, URLs,atob(,Buffer.from), or 200+ characters of non-comment text. It's always high in config files (*.config.*), where the payload is injected.GLOBAL_REQUIRE: no longer matches storing arequire()call result (global.performance = require("perf_hooks"), found in Moodle's ogv.js WASM decoders). It still matches assigning therequirefunction itself (global['r'] = require,global[_$_a291[0x11]] = require), as the payload does.malware-scan/README.md: rules table updated.Verification (text-only; no sample executed)
esbuild.config.js; sankalptaru-websitebuild-js.js+ rank-mathwebpack.config.js; sankalptaru-hugereact-native.config.js; sankalptaru-mobilemetro.config.js; Internal-intelligence-platformserver.js+postcss.config.mjs; paipostcss.config.mjs; volunteer-moduleindex.js; sparklegacypostcss.config.js)plugin-api-standalone.d.tsogv-decoder-*-wasm.jsSynthetic edge cases:
*/require(...)tailwind.config.jsglobal.o=...;var _$_ab12)After merge
cc-malware-scanskill installed should re-run the install block to get the new scanner.🤖 Generated with Claude Code