Repository navigation
fix(scan): no malware flag for one env variable or a minified-line sink - #298
Merged
Merged
Conversation
js-environment-exfiltration excluded process.env.X but not process.env['X'] or process.env?.X, so JSON.stringify(process.env['KIMI_CODE_CHANNEL'] ?? '') in a build config read as serialising the whole environment. js-encoded-payload-execution checked its CODE_SINK requirement against a line-based window; on a minified bundle that window is the whole program, and an atob() joined an unrelated constructor 30 KB away. Lines over 1000 chars now use the 200 chars around the match as context. eval(atob(x)) on a minified line still fires. Both flagged MoonshotAI/kimi-code as malware on w3bs.org/packages. Verified on its real source: 3 indicators -> 0, all other counts unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan18 finding(s) HIGH/CRITICAL: 1 | MEDIUM: 9 | LOW: 8
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Two false malware indicators that flagged MoonshotAI/kimi-code on w3bs.org/packages (w3bs.org now scans every catalog package with ThreatCrush, profullstack/w3bs.org#13).
process.env.Xbut notprocess.env['X']/process.env?.X.JSON.stringify(process.env['KIMI_CODE_CHANNEL'] ?? '')in a tsdowndefineread as serialising the whole environment.requiresrule): context is a line window, so on a minified bundle it is the whole program, and anatob()joined an unrelatedconstructorfar away. Lines over 1000 chars now use the 200 chars around the match.Paired tests in
false-positives.test.ts: each quiet case has a still-fires neighbour (JSON.stringify(process.env),{...process.env},eval(atob(x))inside a minified line). 364/364 scan tests pass.Real input: kimi-code HEAD went from 3 malware indicators to 0, with all other counts unchanged (high 4, medium 71, low 80).
🤖 Generated with Claude Code