| # Contributing to SecureCodePairs |
|
|
| Thanks for helping improve the dataset! We welcome high-quality, original secure/vulnerable code pairs. |
|
|
| ## How to add a record |
|
|
| 1. Fork the repository and create a branch: `git checkout -b add-SCP-00XXXX`. |
| 2. Open `scripts/data.py` and append a new dict to the `RECORDS` list. |
| 3. Follow the schema in `README.md` exactly. Required fields must be non-empty. |
| - `tags` must be a **list of strings**. |
| - `metadata` must be a **dict** with at least `domain`, `input_source`, `auth_required`. |
| - `owasp_api` / `owasp_llm` may be empty strings when not applicable. |
| 4. Every example must include BOTH a `vulnerable_code` and a correct `secure_code` plus a `patch` diff. |
| 5. Never submit template-renamed duplicates or low-quality synthetic noise. Code must look like something a real developer wrote. |
| 6. Run the checks locally: |
| ```bash |
| python3 scripts/build.py |
| python3 scripts/validate.py |
| python3 scripts/statistics.py |
| ``` |
| The validator must finish with **PASS** (0 errors). |
| 7. Open a pull request describing the vulnerability class and language/framework added. |
|
|
| ## Quality bar |
|
|
| - Realistic, production-like naming and architecture. |
| - Accurate OWASP / CWE / ATT&CK mappings. |
| - The `secure_code` must actually fix the `root_cause`. |
| - Defensive context only: no context-free weaponized exploits. |
|
|
| ## Review |
|
|
| Maintainers will verify mappings, run the validation suite, and check for duplicates before merging. |
|
|