Contributing to SecureCodePairs
Thanks for helping improve the dataset! We welcome high-quality, original secure/vulnerable code pairs.
How to add a record
- Fork the repository and create a branch:
git checkout -b add-SCP-00XXXX. - Open
scripts/data.pyand append a new dict to theRECORDSlist. - Follow the schema in
README.mdexactly. Required fields must be non-empty.tagsmust be a list of strings.metadatamust be a dict with at leastdomain,input_source,auth_required.owasp_api/owasp_llmmay be empty strings when not applicable.
- Every example must include BOTH a
vulnerable_codeand a correctsecure_codeplus apatchdiff. - Never submit template-renamed duplicates or low-quality synthetic noise. Code must look like something a real developer wrote.
- Run the checks locally:
The validator must finish with PASS (0 errors).python3 scripts/build.py python3 scripts/validate.py python3 scripts/statistics.py - 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_codemust actually fix theroot_cause. - Defensive context only: no context-free weaponized exploits.
Review
Maintainers will verify mappings, run the validation suite, and check for duplicates before merging.