Update public dataset card
Browse files
README.md
CHANGED
|
@@ -8,23 +8,21 @@ tags:
|
|
| 8 |
- NIST
|
| 9 |
- SARD
|
| 10 |
- Juliet
|
| 11 |
-
size_categories: n<
|
| 12 |
---
|
| 13 |
# NIST C/C++ Security Samples
|
| 14 |
|
| 15 |
-
This **
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
## Two dataset versions
|
| 20 |
|
| 21 |
### Original source subset (repository root)
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
### Labeled pilot (`labeled/`)
|
| 26 |
|
| 27 |
-
This
|
| 28 |
|
| 29 |
| File under `labeled/` | Contents |
|
| 30 |
|---|---|
|
|
@@ -37,29 +35,29 @@ This folder contains a function-level label export and the corresponding file-le
|
|
| 37 |
| `manifest.json` | Source checksum, annotation and split policies, counts, quality checks, and output checksums. |
|
| 38 |
| `README.md` | Usage notes and details for the labeled pilot. |
|
| 39 |
|
| 40 |
-
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
```
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
```python
|
| 52 |
from datasets import load_dataset
|
|
|
|
| 53 |
source = load_dataset(
|
| 54 |
"Zreby/nist-c-cpp-security-samples",
|
| 55 |
data_files="juliet_samples.jsonl",
|
| 56 |
split="train",
|
| 57 |
)
|
| 58 |
-
```
|
| 59 |
|
| 60 |
-
Load the labeled functions. The records include a `split` field; filter it to obtain the intended partitions:
|
| 61 |
-
|
| 62 |
-
```python
|
| 63 |
functions = load_dataset(
|
| 64 |
"Zreby/nist-c-cpp-security-samples",
|
| 65 |
data_files="labeled/juliet_functions_labeled.jsonl",
|
|
@@ -70,30 +68,16 @@ validation = functions.filter(lambda row: row["split"] == "validation")
|
|
| 70 |
test = functions.filter(lambda row: row["split"] == "test")
|
| 71 |
```
|
| 72 |
|
| 73 |
-
## Labels and
|
| 74 |
-
|
| 75 |
-
Labels in the pilot come only from explicit Juliet function or class role names, not from the parent CWE directory. Terminal `bad` / `_bad` role tokens map to `bad`; terminal `good`, `goodG2B`, and `goodB2G` tokens map to `good`. In C++ cases, a class role can label its `action` method. These are Juliet’s intended path labels, not proof that real-world code is exploitable or secure.
|
| 76 |
-
|
| 77 |
-
Partial helpers such as `badSink`, `goodG2BSink`, `badSource`, and `goodB2GSource` are not forced into a binary label because their function body alone may not reveal the end-to-end path. The pilot has **2,759 labeled function rows** and **758 review-only helper-function rows**. **233 files** have no confidently labeled function. In the file-level JSONL, `file_label` is null by design; `file_label_summary` (`mixed`, `good_only_observed`, `bad_only_observed`, or `no_confident_function_label`) is descriptive, not a training target.
|
| 78 |
-
|
| 79 |
-
| Split | Files | Good functions | Bad functions | Mixed files | Files without confident labels |
|
| 80 |
-
|---|---:|---:|---:|---:|---:|
|
| 81 |
-
| train | 672 | 1,562 | 341 | 317 | 171 |
|
| 82 |
-
| validation | 144 | 332 | 75 | 71 | 32 |
|
| 83 |
-
| test | 144 | 370 | 79 | 75 | 30 |
|
| 84 |
|
| 85 |
-
|
| 86 |
|
| 87 |
-
|
| 88 |
|
| 89 |
-
|
| 90 |
|
| 91 |
-
|
| 92 |
-
- Juliet is synthetic. CWE identifies a test-case family; it is not a file-level vulnerability label.
|
| 93 |
-
- Labels are inferred from names and intended Juliet paths, not from semantic analysis, compilation, or runtime behavior. The extractor is a lightweight source-text scanner, not a C/C++ AST or compiler; unusual declarations may be missed, so unresolved cases should be reviewed before expanding the set.
|
| 94 |
-
- Function identifiers and inline `FLAW` / `FIX` comments may reveal the label. If evaluating a model, remove or normalize such cues in a separate derived copy while retaining this provenance-preserving export.
|
| 95 |
-
- Do not compile, execute, or deploy the samples outside a properly isolated test environment. Results on this pilot alone do not establish detection capability or system security.
|
| 96 |
|
| 97 |
-
The complete upstream archive is not included. Source
|
| 98 |
|
| 99 |
-
|
|
|
|
| 8 |
- NIST
|
| 9 |
- SARD
|
| 10 |
- Juliet
|
| 11 |
+
size_categories: 1K<n<10K
|
| 12 |
---
|
| 13 |
# NIST C/C++ Security Samples
|
| 14 |
|
| 15 |
+
This **public dataset repository** contains two related exports derived from the official **NIST SARD Juliet C/C++ 1.3** test suite. “Juliet” identifies the source provenance, not the repository name. The original source subset is preserved at the repository root; a function-labeled pilot and its review and split artifacts are in `labeled/`. The code is synthetic test code, not production code. No sample was compiled or executed during preparation.
|
| 16 |
|
| 17 |
+
## Dataset versions and files
|
|
|
|
|
|
|
| 18 |
|
| 19 |
### Original source subset (repository root)
|
| 20 |
|
| 21 |
+
`juliet_samples.jsonl` and `sample_index.csv` contain **960 source files**: the first 80 eligible files for each of 12 CWE families in upstream ZIP order. The selection is deterministic, not randomized, and is not representative of the full Juliet suite or of C/C++ code generally. The source records have `split: unassigned`; a CWE folder is not a file-level vulnerable/benign label. `manifest.json` records source and output checksums and preparation checks.
|
| 22 |
|
| 23 |
### Labeled pilot (`labeled/`)
|
| 24 |
|
| 25 |
+
This is a function-level annotation derived from the same 960-file pilot; the root-level source export was not replaced.
|
| 26 |
|
| 27 |
| File under `labeled/` | Contents |
|
| 28 |
|---|---|
|
|
|
|
| 35 |
| `manifest.json` | Source checksum, annotation and split policies, counts, quality checks, and output checksums. |
|
| 36 |
| `README.md` | Usage notes and details for the labeled pilot. |
|
| 37 |
|
| 38 |
+
The labeled pilot contains **2,759 labeled function rows** and **758 review-only helper-function rows**. **233 files** have no confidently labeled function. File-level summaries are 463 mixed, 232 good-only observed, 32 bad-only observed, and 233 with no confident function label. A file can contain multiple functions, so function rows are not independent observations.
|
| 39 |
|
| 40 |
+
| Split | Files | Good functions | Bad functions | Mixed files | Files without confident labels |
|
| 41 |
+
|---|---:|---:|---:|---:|---:|
|
| 42 |
+
| train | 672 | 1,562 | 341 | 317 | 171 |
|
| 43 |
+
| validation | 144 | 332 | 75 | 71 | 32 |
|
| 44 |
+
| test | 144 | 370 | 79 | 75 | 30 |
|
| 45 |
|
| 46 |
+
Files and functions are grouped by Juliet case family to reduce leakage. Families are assigned separately within each CWE to approximate a 70/15/15 file-count target; indivisible groups can make exact totals differ from those targets. No family is split across train, validation, and test.
|
| 47 |
+
|
| 48 |
+
## Load the public data
|
|
|
|
| 49 |
|
| 50 |
+
The repository is public, so no Hugging Face authentication is needed to load it:
|
| 51 |
|
| 52 |
```python
|
| 53 |
from datasets import load_dataset
|
| 54 |
+
|
| 55 |
source = load_dataset(
|
| 56 |
"Zreby/nist-c-cpp-security-samples",
|
| 57 |
data_files="juliet_samples.jsonl",
|
| 58 |
split="train",
|
| 59 |
)
|
|
|
|
| 60 |
|
|
|
|
|
|
|
|
|
|
| 61 |
functions = load_dataset(
|
| 62 |
"Zreby/nist-c-cpp-security-samples",
|
| 63 |
data_files="labeled/juliet_functions_labeled.jsonl",
|
|
|
|
| 68 |
test = functions.filter(lambda row: row["split"] == "test")
|
| 69 |
```
|
| 70 |
|
| 71 |
+
## Labels and limitations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
+
Labels are based only on explicit Juliet function or class role names, not on the parent CWE directory. Terminal `bad` / `_bad` role tokens map to `bad`; terminal `good`, `goodG2B`, and `goodB2G` tokens map to `good`. In C++ cases, a class role can label its `action` method. These are Juliet's intended path labels, not proof that real-world code is exploitable or secure.
|
| 74 |
|
| 75 |
+
Partial helpers such as `badSink`, `goodG2BSink`, `badSource`, and `goodB2GSource` are not forced into a binary label because their function body alone may not reveal the end-to-end path. In the file-level JSONL, `file_label` is null by design; `file_label_summary` (`mixed`, `good_only_observed`, `bad_only_observed`, or `no_confident_function_label`) is descriptive, not a training target.
|
| 76 |
|
| 77 |
+
The extractor is a lightweight source-text scanner, not a C/C++ AST or compiler; unusual declarations may be missed, so unresolved cases should be reviewed before expanding the set. Function identifiers and inline `FLAW` / `FIX` comments may reveal labels. For model evaluation, remove or normalize such cues in a separate derived copy while retaining provenance. Results on this pilot alone do not establish detection capability or system security. Do not compile, execute, or deploy the samples outside a properly isolated test environment.
|
| 78 |
|
| 79 |
+
## Source and rights
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
+
The complete upstream archive is not included. Source: [NIST SARD Juliet C/C++ 1.3 — test suite 112](https://samate.nist.gov/SARD/test-suites/112). See also [NIST SARD acknowledgements and test suite descriptions](https://www.nist.gov/itl/csd/secure-systems-and-applications/sard-acknowledgments-and-test-suites-descriptions).
|
| 82 |
|
| 83 |
+
NIST's notice identifies material for which NIST holds the rights as **public domain in the United States**; outside the United States, **CC0 1.0 applies only to the extent that NIST holds the relevant rights**. This does not establish that every component or third-party-provenance item in this repository is covered by those terms. Preserve applicable notices and review relevant third-party provenance and rights before redistribution or other use. This card does **not** claim unconditional CC0 coverage for the entire dataset.
|