Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
1.49k
11.6k
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
### System: You are a secure code remediation and vulnerability analysis engine. You do not provide free-form explanations. You do not include external references or links. You only return structured, deterministic, and security-focused outputs. ### Task: Given vulnerable source code, perform the following steps: 1. P...
End of preview. Expand in Data Studio

SecureDataset CVEFixes - Dataset Card

Dataset ID: Younis2003/secure_dataset_cvefixes


πŸ“‹ Table of Contents


πŸ“Š Dataset Summary

SecureDataset CVEFixes is a curated, high-quality dataset designed for secure code remediation and vulnerability analysis. It contains real-world vulnerable code snippets paired with their security fixes, extracted from actual CVE patches across multiple programming languages.

Split Samples
Train 2,189
Validation 281
Test 262
Total 2,732

🎯 Supported Tasks

Task Description
Supervised Fine-Tuning (SFT) Train LLMs to generate secure code fixes from vulnerable inputs
Vulnerability Detection Identify security flaws in source code
Code Remediation Automatically patch security vulnerabilities
Security Education Learn from real-world CVE fixes and CWE patterns

🌐 Languages

The dataset covers 8 major programming languages with the following distribution:

Language Train Validation Test
C 707 89 66
PHP 570 83 71
Python 253 29 33
JavaScript 211 23 25
C++ 143 10 13
Java 112 19 22
Ruby 98 15 20
Go 95 13 12

πŸ—‚οΈ Dataset Structure

Features

{
    "text": "string"  # Formatted prompt containing vulnerable code, fixed code, and metadata
}

Prompt Format

Each example follows a structured prompt template:

### System:
You are a secure code remediation and vulnerability analysis engine.
You do not provide free-form explanations.
You do not include external references or links.
You only return structured, deterministic, and security-focused outputs.

### Task:
Given vulnerable source code, perform the following steps:
1. Produce a secure and correct version of the code.
2. Explain the vulnerability using structured security metadata.

### Programming Language:
{row['language']}

### Vulnerable Code:
{row['vulnerable_code']}

### Constraints:
- Do NOT introduce new functionality.
- Do NOT change the intended behavior.
- Do NOT refactor unless required for security.
- Do NOT add comments unless required for security.
- Follow best security practices.

### Response Format:
Return the response EXACTLY in the format below.

### Fixed Code:
{row['fixed_code']}

### Vulnerability Explanation:

CVE: {row['cve_id']}

CVE Description:
{row['cve_description']}

CWE: {row['cwe_id']}

CWE Description:
{row['cwe_description']}

πŸ”§ Dataset Creation

Source

  • Original Dataset: hitoshura25/cvefixes
  • Original Size: 12,987 samples
  • Final Size: 2,732 samples (after cleaning & filtering)

Processing Pipeline

  1. Language Filtering: Retained 8 major languages (C, C++, Python, Java, JavaScript, PHP, Go, Ruby)
  2. Code Cleaning: Removed diff markers and patch artifacts
  3. Quality Filtering: Applied minimum line count requirements (5+ lines of real code)
  4. Deduplication: Removed identical vulnerable/fixed pairs
  5. Token Length Filtering: Filtered to ≀3072 tokens (CodeLlama-13b compatible)
  6. CVE-aware Split: Stratified split ensuring no CVE overlap between train/val/test

Data Quality Criteria

  • βœ… Minimum 5 lines of non-comment, non-empty code
  • βœ… Actual code changes between vulnerable and fixed versions
  • βœ… Valid CVE and CWE metadata
  • βœ… Token length ≀ 3072 (for efficient LLM training)

πŸ“š Source Data

  • CVE Database: National Vulnerability Database (NVD)
  • Code Sources: GitHub security patches and commits
  • CWE Classification: Common Weakness Enumeration standard

Top CWE Categories

CWE ID Count Description
CWE-79 1,878 Cross-site Scripting (XSS)
CWE-125 604 Out-of-bounds Read
CWE-787 491 Out-of-bounds Write
CWE-20 432 Improper Input Validation
CWE-89 429 SQL Injection

⚠️ Considerations for Using the Data

Intended Use

  • Fine-tuning code LLMs for security tasks
  • Research in automated vulnerability repair
  • Educational purposes for secure coding practices

Limitations

  • Language Coverage: Limited to 8 programming languages; other languages excluded
  • Token Limit: Examples filtered to ≀3072 tokens; longer patches excluded
  • CVE Coverage: Based on available CVE patches; not exhaustive of all vulnerabilities
  • Temporal Bias: Reflects historical vulnerabilities; may not cover latest attack patterns

Ethical Considerations

  • Dataset contains real vulnerability patterns β€” use responsibly for defensive purposes only
  • Do not use to train models for generating exploits or malicious code
  • Always validate generated fixes with security experts before deployment

πŸ“– Citation

If you use this dataset in your research, please cite:

@dataset{secure_dataset_cvefixes,
  author = {Younis2003},
  title = {SecureDataset CVEFixes: A Curated Dataset for Secure Code Remediation},
  year = {2024},
  url = {https://huggingface.co/datasets/Younis2003/secure_dataset_cvefixes}
}

πŸ”— Links


Last updated: 2024

Downloads last month
21

Models trained or fine-tuned on Younis2003/secure_dataset_cvefixes