CASHEWS: Source Preprocessor for LLM-based Malicious Package Detectionnew
CASHEWS preprocessor boosts LLM-based malicious npm package detection, raising coverage to 98.8-100% and cutting false negatives by up to 18.6 points.
Researchers present CASHEWS, a JavaScript preprocessor for LLM-based malicious package detection that deobfuscates code iteratively, extracts bundled modules and dynamically executed code, identifies malicious sinks, and computes backward slices to produce compact detector input. Threat actors evade LLM detectors by exploiting limited context windows with high token-density obfuscation and by bundling malicious code with benign packages, as seen in supply-chain attacks such as Shai-Hulud. Across 512 large package files, two scanner types, and three LLMs, CASHEWS raised analysis coverage from 69.1-85.7% to 98.8-100% and reduced false-negative rates by up to 18.6 percentage points. Median preprocessing time is 30 seconds while net analysis cost drops 34.6%.