← Lab /Software

JsVul provides a curated JavaScript/TypeScript vulnerable-fixed code dataset

The authors claim JsVul is a high-quality dataset that improves vulnerability detection model training for JavaScript and TypeScript

Software arXiv 29 Sep 2026 Benchmark Prototype evidence

Published as “A Function-level Dataset of Vulnerable and Fixed Source Code in JavaScript and TypeScript”

Why it matters

Researchers can train and evaluate vulnerability detection models on a high-quality, language-specific dataset that mitigates temporal bias and noise.

Summary

JsVul delivers a curated function-level dataset of 2,039 vulnerable and 19,862 non-vulnerable JavaScript/TypeScript functions, and fine-tuned models achieve up to 60 % accuracy (e.g., Qwen2.5-Coder-7B-Instruct with 0.6030 accuracy). The authors show that language-specific preprocessing (minified-code filtering, ESLint/Prettier normalization) reduces noise and yields a learnable signal, as confirmed by baseline model performance. Evidence is based on a real-world collection of fixing commits from seven sources, with manual verification of duplicates and a chronological split to avoid temporal bias.

What they found 3

  1. The final curated dataset contains 2,039 vulnerable and 19,862 non-vulnerable functions.

    “2,039 / 19,862 final_po”

  2. Fine-tuned CodeBERT achieves perfect recall (1.0000) but low precision (0.5032) on the JsVul test set.

    “CodeBERT Fine-tuned 0.5587 0.5032 1.0000 0.5063”

  3. Syntax normalization reduced the average number of lines modified per commit, confirming removal of non-semantic noise.

    “The normalization process resulted in a net reduction in the average number of lines modified per commit”

Caveats 3

  • CodeBERT’s perfect recall (1.0000) paired with low precision (0.5032) indicates that the dataset may still contain ambiguous signals that lead to many false positives.
  • We manually inspected 25% of randomly selected changes to ensure the code was not modified semantically.
  • We recommend adhering to the provided temporal splits (80% training, 10% validation, 10% testing) to accurately simulate vulnerability forecasting.

What’s new here 4

  • Provides a function-level dataset specifically for JavaScript/TypeScript, unlike prior multi-language resources.
  • Applies language-aware syntax normalization and minified-code heuristics to filter out non-semantic changes.
  • Implements a multi-stage deduplication pipeline that resolves commit and function duplicates across sources.
  • Offers a chronologically ordered split to prevent temporal bias in vulnerability forecasting.