Zreby commited on
Commit
47a4cc2
·
verified ·
1 Parent(s): becdb76

Update public dataset card

Browse files
Files changed (1) hide show
  1. README.md +23 -39
README.md CHANGED
@@ -8,23 +8,21 @@ tags:
8
  - NIST
9
  - SARD
10
  - Juliet
11
- size_categories: n<1K
12
  ---
13
  # NIST C/C++ Security Samples
14
 
15
- This **private** dataset repository contains two related exports 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 remains at the repository root; the additional labeled pilot is stored separately in `labeled/`.
16
 
17
- The code is synthetic test code, not production code. No sample was compiled or executed during preparation.
18
-
19
- ## Two dataset versions
20
 
21
  ### Original source subset (repository root)
22
 
23
- The root-level `juliet_samples.jsonl` and `sample_index.csv` contain **960 source files**, selected as the first 80 eligible files for each of 12 CWE families in upstream ZIP order. This selection is deterministic, not random, and is not representative of the full Juliet suite or all C/C++ code. In the original export, `split` is `unassigned`.
24
 
25
  ### Labeled pilot (`labeled/`)
26
 
27
- This folder contains a function-level label export and the corresponding file-level records, review artifacts, group assignments, split summaries, and manifest. It is derived from the same 960-file pilot; root-level files were not replaced.
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
- ## Load in Google Colab
41
 
42
- For this private repository, authenticate with an account that has access:
 
 
 
 
43
 
44
- ```python
45
- from huggingface_hub import notebook_login
46
- notebook_login()
47
- ```
48
 
49
- Load the original source export:
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 split distribution
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
- Across all splits, file summaries are: 463 mixed, 232 good-only observed, 32 bad-only observed, and 233 with no confident function label. Function counts count labeled definitions, not unique files or real-world prevalence. A file can contain multiple functions, and function rows are not statistically independent.
86
 
87
- Splits are grouped by Juliet case family to reduce leakage: archive `/sNN/` path segments and terminal flow-variant suffixes are normalized, extensions are ignored, and all files/functions in a family share one `group_id` and split. Groups are assigned separately within each CWE to approximate a 70/15/15 file-count target (56/12/12 files per CWE); indivisible groups mean exact totals can differ from the targets. No family is split across train, validation, and test.
88
 
89
- ## Important limitations and safe use
90
 
91
- - The subset is a deterministic selection of the first 80 eligible source files per CWE in upstream ZIP order, not a random or representative sample.
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 and rights references: [NIST SARD Juliet C/C++ 1.3 — test suite 112](https://samate.nist.gov/SARD/test-suites/112) and [NIST SARD acknowledgements and test suite descriptions](https://www.nist.gov/itl/csd/secure-systems-and-applications/sard-acknowledgments-and-test-suites-descriptions). NIST’s notice identifies material for which NIST holds the rights as public domain in the United States and CC0 1.0 to the extent applicable rights are held by NIST outside the United States. This does **not** establish that every component or third-party provenance in this copy has the same license; preserve notices and review relevant component rights before redistribution or other use. The dataset card does not claim unconditional CC0 coverage for the entire dataset.
98
 
99
- The original source export manifest records the SHA-256 checksum of its upstream archive as `ada9d7e1c323d283446df3f55bdee0d00bda1fed786785fe98764d58688f38eb`.
 
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.