DatabricksDatabricks Threat ResearchProblem & solution
Closing the Binary Blind Spot: Domain-Knowledge Injection for LLM Malware Triage in npm Packages
Summary
Supply chain attacks on the npm registry are growing, and packages that bundle a binary payload are rare but disproportionately hard for LLMs to triage. The authors built a scanner that combines static analysis with LLM reasoning and introduced capability profiles, which encode malicious techniques as weighted conditions injected into the prompt before the model decides. They tested nine models across seven providers on five adversarial payload types, including credential stealers and reverse shells, at varying obfuscation levels. Without profiles, the budget-tier models failed to reach a malicious verdict on 50 percent of tests, with failures following distinct model-specific patterns rather than random error. With profiles enabled, the failure rate dropped to 4 percent, and 91 percent of prior failures recovered to a detection.
Context
Supply chain attacks on the npm registry have grown in volume and sophistication. Among confirmed malware, 3.8% of package-versions bundle a binary, yet these packages fail to reach a malicious verdict more than twice as often as source-only ones. Prior work instruction-tunes models on expert data, which cannot reach closed models and requires retraining. The authors instead supply expertise at inference via pre-computed static evidence placed in the prompt.
Approach / What changed
Capability profiles are declarative playbooks that encode one malicious technique as a set of weighted conditions over static evidence. When a threshold is reached, the engine injects a structured summary (~1,800 tokens) into the prompt before the model reasons. The model may override the profile. The profiles cover source and binary techniques across npm and PyPI.
Takeaways
Binary-bearing npm packages are rare (3.8% of confirmed malware) but fail to reach a malicious verdict more than twice as often as source-only packages (14.4% vs 6.2%).
Without capability profiles, budget LLMs failed on 50% of binary payload tests, with failures following model-specific patterns rather than random error.
Injecting capability profiles into the prompt reduced budget-tier failures from 50% to 4%, recovering 91% of prior detection failures.
FAQ
What are capability profiles?
Capability profiles are declarative playbooks that encode one malicious technique as weighted conditions over static evidence. When a threshold is reached, a structured summary is injected into the prompt before the model reasons, and the model may override the profile.
How much did capability profiles improve detection?
Without profiles, budget models failed on 50% of tests; with profiles, failures dropped to 4%. 91% of prior failures recovered to a detection.
Why are binary-bearing packages harder to triage?
A stripped, opaque binary carries no source for tools to read and can be nested within clean source and metadata, potentially skewing an LLM towards a benign verdict. Across OSV-confirmed npm malware, binary-bearing packages fail to reach a malicious verdict more than twice as often as source-only ones.
Source and freshness
- Source
- databricks.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.