@openai/codex-security 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -12
- package/_bundled_plugin/.codex-plugin/plugin.json +1 -0
- package/_bundled_plugin/examples/completed-scan/findings.json +34 -34
- package/_bundled_plugin/examples/completed-scan/report.md +22 -31
- package/_bundled_plugin/examples/completed-scan/scan-manifest.json +27 -29
- package/_bundled_plugin/examples/{completed-scan → legacy-completed-scan}/coverage.json +1 -0
- package/_bundled_plugin/examples/legacy-completed-scan/findings.json +57 -0
- package/_bundled_plugin/examples/legacy-completed-scan/report.md +98 -0
- package/_bundled_plugin/examples/legacy-completed-scan/scan-manifest.json +43 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
- package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
- package/_bundled_plugin/references/core-scan.md +2 -2
- package/_bundled_plugin/references/final-report.md +16 -6
- package/_bundled_plugin/references/scan-artifacts.md +6 -6
- package/_bundled_plugin/references/scan-contract.md +10 -12
- package/_bundled_plugin/references/threat-model.md +1 -1
- package/_bundled_plugin/schemas/scan-manifest.schema.json +36 -11
- package/_bundled_plugin/schemas/tools/scan-draft.schema.json +5 -5
- package/_bundled_plugin/scripts/deep_scan_workbench.py +1 -1
- package/_bundled_plugin/scripts/finalize_scan_contract.py +97 -20
- package/_bundled_plugin/scripts/report_projection.py +5 -2
- package/_bundled_plugin/scripts/review_state.py +68 -0
- package/_bundled_plugin/scripts/servicenow_avit.py +107 -0
- package/_bundled_plugin/scripts/validate_scan_contract.py +1 -2
- package/_bundled_plugin/scripts/workbench/retained_coverage.py +49 -37
- package/_bundled_plugin/scripts/workbench/retained_records.py +7 -7
- package/_bundled_plugin/scripts/workbench/saved_coverage.py +15 -15
- package/_bundled_plugin/scripts/workbench/saved_sources.py +24 -6
- package/_bundled_plugin/scripts/workbench_constants.py +0 -1
- package/_bundled_plugin/scripts/workbench_coverage_receipts.py +4 -4
- package/_bundled_plugin/scripts/workbench_db.py +5 -150
- package/_bundled_plugin/scripts/workbench_saved_results.py +169 -4
- package/_bundled_plugin/scripts/workbench_scan_history.py +12 -7
- package/_bundled_plugin/scripts/workbench_scan_start.py +4 -1
- package/_bundled_plugin/skills/publish-findings/SKILL.md +9 -3
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +1 -1
- package/_bundled_plugin/skills/security-scan/SKILL.md +7 -7
- package/_bundled_plugin/skills/track-findings/SKILL.md +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +50 -27
- package/dist/api.js.map +1 -1
- package/dist/artifact-export.d.ts +12 -3
- package/dist/artifact-export.d.ts.map +1 -1
- package/dist/artifact-export.js +30 -10
- package/dist/artifact-export.js.map +1 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +1 -0
- package/dist/cli-help.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +69 -55
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +2 -23
- package/dist/cloud-publish.js.map +1 -1
- package/dist/contract.d.ts +4 -2
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +39 -21
- package/dist/contract.js.map +1 -1
- package/dist/custom-publish.js +2 -2
- package/dist/custom-publish.js.map +1 -1
- package/dist/custom-validation-prompt.d.ts.map +1 -1
- package/dist/custom-validation-prompt.js +14 -6
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +17 -15
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +2 -2
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/deduplication-prompts.d.ts +1 -0
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
- package/dist/deduplication/deduplication-prompts.js +3 -0
- package/dist/deduplication/deduplication-prompts.js.map +1 -1
- package/dist/deduplication/records-protocol.d.ts.map +1 -1
- package/dist/deduplication/records-protocol.js +21 -1
- package/dist/deduplication/records-protocol.js.map +1 -1
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +2 -2
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/external-findings-local.d.ts +1 -0
- package/dist/external-findings-local.d.ts.map +1 -1
- package/dist/external-findings-local.js +25 -2
- package/dist/external-findings-local.js.map +1 -1
- package/dist/external-findings-publish.d.ts +1 -0
- package/dist/external-findings-publish.d.ts.map +1 -1
- package/dist/external-findings-publish.js +55 -26
- package/dist/external-findings-publish.js.map +1 -1
- package/dist/external-findings-read.d.ts +1 -0
- package/dist/external-findings-read.d.ts.map +1 -1
- package/dist/external-findings-read.js +10 -0
- package/dist/external-findings-read.js.map +1 -1
- package/dist/external-findings.d.ts +2 -0
- package/dist/external-findings.d.ts.map +1 -1
- package/dist/external-findings.js.map +1 -1
- package/dist/external-import-contract.d.ts +4 -0
- package/dist/external-import-contract.d.ts.map +1 -1
- package/dist/external-import-contract.js +34 -10
- package/dist/external-import-contract.js.map +1 -1
- package/dist/finding-workflow.d.ts +2 -0
- package/dist/finding-workflow.d.ts.map +1 -1
- package/dist/finding-workflow.js +3 -0
- package/dist/finding-workflow.js.map +1 -1
- package/dist/github-advisories.d.ts.map +1 -1
- package/dist/github-advisories.js +5 -5
- package/dist/github-advisories.js.map +1 -1
- package/dist/github-dependabot-findings.d.ts +6 -0
- package/dist/github-dependabot-findings.d.ts.map +1 -0
- package/dist/github-dependabot-findings.js +247 -0
- package/dist/github-dependabot-findings.js.map +1 -0
- package/dist/github-findings.d.ts.map +1 -1
- package/dist/github-findings.js +11 -4
- package/dist/github-findings.js.map +1 -1
- package/dist/github-identifiers.d.ts +4 -0
- package/dist/github-identifiers.d.ts.map +1 -0
- package/dist/github-identifiers.js +9 -0
- package/dist/github-identifiers.js.map +1 -0
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +4 -6
- package/dist/github.js.map +1 -1
- package/dist/host-protocol.d.ts +1 -1
- package/dist/host-protocol.d.ts.map +1 -1
- package/dist/host-protocol.js +2 -2
- package/dist/host-protocol.js.map +1 -1
- package/dist/hosted-scan.d.ts.map +1 -1
- package/dist/hosted-scan.js +13 -6
- package/dist/hosted-scan.js.map +1 -1
- package/dist/import-scan.js +16 -16
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.js +3 -0
- package/dist/knowledge-base.js.map +1 -1
- package/dist/mock-scan.d.ts +1 -2
- package/dist/mock-scan.d.ts.map +1 -1
- package/dist/mock-scan.js +12 -17
- package/dist/mock-scan.js.map +1 -1
- package/dist/models.d.ts +9 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +1 -6
- package/dist/multiscan.js.map +1 -1
- package/dist/native-json-findings.d.ts +30 -0
- package/dist/native-json-findings.d.ts.map +1 -0
- package/dist/native-json-findings.js +114 -0
- package/dist/native-json-findings.js.map +1 -0
- package/dist/opengrep-findings.d.ts +10 -0
- package/dist/opengrep-findings.d.ts.map +1 -0
- package/dist/opengrep-findings.js +198 -0
- package/dist/opengrep-findings.js.map +1 -0
- package/dist/patch-tui.d.ts.map +1 -1
- package/dist/patch-tui.js +2 -0
- package/dist/patch-tui.js.map +1 -1
- package/dist/publication.js +1 -2
- package/dist/publication.js.map +1 -1
- package/dist/record.d.ts +1 -0
- package/dist/record.d.ts.map +1 -1
- package/dist/record.js +10 -0
- package/dist/record.js.map +1 -1
- package/dist/result.d.ts +5 -3
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +9 -6
- package/dist/result.js.map +1 -1
- package/dist/scan-history-renderer.js +1 -1
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/scanner-import.d.ts +0 -1
- package/dist/scanner-import.d.ts.map +1 -1
- package/dist/scanner-import.js +9 -9
- package/dist/scanner-import.js.map +1 -1
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js +16 -2
- package/dist/security-policy.js.map +1 -1
- package/dist/semgrep-findings.d.ts.map +1 -1
- package/dist/semgrep-findings.js +15 -82
- package/dist/semgrep-findings.js.map +1 -1
- package/docs/cli.md +55 -10
- package/docs/dedupe-records.md +15 -1
- package/docs/hosted-scans.md +14 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -183,17 +183,17 @@ directory must be private to you (`chmod 700`).
|
|
|
183
183
|
| --------------------------------- | ---------------------------------------------------------------- |
|
|
184
184
|
| `findings.findings` | Findings from this scan. |
|
|
185
185
|
| `reportPath` | Path to the Markdown report. |
|
|
186
|
-
| `
|
|
186
|
+
| `review` | Additional excluded paths. This is not file coverage. |
|
|
187
187
|
| `repositoryFindings` | This scan's findings plus earlier open findings, when available. |
|
|
188
188
|
| `sarifPath` | SARIF export path, or `null`. |
|
|
189
189
|
| `threatModel` / `threatModelPath` | Saved threat model and document path; either can be `null`. |
|
|
190
190
|
| `cost` | Estimated model usage cost, or `null` when unavailable. |
|
|
191
191
|
|
|
192
192
|
Review the requested paths and exclusions alongside the execution outcome.
|
|
193
|
-
`
|
|
194
|
-
`
|
|
193
|
+
`reviewState.deferred` records unfinished requested work, while
|
|
194
|
+
`reviewState.openQuestions` records optional follow-up separately.
|
|
195
195
|
|
|
196
|
-
Review
|
|
196
|
+
Review the scan status and scope alongside findings. A report with no findings does not establish
|
|
197
197
|
that the repository is secure. Reports and logs can contain source code,
|
|
198
198
|
vulnerability details, and credentials; review them before sharing.
|
|
199
199
|
|
|
@@ -667,19 +667,25 @@ options where supported, and changing formats can change record identities or
|
|
|
667
667
|
replace richer evidence with less detail. See the
|
|
668
668
|
[import guide](docs/cli.md#import-vendor-findings-locally) for format selection.
|
|
669
669
|
|
|
670
|
+
For OpenGrep, use `--provider opengrep` with native JSON or gzip and an explicit
|
|
671
|
+
`--source-repository-url`. Local and Cloud imports retain unassessed OpenGrep
|
|
672
|
+
evidence through the existing Semgrep source-provider contract. See the
|
|
673
|
+
[OpenGrep guide](https://github.com/openai/codex-security/blob/main/docs/scanner-imports/opengrep.md) for preview commands,
|
|
674
|
+
coverage diagnostics, stable source identities, and local SDK assessment.
|
|
675
|
+
|
|
670
676
|
For Wiz, prefer supported native JSON acquired through an authorized MCP or API
|
|
671
677
|
connection. The [CSV compatibility reader](docs/cli.md#import-wiz-findings) covers
|
|
672
678
|
repository package vulnerabilities (SCA) only; it does not add SAST, CSPM or
|
|
673
679
|
complete code-to-cloud coverage. Both formats support gzip. The acquisition path
|
|
674
680
|
still needs validation with an authorized Wiz tenant.
|
|
675
681
|
|
|
676
|
-
For GitHub, save complete JSON from
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
to GitHub.
|
|
682
|
+
For GitHub code scanning and GHSA advisories, save complete JSON from
|
|
683
|
+
`import github` or `import github-advisories`, respectively. **GHSA import
|
|
684
|
+
does not establish an installed dependency or applicability to the repository.**
|
|
685
|
+
For Dependabot, save the native REST alert records from one repository using the
|
|
686
|
+
[Dependabot export guide](https://github.com/openai/codex-security/blob/main/docs/scanner-imports/github-dependabot.md).
|
|
687
|
+
The GitHub file reader accepts all three families. Secret-scanning alerts and
|
|
688
|
+
writeback to GitHub are outside its scope.
|
|
683
689
|
|
|
684
690
|
Use `publish findings FILE --to local --repository PATH --provider wiz
|
|
685
691
|
--source-key KEY` to store the same vendor evidence in the local workbench SQLite
|
|
@@ -695,7 +701,7 @@ Use `--provider endor` with native Endor Finding JSON; existing endorctl SARIF i
|
|
|
695
701
|
accepted as a lossy compatibility format. See
|
|
696
702
|
[Endor imports](docs/cli.md#import-endor-labs-findings).
|
|
697
703
|
|
|
698
|
-
For saved GitHub code-scanning alerts
|
|
704
|
+
For saved GitHub code-scanning alerts, GHSA advisories, or Dependabot alerts, use
|
|
699
705
|
`--provider github` with a separate stable source key for each finding family.
|
|
700
706
|
See [local imports](docs/cli.md#import-vendor-findings-locally).
|
|
701
707
|
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"documentType": "codex-security.findings",
|
|
3
|
-
"schemaVersion": "1.0",
|
|
4
|
-
"scanId": "scan_example_001",
|
|
5
3
|
"findings": [
|
|
6
4
|
{
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"anchor": "archive-entry-write-without-containment"
|
|
5
|
+
"attackPath": null,
|
|
6
|
+
"confidence": {
|
|
7
|
+
"level": "high",
|
|
8
|
+
"rationale": "Direct source trace reaches the filesystem write without a containment check."
|
|
12
9
|
},
|
|
10
|
+
"extensions": {},
|
|
11
|
+
"findingId": "csf_852f90d6e1177502ff113d4a",
|
|
13
12
|
"fingerprints": {
|
|
14
13
|
"algorithm": "codex-security/v1",
|
|
15
14
|
"primary": "codex-security/v1:sha256:990a4a6a2ec18440dd47eac4d7256c0ee2c02db1b43104720cab3cbe9db706ca"
|
|
16
15
|
},
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
"severity": {
|
|
20
|
-
"level": "high",
|
|
21
|
-
"score": 8.1,
|
|
22
|
-
"scoringSystem": "CVSS:3.1"
|
|
23
|
-
},
|
|
24
|
-
"confidence": {
|
|
25
|
-
"level": "high",
|
|
26
|
-
"rationale": "Direct source trace reaches the filesystem write without a containment check."
|
|
27
|
-
},
|
|
28
|
-
"taxonomy": {
|
|
29
|
-
"category": "path-traversal",
|
|
30
|
-
"cwe": [
|
|
31
|
-
"CWE-22"
|
|
32
|
-
]
|
|
16
|
+
"identity": {
|
|
17
|
+
"anchor": "archive-entry-write-without-containment"
|
|
33
18
|
},
|
|
34
19
|
"locations": [
|
|
35
20
|
{
|
|
36
|
-
"path": "src/extract.py",
|
|
37
|
-
"startLine": 41,
|
|
38
21
|
"endLine": 44,
|
|
39
|
-
"
|
|
22
|
+
"path": "src/extract.py",
|
|
23
|
+
"role": "sink",
|
|
24
|
+
"startLine": 41
|
|
40
25
|
}
|
|
41
26
|
],
|
|
42
|
-
"
|
|
43
|
-
"validation": null,
|
|
44
|
-
"attackPath": null,
|
|
45
|
-
"remediationTests": [
|
|
46
|
-
"Assert that extracting an archive entry named `../escape.txt` fails without writing outside the extraction root."
|
|
47
|
-
],
|
|
27
|
+
"occurrenceId": "occ_e79cb19591e696572a1c22be",
|
|
48
28
|
"preventiveControls": [
|
|
49
29
|
"Route all archive extraction through one helper that normalizes and validates destination paths."
|
|
50
30
|
],
|
|
51
31
|
"provenance": {
|
|
52
32
|
"source": "local_plugin"
|
|
53
33
|
},
|
|
54
|
-
"
|
|
34
|
+
"remediation": "Normalize destinations and reject entries that escape the extraction root.",
|
|
35
|
+
"remediationTests": [
|
|
36
|
+
"Assert that extracting an archive entry named `../escape.txt` fails without writing outside the extraction root."
|
|
37
|
+
],
|
|
38
|
+
"ruleId": "path-traversal.archive-extraction",
|
|
39
|
+
"severity": {
|
|
40
|
+
"level": "high",
|
|
41
|
+
"score": 8.1,
|
|
42
|
+
"scoringSystem": "CVSS:3.1"
|
|
43
|
+
},
|
|
44
|
+
"summary": "An attacker-controlled path reaches a filesystem write without containment validation.",
|
|
45
|
+
"taxonomy": {
|
|
46
|
+
"category": "path-traversal",
|
|
47
|
+
"cwe": [
|
|
48
|
+
"CWE-22"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"title": "Unsafe archive extraction can escape the output directory",
|
|
52
|
+
"validation": null
|
|
55
53
|
}
|
|
56
|
-
]
|
|
54
|
+
],
|
|
55
|
+
"scanId": "scan_example_001",
|
|
56
|
+
"schemaVersion": "1.0"
|
|
57
57
|
}
|
|
@@ -9,21 +9,20 @@ The scan was configured for the include paths and exclusions listed below.
|
|
|
9
9
|
- Target ID: target\_sha256\_example
|
|
10
10
|
- Revision: deadbeef
|
|
11
11
|
- Snapshot digest: codex-security-snapshot/v1:sha256:ed88f96a4c1a06603a41b3f261f59c3de2555c367ef6ad3bb8b9e483495d34eb
|
|
12
|
-
- Inventory strategy: repository
|
|
13
12
|
- Included paths: .
|
|
14
13
|
- Excluded paths: none
|
|
15
14
|
|
|
16
15
|
### Scan Summary
|
|
17
16
|
|
|
18
|
-
| Field
|
|
19
|
-
|
|
|
20
|
-
| Scan outcome
|
|
21
|
-
| Reportable findings | 1
|
|
22
|
-
| Severity mix
|
|
23
|
-
| Confidence mix
|
|
24
|
-
| Validation mode
|
|
17
|
+
| Field | Value |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| Scan outcome | completed |
|
|
20
|
+
| Reportable findings | 1 |
|
|
21
|
+
| Severity mix | high: 1 |
|
|
22
|
+
| Confidence mix | high: 1 |
|
|
23
|
+
| Validation mode | not recorded |
|
|
25
24
|
|
|
26
|
-
Canonical artifacts: `scan-manifest.json
|
|
25
|
+
Canonical artifacts: `scan-manifest.json` and `findings.json`. This report is a deterministic projection of those files.
|
|
27
26
|
|
|
28
27
|
## Threat Model
|
|
29
28
|
|
|
@@ -31,30 +30,30 @@ No explicit canonical threat-model summary was recorded.
|
|
|
31
30
|
|
|
32
31
|
## Findings
|
|
33
32
|
|
|
34
|
-
| Finding
|
|
35
|
-
|
|
|
36
|
-
| [Unsafe archive extraction can escape the output directory](#finding-1) | high
|
|
33
|
+
| Finding | Severity | Confidence | Detailed write-up |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| [Unsafe archive extraction can escape the output directory](#finding-1) | high | high | inline below |
|
|
37
36
|
|
|
38
37
|
### Confidence Scale
|
|
39
38
|
|
|
40
|
-
| Label
|
|
41
|
-
|
|
|
42
|
-
| high
|
|
39
|
+
| Label | Meaning |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| high | Direct evidence supports the finding with no material unresolved blocker. |
|
|
43
42
|
| medium | Evidence supports a plausible issue, but material runtime or reachability proof remains. |
|
|
44
|
-
| low
|
|
43
|
+
| low | Evidence is incomplete and the item is retained only for explicit follow-up. |
|
|
45
44
|
|
|
46
45
|
<a id="finding-1"></a>
|
|
47
46
|
|
|
48
47
|
### [1] Unsafe archive extraction can escape the output directory
|
|
49
48
|
|
|
50
|
-
| Field
|
|
51
|
-
|
|
|
52
|
-
| Severity
|
|
53
|
-
| Confidence
|
|
49
|
+
| Field | Value |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| Severity | high |
|
|
52
|
+
| Confidence | high |
|
|
54
53
|
| Confidence rationale | Direct source trace reaches the filesystem write without a containment check. |
|
|
55
|
-
| Category
|
|
56
|
-
| CWE
|
|
57
|
-
| Affected lines
|
|
54
|
+
| Category | path-traversal |
|
|
55
|
+
| CWE | CWE-22 |
|
|
56
|
+
| Affected lines | src/extract.py:41-44 |
|
|
58
57
|
|
|
59
58
|
#### Summary
|
|
60
59
|
|
|
@@ -83,15 +82,7 @@ Additional runtime or deployment evidence could raise or lower this severity.
|
|
|
83
82
|
Normalize destinations and reject entries that escape the extraction root.
|
|
84
83
|
|
|
85
84
|
Tests:
|
|
86
|
-
|
|
87
85
|
- Assert that extracting an archive entry named `../escape.txt` fails without writing outside the extraction root.
|
|
88
86
|
|
|
89
87
|
Preventive controls:
|
|
90
|
-
|
|
91
88
|
- Route all archive extraction through one helper that normalizes and validates destination paths.
|
|
92
|
-
|
|
93
|
-
## Reviewed Surfaces
|
|
94
|
-
|
|
95
|
-
| Surface | Risk Area | Outcome | Notes |
|
|
96
|
-
| ------------------ | ------------ | -------- | -------------------------------------------- |
|
|
97
|
-
| Archive extraction | not recorded | Reported | No additional canonical notes were recorded. |
|
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"documentType": "codex-security.scan-manifest",
|
|
3
|
-
"schemaVersion": "1.0",
|
|
4
3
|
"scan": {
|
|
4
|
+
"artifacts": [
|
|
5
|
+
{
|
|
6
|
+
"mediaType": "application/json",
|
|
7
|
+
"path": "findings.json",
|
|
8
|
+
"sha256": "fea40b4d1f0b92090f1c0a06f43fa03da5bdf4e7f8bdf8e8a7953ae626600d5b"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"completedAt": "2026-05-31T18:09:00Z",
|
|
12
|
+
"findingsRef": "findings.json",
|
|
5
13
|
"id": "scan_example_001",
|
|
14
|
+
"mode": "repository",
|
|
6
15
|
"producer": {
|
|
7
16
|
"name": "codex-security-plugin",
|
|
8
17
|
"version": "0.1.0"
|
|
9
18
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"completedAt": "2026-05-31T18:09:00Z",
|
|
13
|
-
"sealedAt": "2026-05-31T18:09:00Z",
|
|
14
|
-
"target": {
|
|
15
|
-
"kind": "git_worktree",
|
|
16
|
-
"targetId": "target_sha256_example",
|
|
17
|
-
"displayName": "example/repo",
|
|
18
|
-
"remote": "https://github.com/example/repo",
|
|
19
|
-
"revision": "deadbeef",
|
|
20
|
-
"snapshotDigest": "codex-security-snapshot/v1:sha256:ed88f96a4c1a06603a41b3f261f59c3de2555c367ef6ad3bb8b9e483495d34eb"
|
|
19
|
+
"review": {
|
|
20
|
+
"excludedPaths": []
|
|
21
21
|
},
|
|
22
22
|
"scope": {
|
|
23
|
+
"excludePaths": [],
|
|
23
24
|
"includePaths": [
|
|
24
25
|
"."
|
|
25
|
-
]
|
|
26
|
-
"excludePaths": []
|
|
26
|
+
]
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
]
|
|
42
|
-
}
|
|
28
|
+
"sealedAt": "2026-05-31T18:09:00Z",
|
|
29
|
+
"startedAt": "2026-05-31T18:00:00Z",
|
|
30
|
+
"status": "completed",
|
|
31
|
+
"target": {
|
|
32
|
+
"displayName": "example/repo",
|
|
33
|
+
"kind": "git_worktree",
|
|
34
|
+
"remote": "https://github.com/example/repo",
|
|
35
|
+
"revision": "deadbeef",
|
|
36
|
+
"snapshotDigest": "codex-security-snapshot/v1:sha256:ed88f96a4c1a06603a41b3f261f59c3de2555c367ef6ad3bb8b9e483495d34eb",
|
|
37
|
+
"targetId": "target_sha256_example"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"schemaVersion": "1.0"
|
|
43
41
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentType": "codex-security.findings",
|
|
3
|
+
"schemaVersion": "1.0",
|
|
4
|
+
"scanId": "scan_example_001",
|
|
5
|
+
"findings": [
|
|
6
|
+
{
|
|
7
|
+
"findingId": "csf_852f90d6e1177502ff113d4a",
|
|
8
|
+
"occurrenceId": "occ_e79cb19591e696572a1c22be",
|
|
9
|
+
"ruleId": "path-traversal.archive-extraction",
|
|
10
|
+
"identity": {
|
|
11
|
+
"anchor": "archive-entry-write-without-containment"
|
|
12
|
+
},
|
|
13
|
+
"fingerprints": {
|
|
14
|
+
"algorithm": "codex-security/v1",
|
|
15
|
+
"primary": "codex-security/v1:sha256:990a4a6a2ec18440dd47eac4d7256c0ee2c02db1b43104720cab3cbe9db706ca"
|
|
16
|
+
},
|
|
17
|
+
"title": "Unsafe archive extraction can escape the output directory",
|
|
18
|
+
"summary": "An attacker-controlled path reaches a filesystem write without containment validation.",
|
|
19
|
+
"severity": {
|
|
20
|
+
"level": "high",
|
|
21
|
+
"score": 8.1,
|
|
22
|
+
"scoringSystem": "CVSS:3.1"
|
|
23
|
+
},
|
|
24
|
+
"confidence": {
|
|
25
|
+
"level": "high",
|
|
26
|
+
"rationale": "Direct source trace reaches the filesystem write without a containment check."
|
|
27
|
+
},
|
|
28
|
+
"taxonomy": {
|
|
29
|
+
"category": "path-traversal",
|
|
30
|
+
"cwe": [
|
|
31
|
+
"CWE-22"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"locations": [
|
|
35
|
+
{
|
|
36
|
+
"path": "src/extract.py",
|
|
37
|
+
"startLine": 41,
|
|
38
|
+
"endLine": 44,
|
|
39
|
+
"role": "sink"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"remediation": "Normalize destinations and reject entries that escape the extraction root.",
|
|
43
|
+
"validation": null,
|
|
44
|
+
"attackPath": null,
|
|
45
|
+
"remediationTests": [
|
|
46
|
+
"Assert that extracting an archive entry named `../escape.txt` fails without writing outside the extraction root."
|
|
47
|
+
],
|
|
48
|
+
"preventiveControls": [
|
|
49
|
+
"Route all archive extraction through one helper that normalizes and validates destination paths."
|
|
50
|
+
],
|
|
51
|
+
"provenance": {
|
|
52
|
+
"source": "local_plugin"
|
|
53
|
+
},
|
|
54
|
+
"extensions": {}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Security Review: example/repo
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
The scan was configured for the include paths and exclusions listed below.
|
|
6
|
+
|
|
7
|
+
- Scan mode: repository
|
|
8
|
+
- Target kind: git\_worktree
|
|
9
|
+
- Target ID: target\_sha256\_example
|
|
10
|
+
- Revision: deadbeef
|
|
11
|
+
- Snapshot digest: codex-security-snapshot/v1:sha256:ed88f96a4c1a06603a41b3f261f59c3de2555c367ef6ad3bb8b9e483495d34eb
|
|
12
|
+
- Inventory strategy: repository
|
|
13
|
+
- Included paths: .
|
|
14
|
+
- Excluded paths: none
|
|
15
|
+
|
|
16
|
+
### Scan Summary
|
|
17
|
+
|
|
18
|
+
| Field | Value |
|
|
19
|
+
| ------------------- | ------------ |
|
|
20
|
+
| Scan outcome | completed |
|
|
21
|
+
| Reportable findings | 1 |
|
|
22
|
+
| Severity mix | high: 1 |
|
|
23
|
+
| Confidence mix | high: 1 |
|
|
24
|
+
| Coverage | complete |
|
|
25
|
+
| Validation mode | not recorded |
|
|
26
|
+
|
|
27
|
+
Canonical artifacts: `scan-manifest.json`, `findings.json`, and `coverage.json`. This report is a deterministic projection of those files.
|
|
28
|
+
|
|
29
|
+
## Threat Model
|
|
30
|
+
|
|
31
|
+
No explicit canonical threat-model summary was recorded.
|
|
32
|
+
|
|
33
|
+
## Findings
|
|
34
|
+
|
|
35
|
+
| Finding | Severity | Confidence | Detailed write-up |
|
|
36
|
+
| ----------------------------------------------------------------------- | -------- | ---------- | ----------------- |
|
|
37
|
+
| [Unsafe archive extraction can escape the output directory](#finding-1) | high | high | inline below |
|
|
38
|
+
|
|
39
|
+
### Confidence Scale
|
|
40
|
+
|
|
41
|
+
| Label | Meaning |
|
|
42
|
+
| ------ | ---------------------------------------------------------------------------------------- |
|
|
43
|
+
| high | Direct evidence supports the finding with no material unresolved blocker. |
|
|
44
|
+
| medium | Evidence supports a plausible issue, but material runtime or reachability proof remains. |
|
|
45
|
+
| low | Evidence is incomplete and the item is retained only for explicit follow-up. |
|
|
46
|
+
|
|
47
|
+
<a id="finding-1"></a>
|
|
48
|
+
|
|
49
|
+
### [1] Unsafe archive extraction can escape the output directory
|
|
50
|
+
|
|
51
|
+
| Field | Value |
|
|
52
|
+
| -------------------- | ----------------------------------------------------------------------------- |
|
|
53
|
+
| Severity | high |
|
|
54
|
+
| Confidence | high |
|
|
55
|
+
| Confidence rationale | Direct source trace reaches the filesystem write without a containment check. |
|
|
56
|
+
| Category | path-traversal |
|
|
57
|
+
| CWE | CWE-22 |
|
|
58
|
+
| Affected lines | src/extract.py:41-44 |
|
|
59
|
+
|
|
60
|
+
#### Summary
|
|
61
|
+
|
|
62
|
+
An attacker-controlled path reaches a filesystem write without containment validation.
|
|
63
|
+
|
|
64
|
+
#### Validation
|
|
65
|
+
|
|
66
|
+
Direct source trace reaches the filesystem write without a containment check. Validation details were not recorded separately.
|
|
67
|
+
|
|
68
|
+
#### Dataflow
|
|
69
|
+
|
|
70
|
+
The canonical finding records the affected path at src/extract.py:41-44, but no expanded source-to-sink narrative was recorded.
|
|
71
|
+
|
|
72
|
+
#### Reachability
|
|
73
|
+
|
|
74
|
+
Reachability was not recorded beyond the canonical finding summary and affected locations.
|
|
75
|
+
|
|
76
|
+
#### Severity
|
|
77
|
+
|
|
78
|
+
**High** — The scan assigned high severity; no separate canonical severity rationale was recorded.
|
|
79
|
+
|
|
80
|
+
Additional runtime or deployment evidence could raise or lower this severity.
|
|
81
|
+
|
|
82
|
+
#### Remediation
|
|
83
|
+
|
|
84
|
+
Normalize destinations and reject entries that escape the extraction root.
|
|
85
|
+
|
|
86
|
+
Tests:
|
|
87
|
+
|
|
88
|
+
- Assert that extracting an archive entry named `../escape.txt` fails without writing outside the extraction root.
|
|
89
|
+
|
|
90
|
+
Preventive controls:
|
|
91
|
+
|
|
92
|
+
- Route all archive extraction through one helper that normalizes and validates destination paths.
|
|
93
|
+
|
|
94
|
+
## Reviewed Surfaces
|
|
95
|
+
|
|
96
|
+
| Surface | Risk Area | Outcome | Notes |
|
|
97
|
+
| ------------------ | ------------ | -------- | -------------------------------------------- |
|
|
98
|
+
| Archive extraction | not recorded | Reported | No additional canonical notes were recorded. |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentType": "codex-security.scan-manifest",
|
|
3
|
+
"schemaVersion": "1.0",
|
|
4
|
+
"scan": {
|
|
5
|
+
"id": "scan_example_001",
|
|
6
|
+
"producer": {
|
|
7
|
+
"name": "codex-security-plugin",
|
|
8
|
+
"version": "0.1.0"
|
|
9
|
+
},
|
|
10
|
+
"status": "completed",
|
|
11
|
+
"startedAt": "2026-05-31T18:00:00Z",
|
|
12
|
+
"completedAt": "2026-05-31T18:09:00Z",
|
|
13
|
+
"sealedAt": "2026-05-31T18:09:00Z",
|
|
14
|
+
"target": {
|
|
15
|
+
"kind": "git_worktree",
|
|
16
|
+
"targetId": "target_sha256_example",
|
|
17
|
+
"displayName": "example/repo",
|
|
18
|
+
"remote": "https://github.com/example/repo",
|
|
19
|
+
"revision": "deadbeef",
|
|
20
|
+
"snapshotDigest": "codex-security-snapshot/v1:sha256:ed88f96a4c1a06603a41b3f261f59c3de2555c367ef6ad3bb8b9e483495d34eb"
|
|
21
|
+
},
|
|
22
|
+
"scope": {
|
|
23
|
+
"includePaths": [
|
|
24
|
+
"."
|
|
25
|
+
],
|
|
26
|
+
"excludePaths": []
|
|
27
|
+
},
|
|
28
|
+
"coverageRef": "coverage.json",
|
|
29
|
+
"findingsRef": "findings.json",
|
|
30
|
+
"artifacts": [
|
|
31
|
+
{
|
|
32
|
+
"path": "findings.json",
|
|
33
|
+
"sha256": "a6dc4521d6478828224fbafc33585401a47bfeb0e56e07b5d2886e8a29937f2f",
|
|
34
|
+
"mediaType": "application/json"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "coverage.json",
|
|
38
|
+
"sha256": "d55b9b98d48323b4659dfee6531ec83ec538f2084325412b7188bf85ad68b01b",
|
|
39
|
+
"mediaType": "application/json"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,9 +11,9 @@ Include any caller-supplied rendered investigation time allowance unchanged amon
|
|
|
11
11
|
3. Read `threat-model.md` to map the architecture and security boundaries. Verify material claims against their consumers. Preserve supplied models unchanged; for generated models, retain the model in an early semantic checkpoint with `complete: false` and `findings: []` if no findings are available yet. Keep its evidence through final assembly. Architecture mapping alone does not establish completed audit coverage.
|
|
12
12
|
4. Group promising source-backed questions by attacker, protected asset, entry points, expected controls, sensitive operations, and source anchors. Keep distinct boundaries and mechanisms visible. These investigation packets are working context, not another required artifact or ledger.
|
|
13
13
|
5. Delegate independent packet groups when parallel review is useful, within the caller's worker allowance. Send the shared worker instructions and focused task below with the assigned packets and relevant context. Choose assignments by complexity and shared code rather than a fixed worker or file count. Supporting code may explain an in-scope finding, but its affected entry point, control, or operation must remain in scope.
|
|
14
|
-
6. Preserve returned candidates and counterevidence through the bound `record_codex_security_scan_draft` tool when available, before combining or validating them. Use `complete: false`, stable `candidateId` values, and `
|
|
14
|
+
6. Preserve returned candidates and counterevidence through the bound `record_codex_security_scan_draft` tool when available, before combining or validating them. Use `complete: false`, stable `candidateId` values, and `reviewState.deferred` entries with a reason and the original payload under `candidate`. Checkpoint validation decisions: accepted findings retain `provenance.candidateId`; rejections retain the candidate identity, original evidence, and source-backed counterevidence on a `rejected` coverage surface. Record reviewed surfaces, exclusions, and unresolved questions without creating extra receipts or claiming exhaustive coverage. Group observations only when they share the broken control and effective remediation, preserving affected routes, operations, and locations; a shared CWE alone is not a reason to merge.
|
|
15
15
|
7. Independently validate each unique finding against local source. Establish the attacker, entry point, controlled dataflow, transformations, violated boundary, broken control, sensitive operation, prerequisites, effective mitigations, counterevidence, and impact. Use the source-disclosure path below for embedded secrets. State configuration, dependency, and deployment prerequisites without requiring proof of a live deployment or runtime reproduction. A caller-controlled library or parser input can establish a boundary. Reject claims with concrete counterevidence; retain material proof gaps as uncertainty or deferred work. Calibrate severity from these facts.
|
|
16
|
-
8. Assemble `scope`, `threatModel`, `findings`, and `
|
|
16
|
+
8. Assemble `scope`, `threatModel`, `findings`, and `reviewState` following `final-report.md` and `schemas/tools/scan-draft.schema.json`. Follow `finding-detail-fields.md` for rich evidence and narrative fields. Preserve genuine findings, source provenance, supplied assumptions, exclusions, pending work, and uncertainty. Examples under `examples/completed-scan/` illustrate shape, not values to copy.
|
|
17
17
|
|
|
18
18
|
Keep discovery, validation, and attack-path reasoning within this one self-contained audit; do not invoke separate phase skills or add ranking phases, per-file ledgers, separate phase worker pools, or receipt files.
|
|
19
19
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Final Scan Results
|
|
2
2
|
|
|
3
|
-
The canonical inputs are `scan-manifest.json
|
|
3
|
+
The canonical inputs are `scan-manifest.json` and `findings.json`. The host validates and seals those documents and evidence, then projects `report.md`. Do not author or repair that report, parse it back into findings, or use it to fill gaps in canonical evidence. Follow `artifact-storage.md` for retained files.
|
|
4
4
|
|
|
5
5
|
## Ownership And Submission
|
|
6
6
|
|
|
7
7
|
| Caller | Submit | Completion owner |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
-
| Workbench Standard or diff | `record_codex_security_scan_draft({ scanId, handoffClaimToken?, scope?, threatModel?, findings,
|
|
9
|
+
| Workbench Standard or diff | `record_codex_security_scan_draft({ scanId, handoffClaimToken?, scope?, threatModel?, findings, reviewState, complete? })` | Parent calls `complete_codex_security_scan` after an accepted final draft |
|
|
10
10
|
| Bound Deep Standard worker | Its bound semantic draft tool | Deep coordinator |
|
|
11
11
|
| Workbench Deep parent | Coordinator's accepted aggregate | Coordinator finalizes the scan and returns `completion` with the sealed manifest |
|
|
12
12
|
| SDK-owned scan | Unsealed canonical files with the SDK-provided identity and metadata, using a bound draft tool when supplied | SDK; do not call completion or a finalizer |
|
|
@@ -27,15 +27,15 @@ Use `schemas/tools/scan-draft.schema.json` for new drafts and `finding-detail-fi
|
|
|
27
27
|
|
|
28
28
|
Use `scope` for reviewed context, artifacts, runtime/test status, validation mode, and limitations. Preserve the completed canonical `threatModel`, including source citations and uncertainty; do not reconstruct it from the final findings. A supplied or completed Markdown model is retained as `{ "format": "markdown", "content": "<exact model text>" }`. A historical context file can supply missing content but must not replace a newer canonical model.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Review State And Pending Work
|
|
31
31
|
|
|
32
|
-
Keep unfinished requested work and essential in-scope proof gaps in `
|
|
32
|
+
Keep unfinished requested work and essential in-scope proof gaps in `reviewState.deferred`. Retain optional follow-up in `reviewState.openQuestions`. These notes are checkpoint bookkeeping, not measured file coverage, and do not change the scan execution outcome.
|
|
33
33
|
|
|
34
34
|
Standard and diff drafts use `{ surfaces, explicitExclusions, deferred }`. Give surfaces meaningful labels and schema-defined dispositions, preserving saved surface IDs in updates. Retain reasons and evidence for rejected, not-applicable, and follow-up work. Open questions may be strings or `{ question, followUpPrompt? }` objects. An open question does not prevent the configured review from finishing.
|
|
35
35
|
|
|
36
|
-
Preserve each saved deferred `id` or `candidateId`, use each deferred ID only once, and copy IDs assigned by the draft response into later updates. Close a generic saved task in the final Standard or diff draft with `
|
|
36
|
+
Preserve each saved deferred `id` or `candidateId`, use each deferred ID only once, and copy IDs assigned by the draft response into later updates. Close a generic saved task in the final Standard or diff draft with `reviewState.resolvedDeferred: [{ id, reason }]`; keep unfinished tasks deferred and update linked surfaces by ID. Candidate-linked tasks close through findings or terminal dispositions. Deep parents cannot close worker tasks; original checkpoints remain unchanged.
|
|
37
37
|
|
|
38
|
-
The workbench
|
|
38
|
+
The workbench assigns IDs to new surfaces and derives a finding's `identity` when omitted. Review notes do not measure file coverage; do not add reviewed-surface tables or file-coverage claims to the report. Omit host-owned target/scope metadata, `reviewState.inventoryStrategy`, `reviewState.receiptRefs`, and each active finding's `findingId`, `occurrenceId` and `fingerprints` from semantic drafts. SDK-authored canonical files follow `scan-contract.md` and the SDK's supplied metadata.
|
|
39
39
|
|
|
40
40
|
For compact diff candidates, map recorded outcomes in this order:
|
|
41
41
|
|
|
@@ -58,6 +58,16 @@ For a required phase, artifact, or completion failure, preserve and report the a
|
|
|
58
58
|
|
|
59
59
|
On explicit cancellation, stop additional model work. Use retained results and exports, distinguishing validated findings from pending candidates and recording incomplete scope. A stopped scan with no findings is not a clean-scan conclusion.
|
|
60
60
|
|
|
61
|
+
### Historical findings and coverage in workbench Standard and diff drafts
|
|
62
|
+
|
|
63
|
+
The plugins bundled in `npm-v0.1.32` through `npm-v0.6.0` preserve the saved `identity` of an unambiguously matched finding when a revision omits it. Supplying a different anchor can leave both findings active. These releases have no supported operation to supersede the old identity. In 0.1.32, updating a surface by its generated ID can also leave both dispositions active if the original checkpoint omitted the ID.
|
|
64
|
+
|
|
65
|
+
On builds containing `e6c7b28` (after `npm-v0.6.0`), first establish the corrected `identity` from independent evidence. Use this procedure only if no checkpoint has already saved the corrected identity alongside the original. If both identities are active, leave the scan unsealed and report the conflict. [Finding recovery change #1310](https://github.com/openai/codex-security/pull/1310)
|
|
66
|
+
|
|
67
|
+
Submit the revision with its corrected identity through `record_codex_security_scan_draft` with `complete: false`. Put each distinct prior version directly in the revision's `provenance.previousFindings` array. Copy the full saved finding, including its identity, evidence and provenance, omitting only its own `provenance.previousFindings`. The workbench restores nested history for each unambiguous match. Before submitting the final draft, verify in `findings.json` and `coverage.json` that only the corrected identity is active for this finding, its prior versions are in its history, and other findings and independently pending work are intact.
|
|
68
|
+
|
|
69
|
+
A finding or a `rejected` or `not_applicable` disposition for the same candidate can resolve a `needs_follow_up` surface. Since `npm-v0.2.0`, `coverage.resolvedDeferred` closes generic tasks by saved ID and reason. Omission alone does not retire a surface or explicit exclusion. There is no general operation to remove either entry by request or to migrate a copy of a 0.1.32 scan for these corrections. If the required correction is unsupported or still absent from the saved result, leave the scan unsealed, preserve its checkpoints and outstanding work, and report which entry still needs correction.
|
|
70
|
+
|
|
61
71
|
## Response
|
|
62
72
|
|
|
63
73
|
Link the generated `report.md` as the primary readable result. Mention material limitations and specific follow-up work; offer export, patching, or tracking only when relevant to the request. Do not initiate additional external actions or scans without authorization.
|