← Lab /Security & privacy

JavaScript preprocessing raises LLM detection coverage to near 100%

CASHEWS increases analysis coverage to 98.8-100% and reduces false-negative rate by up to 18.6 points

Security & privacy arXiv 16 Sep 2026 Method Prototype evidence

Published as “CASHEWS: Source Preprocessor for LLM-based Malicious Package Detection”

Why it matters

Enables practical, registry-wide LLM-based scanning of npm packages with higher coverage and lower cost, making large-file supply-chain attacks easier to detect.

Summary

CASHEWS raises LLM-based malicious npm package detection coverage to 98.8-100% and cuts the false-negative rate by up to 18.6 percentage points on large files, while keeping preprocessing cheap (median 30 s) and saving about 34.6% of analysis cost. The evidence comes from experiments on 512 large package files across two detector pipelines and three LLMs; the paper also notes that some settings increase false positives and that benefits diminish on smaller files.

What they found 2

  1. Coverage increase to near-full levels

    “Across 512 large package files, two scanner types, and three LLMs, CASHEWS increases analysis coverage from 69.1-85.7% to 98.8-100% and reduces the false-negative rate by up to 18.6 percentage points.”

  2. Net cost saving of 34.6% on large files

    “CASHEWS reduces modeled input-token cost by 36.6% and by 34.6% if considering preprocessing cost.”

Caveats 5

  • The Top-3 fallback improves coverage to 100% but raises the false-positive rate by up to 1.7 percentage points.
  • On the full dataset, CASHEWS can increase false-negative rate (e.g., GPT-5.6 Luna rises by 0.7 pp for Zero-Shot and 3.6 pp for Multi-Stage), indicating it is mainly beneficial for large files.
  • CASHEWS is primarily designed for large files and deploying it on all package files would impact negatively both cost and classification.
  • The decoding loop may sometimes fail either because it times out or it does not support a certain obfuscation technique.
  • Slice step is skipped for about 72.7% of large files (66% of all files).

What’s new here 4

  • A detector-agnostic JavaScript preprocessor that deobfuscates code before LLM analysis
  • Extraction of bundled modules and dynamically executed code to isolate relevant units
  • Conservative backward slicing from malicious sinks to prune irrelevant code
  • Abbreviation of long literals and identifiers to dramatically reduce token count