A Function-level Dataset of Vulnerable and Fixed Source Code in JavaScript and TypeScript
Abstract
JavaScript and TypeScript are widely used in modern web development, making their security critical; however, automated vulnerability detection is often constrained by the availability of high-quality training data. Here we present JsVul, a dataset curated from seven major sources. Unlike generic multi-language datasets that may retain noise -- such as minified code and cosmetic edits -- JsVul utilizes a language-specific pipeline. We collected pre-fix and post-fix versions of files around security fixes and, by filtering irrelevant artifacts and applying automated syntax normalization, isolated security-related changes. We ensured data integrity through multi-stage deduplication and heuristic-based labeling. Provided in a time-ordered JSONL format, JsVul supports robust model training in the JavaScript and TypeScript ecosystem and demonstrates the importance of language-aware preprocessing in building vulnerability datasets.
Create a lesson
Metadata
- Categories
- cs.CR, cs.SE
- Comments
- This manuscript is currently under review at Scientific Data
Related papers
Now You See It, Now You Don't: Manipulating Perception and Attention in Code Vulnerability Detection LLM Agents
Shared title terminologycs.CRShanquan Yang, Boyu Kuang, Chunyi Zhou et al.
A Closer Look at the Quality of NPM Dataset for Malicious Code Detection
Shared title terminologycs.CRXuetao Li, Yuxia Zhang, Bohan Wang et al.
Key-Reuse Vulnerability of Phase-Keyed Fourier-Curve Modulation: Relation Leakage and Key-Refresh Cost on Coded Links
Shared title terminologycs.CRBin Han, Muxia Sun, Hans D. Schotten
Trajectory-Level Security Debt in LLM Coding Agents
Shared title terminologycs.CRPrateek Kumar Rajput, Abdoul Kader Kabore, Yewei Song et al.
From Vendor-Neutral Request to Paid Backend: Procurement Integrity at the Commitment Boundary of AI Coding Agents
Shared title terminologycs.CRJinqian Zhang, Haojun Xia, Shujiang Wu et al.
Intelligent Event-Safe Cyber-Physical Attack Detection and Localization in Critical Water Infrastructure: A Cross-Dataset Study of SWaT and WADI
Shared title terminologycs.CRVictor Kebande