--- pretty_name: "Curated Secure-Coding Dataset: OWASP Juice Shop, OpenZeppelin, WebGoat, and BenchmarkJava" language: - en - id license: other size_categories: - n<1K task_categories: - text-generation tags: - secure-coding - vulnerability-detection - code-review - code-fix - owasp-juice-shop - owasp-benchmark - openzeppelin - webgoat - smart-contracts - sql-injection - typescript - yaml - solidity - java --- # Curated Secure-Coding Dataset This release contains **113 records** from four separately licensed source subsets: **83 OWASP Juice Shop challenge records** (71 TypeScript and 12 YAML), **5 OpenZeppelin Contracts Solidity references**, **3 Java code-review/reference records** from OWASP WebGoat, and **22 Java security benchmark test cases** from OWASP BenchmarkJava v1.2. ## Files and splits | File | Records | Contents | |---|---:|---| | `data/challenge_fix.jsonl` | 83 | Candidate/fix challenge records from OWASP Juice Shop. | | `data/reference.jsonl` | 5 | Solidity library-component references from OpenZeppelin Contracts v5.7.0. | | `data/webgoat_review.jsonl` | 3 | Two intentionally vulnerable SQL-injection review examples and one parameterized-query reference from WebGoat. | | `data/benchmarkjava_review.jsonl` | 22 | One expected-vulnerable and one expected-not-vulnerable case in each of 11 OWASP BenchmarkJava v1.2 categories. | These split names identify record types; they are **not** conventional train, validation, or test partitions. The WebGoat examples are not an upstream paired-fix benchmark. Two WebGoat labels and their remediation guidance were written by the curator. The BenchmarkJava examples are labeled test cases, not vulnerable/fixed source pairs. ## Sources and selection - **OWASP Juice Shop:** First-party TypeScript and YAML code-fix challenge material with accompanying metadata, pinned to [commit `c9f99228d9d56afb5f5ca7925376292f7fa44b13`](https://github.com/juice-shop/juice-shop/tree/c9f99228d9d56afb5f5ca7925376292f7fa44b13). - **OpenZeppelin Contracts:** Five Solidity components from [version v5.7.0](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/v5.7.0). - **OWASP WebGoat:** Three complete Java source files with file-level `GPL-2.0-or-later` and WebGoat copyright notices, pinned to [commit `4e98f1cbbf896fdd06edcc9930515ebe0ade7c69`](https://github.com/WebGoat/WebGoat/tree/4e98f1cbbf896fdd06edcc9930515ebe0ade7c69). The associated upstream tests are linked and hashed in record provenance but are not copied into the data. - **OWASP BenchmarkJava:** Twenty-two complete Java test-case files pinned to [commit `10dfcc54ad02dcfcb358b0ba4a0fef8c919a6d17`](https://github.com/OWASP-Benchmark/BenchmarkJava/tree/10dfcc54ad02dcfcb358b0ba4a0fef8c919a6d17). The expected-result labels are joined to `expectedresults-1.2.csv` at that same commit. Each selected file's own header states that it may be redistributed and modified under GNU GPL version 2; the full upstream license text is included. See [data sources and provenance](DATA_SOURCES.md), [curation decisions](CURATION_DECISIONS.md), and [source audit and evidence](SOURCE_AUDIT.md). `MANIFEST.json` records the record totals and SHA-256 checksums for each JSONL subset. Each record also retains its source path/URL, revision, applicable license metadata, and source checksum. ## Record format and loading Each record contains `id`, `source`, `task_type`, `domain`, `language`, `instruction`, `input`, `output`, `split`, `labels_json`, and `provenance_json`. The labels and provenance fields preserve structured annotations and source-level licensing details. Existing instructions are in Indonesian; instructions for the BenchmarkJava records are in English. Code samples include TypeScript, YAML, Solidity, and Java. ```python from datasets import load_dataset data = load_dataset("json", data_files={ "challenge_fix": "data/challenge_fix.jsonl", "reference": "data/reference.jsonl", "webgoat_review": "data/webgoat_review.jsonl", "benchmarkjava_review": "data/benchmarkjava_review.jsonl", }) ``` ## Rebuilding and tests `python3 prepare_benchmarkjava.py --staging staging --licenses LICENSES` fetches only the pinned BenchmarkJava files and checks the source, label-file, and license hashes before writing the staging JSONL. After preparing the other source subsets, run `python3 build_release.py --staging staging --out data` to normalize the records and refresh the manifest. Run `python3 -m unittest discover -s tests` to check the selected cases, labels, provenance, license text, and manifest. The sample source code is not compiled or executed by these steps. ## Label interpretation and limits - In the Juice Shop records, an upstream `*_correct` solution is marked correct for its specific challenge. Other alternatives are labeled as not marked correct by that challenge; they are not automatically vulnerable. - The WebGoat review labels are curator assessments of intentionally insecure training code or a narrow prepared-statement pattern. They are not presented as upstream fixed pairs or production incident evidence. The dynamic `ORDER BY` remediation is a curator-authored allowlist example; the `SqlInjectionLesson5a` source has no directly paired fixed version in the pinned revision. - BenchmarkJava labels are the benchmark's expected results for an individual test case and its named vulnerability category. A negative expected result is not a general claim that the full file or application is safe. The 22 examples are a small, deliberately balanced subset, not a representative sample of production software. - Challenge labels describe their upstream exercises, not universal security guarantees. The OpenZeppelin records are library references, not safe/unsafe labels or application audits. - Related challenge or benchmark cases can be highly similar. Do not treat these records as independent evaluation examples or infer benchmark performance from this small subset. The release does not provide conventional train/validation/test partitions. ## Licensing and reuse No single license is asserted for the entire repository. The selected Juice Shop and OpenZeppelin subsets are MIT-licensed and include their applicable license texts. The WebGoat code subset is licensed **GPL-2.0-or-later**. The BenchmarkJava subset is licensed **GPL-2.0-only** based on explicit notices in the selected source files. Both Java subsets preserve their original source headers, and the applicable upstream license texts are included under `LICENSES/`. Preserve the applicable notices and follow the license attached to each subset before redistributing or adapting its code. Do not apply a new blanket license to all records. No AI/ML-specific grant or restriction was identified in the selected BenchmarkJava file headers or GPLv2 text. This is not a separate legal determination about a particular training workflow or downstream model distribution; GPL obligations continue to apply to copying, redistribution, and modification of the covered code. See the [source audit](SOURCE_AUDIT.md) for the evidence and scope.