← Lab /Software

Checking for source attribution blocks 87.7-99.9% of malicious packages

Source attribution checks can prevent 87.7 to 99.9 percent of malicious packages

Software arXiv 20 Oct 2026 Measurement Simulation evidence

Published as “Sign Here: Attributing a Source for a More Trustworthy Software Supply Chain”

Why it matters

Requiring clear source attribution could dramatically reduce supply-chain malware but would need ecosystem-wide adoption to avoid excessive false alerts.

Summary

Building from source using source attribution can prevent up to 99.9% of malicious packages, but only 11.8% of malicious packages provide an attributable source and the method suffers a false-positive rate as high as 35.3%. The study processed 47,066 malicious and 16,569 benign packages from npm and PyPI, extracting source links and attempting builds. Recall is near-perfect (0.999) for the authentic-source approach, while precision is lower due to many benign packages lacking proper attribution. The paper compares this technique to three scanners (malcontent, grype, trivy) and shows combined configurations can improve recall and F1 score.

What they found 4

  1. Only 11.8% of malicious packages attribute a source that meets the criteria

    “The minority of malicious packages, 11.8 percent, attributed at least one source that met our criteria.”

  2. 6.7% of the malicious sample has a valid source URL

    “56.6 percent of malicious packages with attributed sources and 6.7 percent of the malicious sample.”

  3. Authentic source approach achieves near-perfect recall of 0.999

    “All three methods have a high recall, notably with the authentic source approach with a near perfect recall of 0.999.”

  4. Source-attribution method can prevent up to 99.9% of malware while incurring up to 35.3% false-positive rate

    “Our approach can optimistically prevent 99.9 percent of malware and realistically between 88.1 to 93.3 percent with minimal effort. However, our approach remains fairly noisy with a best case FPR of 35.3 percent due to lack of proper attribution by benign packages.”

Caveats 7

  • Only a small minority of malicious packages provide any source attribution, limiting the practical coverage of the approach
  • False-positive rates are high (up to 35.3%) because many benign packages lack proper attribution
  • Building from source fails for many packages due to missing build files, dependencies, or repository issues
  • Packages pulled from npm and PyPI are assumed to be benign; mislabeled packages could inflate false positive rates (Construct Threats to Validity)
  • Our method may miss valid sources because some repositories do not tag releases or use custom tagging patterns (Construct Threats to Validity)
  • File-diff comparison is a surface-level check and does not account for build system or compiler differences (Construct Threats to Validity)
  • Missing packages and repositories during analysis caused incomplete data (Internal Threats to Validity)

What’s new here 3

  • Scale up to 47k malicious packages and over 4M registry snapshots for source attribution analysis
  • Introduce building from source as a malware-prevention heuristic and evaluate its recall and false-positive characteristics
  • Compare source-attribution based detection against leading static analysis scanners and explore combined configurations