@openai/codex-security 0.1.23 → 0.1.25
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 +200 -23
- package/_bundled_plugin/.codex-plugin/plugin.json +1 -1
- package/_bundled_plugin/.mcp.json +1 -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/references/scan-contract.md +10 -0
- package/_bundled_plugin/scripts/deep_scan_workbench.py +6 -1
- package/_bundled_plugin/scripts/finalize_scan_contract.py +27 -78
- package/_bundled_plugin/scripts/generate_in_scope_files.py +2 -8
- package/_bundled_plugin/scripts/generate_rank_input.py +1 -5
- package/_bundled_plugin/scripts/rank_preview.py +12 -1
- package/_bundled_plugin/scripts/report_projection.py +8 -14
- package/_bundled_plugin/scripts/validate_scan_contract.py +1 -3
- package/_bundled_plugin/scripts/windows_scan_local_files.py +5 -15
- package/_bundled_plugin/scripts/workbench_cli.py +14 -1
- package/_bundled_plugin/scripts/workbench_dashboard.py +41 -18
- package/_bundled_plugin/scripts/workbench_db.py +127 -541
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +31 -13
- package/_bundled_plugin/scripts/workbench_findings.py +8 -3
- package/_bundled_plugin/scripts/workbench_native_indexes.py +1 -2
- package/_bundled_plugin/scripts/workbench_publication.py +520 -0
- package/_bundled_plugin/scripts/workbench_remediation.py +37 -0
- package/_bundled_plugin/scripts/workbench_saved_results.py +298 -90
- package/_bundled_plugin/scripts/workbench_scan_history.py +375 -68
- package/_bundled_plugin/scripts/workbench_scan_usage.py +9 -33
- package/_bundled_plugin/scripts/workbench_schema.py +49 -21
- package/_bundled_plugin/scripts/workbench_target.py +96 -17
- package/_bundled_plugin/scripts/workbench_validation.py +1 -5
- package/_bundled_plugin/skills/assess-patch-risk/SKILL.md +1 -5
- package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +6 -1
- package/dist/api.d.ts +18 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +350 -28
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +35 -3
- package/dist/auth.js.map +1 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +118 -35
- package/dist/cli.js.map +1 -1
- package/dist/component-plan.d.ts.map +1 -1
- package/dist/component-plan.js +4 -2
- package/dist/component-plan.js.map +1 -1
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +21 -6
- package/dist/component-scan.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +46 -2
- package/dist/config.js.map +1 -1
- package/dist/cost.d.ts +1 -0
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +23 -11
- package/dist/cost.js.map +1 -1
- package/dist/deduplication/checkpointed-review.d.ts.map +1 -1
- package/dist/deduplication/checkpointed-review.js +2 -1
- package/dist/deduplication/checkpointed-review.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts +3 -0
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +122 -36
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/deduplication-prompts.d.ts +4 -3
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
- package/dist/deduplication/deduplication-prompts.js +18 -9
- package/dist/deduplication/deduplication-prompts.js.map +1 -1
- package/dist/deduplication/deduplication-reviewer.d.ts +2 -7
- package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
- package/dist/deduplication/deduplication-reviewer.js +46 -24
- package/dist/deduplication/deduplication-reviewer.js.map +1 -1
- package/dist/deduplication/deduplication.d.ts.map +1 -1
- package/dist/deduplication/deduplication.js +186 -23
- package/dist/deduplication/deduplication.js.map +1 -1
- package/dist/deduplication/scan.d.ts +9 -1
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +24 -7
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/deep-progress.d.ts +21 -0
- package/dist/deep-progress.d.ts.map +1 -0
- package/dist/deep-progress.js +108 -0
- package/dist/deep-progress.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mock-scan.d.ts +4 -0
- package/dist/mock-scan.d.ts.map +1 -0
- package/dist/mock-scan.js +210 -0
- package/dist/mock-scan.js.map +1 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +2 -2
- package/dist/publish.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +54 -14
- package/dist/runtime.js.map +1 -1
- package/dist/scan-activity.d.ts.map +1 -1
- package/dist/scan-activity.js +12 -2
- package/dist/scan-activity.js.map +1 -1
- package/dist/scan-comparison.d.ts +11 -2
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +237 -39
- package/dist/scan-comparison.js.map +1 -1
- package/dist/scan-dashboard.d.ts +3 -1
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +70 -3
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +21 -0
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/server/api.d.ts +6 -0
- package/dist/server/api.d.ts.map +1 -0
- package/dist/server/api.js +4 -0
- package/dist/server/api.js.map +1 -0
- package/dist/server/dashboard/app.css +1 -1
- package/dist/server/embeddings.d.ts +2 -1
- package/dist/server/embeddings.d.ts.map +1 -1
- package/dist/server/embeddings.js +8 -3
- package/dist/server/embeddings.js.map +1 -1
- package/dist/server/index.js +2 -28
- package/dist/server/index.js.map +1 -1
- package/dist/server/serve.d.ts +2 -0
- package/dist/server/serve.d.ts.map +1 -0
- package/dist/server/serve.js +28 -0
- package/dist/server/serve.js.map +1 -0
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +3 -5
- package/dist/targets.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +10 -5
|
@@ -215,18 +215,10 @@ def _codex_state_database() -> Path | None:
|
|
|
215
215
|
return path.resolve() if path.is_file() and os.access(path, os.R_OK) else None
|
|
216
216
|
|
|
217
217
|
configured_home = os.environ.get("CODEX_HOME", "").strip()
|
|
218
|
-
codex_home = (
|
|
219
|
-
Path(configured_home).expanduser()
|
|
220
|
-
if configured_home
|
|
221
|
-
else Path.home() / ".codex"
|
|
222
|
-
)
|
|
218
|
+
codex_home = Path(configured_home).expanduser() if configured_home else Path.home() / ".codex"
|
|
223
219
|
configured_sqlite_home = os.environ.get("CODEX_SQLITE_HOME", "").strip()
|
|
224
220
|
search_roots = [
|
|
225
|
-
*(
|
|
226
|
-
[Path(configured_sqlite_home).expanduser()]
|
|
227
|
-
if configured_sqlite_home
|
|
228
|
-
else []
|
|
229
|
-
),
|
|
221
|
+
*([Path(configured_sqlite_home).expanduser()] if configured_sqlite_home else []),
|
|
230
222
|
codex_home,
|
|
231
223
|
codex_home / "sqlite",
|
|
232
224
|
]
|
|
@@ -363,9 +355,7 @@ def _require_state_columns(
|
|
|
363
355
|
}
|
|
364
356
|
columns = {str(row["name"]) for row in connection.execute(statements[table])}
|
|
365
357
|
if not required.issubset(columns):
|
|
366
|
-
raise ValueError(
|
|
367
|
-
"Codex state graph does not expose the required thread columns."
|
|
368
|
-
)
|
|
358
|
+
raise ValueError("Codex state graph does not expose the required thread columns.")
|
|
369
359
|
|
|
370
360
|
|
|
371
361
|
def _rollout_path(value: object) -> Path | None:
|
|
@@ -411,9 +401,7 @@ def _read_rollout_usage(
|
|
|
411
401
|
event = json.loads(raw_line)
|
|
412
402
|
except (UnicodeError, ValueError):
|
|
413
403
|
if line_number == 1:
|
|
414
|
-
raise ValueError(
|
|
415
|
-
"The rollout session metadata is unreadable."
|
|
416
|
-
) from None
|
|
404
|
+
raise ValueError("The rollout session metadata is unreadable.") from None
|
|
417
405
|
if boundary_reached:
|
|
418
406
|
warnings.add("rollout_record_invalid")
|
|
419
407
|
continue
|
|
@@ -456,10 +444,7 @@ def _read_rollout_usage(
|
|
|
456
444
|
warnings.add("thread_outside_scan_window")
|
|
457
445
|
return total, warnings
|
|
458
446
|
boundary_reached = True
|
|
459
|
-
elif (
|
|
460
|
-
event.get("type") == "event_msg"
|
|
461
|
-
and payload.get("type") == "token_count"
|
|
462
|
-
):
|
|
447
|
+
elif event.get("type") == "event_msg" and payload.get("type") == "token_count":
|
|
463
448
|
inherited_usage = _token_snapshot(payload)
|
|
464
449
|
if inherited_usage is not None:
|
|
465
450
|
previous = inherited_usage
|
|
@@ -538,9 +523,7 @@ def _token_snapshot(payload: Mapping[str, Any]) -> dict[str, int] | None:
|
|
|
538
523
|
usage = info.get("total_token_usage")
|
|
539
524
|
if not isinstance(usage, dict):
|
|
540
525
|
return None
|
|
541
|
-
cache_write = usage.get(
|
|
542
|
-
"cache_write_input_tokens", usage.get("cache_write_tokens", 0)
|
|
543
|
-
)
|
|
526
|
+
cache_write = usage.get("cache_write_input_tokens", usage.get("cache_write_tokens", 0))
|
|
544
527
|
legacy_cache_write = usage.get("cache_write_tokens")
|
|
545
528
|
input_tokens = usage.get("input_tokens")
|
|
546
529
|
cached_input_tokens = usage.get("cached_input_tokens", 0)
|
|
@@ -556,9 +539,7 @@ def _token_snapshot(payload: Mapping[str, Any]) -> dict[str, int] | None:
|
|
|
556
539
|
result: dict[str, int] = {}
|
|
557
540
|
for source_key, result_key in TOKEN_FIELDS.items():
|
|
558
541
|
value = (
|
|
559
|
-
cache_write
|
|
560
|
-
if source_key == "cache_write_input_tokens"
|
|
561
|
-
else usage.get(source_key, 0)
|
|
542
|
+
cache_write if source_key == "cache_write_input_tokens" else usage.get(source_key, 0)
|
|
562
543
|
)
|
|
563
544
|
if type(value) is not int or value < 0:
|
|
564
545
|
return None
|
|
@@ -567,10 +548,7 @@ def _token_snapshot(payload: Mapping[str, Any]) -> dict[str, int] | None:
|
|
|
567
548
|
):
|
|
568
549
|
return None
|
|
569
550
|
result[result_key] = value
|
|
570
|
-
if
|
|
571
|
-
result["cachedInputTokens"] + result["cacheWriteInputTokens"]
|
|
572
|
-
> result["inputTokens"]
|
|
573
|
-
):
|
|
551
|
+
if result["cachedInputTokens"] + result["cacheWriteInputTokens"] > result["inputTokens"]:
|
|
574
552
|
return None
|
|
575
553
|
result["totalTokens"] = result["inputTokens"] + result["outputTokens"]
|
|
576
554
|
return result
|
|
@@ -599,9 +577,7 @@ def _timestamp(value: object) -> datetime | None:
|
|
|
599
577
|
return parsed.astimezone(timezone.utc) if parsed.tzinfo is not None else None
|
|
600
578
|
|
|
601
579
|
|
|
602
|
-
def _unavailable_usage(
|
|
603
|
-
reason: str, *, warnings: set[str] | None = None
|
|
604
|
-
) -> dict[str, Any]:
|
|
580
|
+
def _unavailable_usage(reason: str, *, warnings: set[str] | None = None) -> dict[str, Any]:
|
|
605
581
|
return {
|
|
606
582
|
"coverage": "unavailable",
|
|
607
583
|
"source": "codex_rollout",
|
|
@@ -825,6 +825,17 @@ MIGRATIONS = (
|
|
|
825
825
|
ALTER TABLE finding_workflow_reviews ADD COLUMN contract_digest TEXT;
|
|
826
826
|
""",
|
|
827
827
|
),
|
|
828
|
+
(
|
|
829
|
+
40,
|
|
830
|
+
"index finding identity and comparison history",
|
|
831
|
+
"""
|
|
832
|
+
CREATE INDEX finding_occurrences_by_finding
|
|
833
|
+
ON finding_occurrences(finding_id, id);
|
|
834
|
+
|
|
835
|
+
CREATE INDEX scan_comparisons_by_after_scan
|
|
836
|
+
ON scan_comparisons(after_scan_id, before_scan_id);
|
|
837
|
+
""",
|
|
838
|
+
),
|
|
828
839
|
)
|
|
829
840
|
|
|
830
841
|
|
|
@@ -842,11 +853,21 @@ def migrate_finding_workflow_review_columns(connection: sqlite3.Connection) -> N
|
|
|
842
853
|
model = ?, effort = ?, settings_digest = ?, prompt_digest = ?, contract_digest = ?
|
|
843
854
|
WHERE workflow_id = ? AND review_key = ?""",
|
|
844
855
|
(
|
|
845
|
-
binding["version"],
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
856
|
+
binding["version"],
|
|
857
|
+
binding["codexVersion"],
|
|
858
|
+
source["repository"],
|
|
859
|
+
source["revision"],
|
|
860
|
+
source["refsDigest"],
|
|
861
|
+
source["content"],
|
|
862
|
+
scope.get("repositoryId"),
|
|
863
|
+
scope.get("allRepositories"),
|
|
864
|
+
binding["model"],
|
|
865
|
+
binding["effort"],
|
|
866
|
+
binding.get("settingsDigest"),
|
|
867
|
+
binding["promptDigest"],
|
|
868
|
+
binding["contractDigest"],
|
|
869
|
+
row["workflow_id"],
|
|
870
|
+
row["review_key"],
|
|
850
871
|
),
|
|
851
872
|
)
|
|
852
873
|
|
|
@@ -867,13 +888,22 @@ def migrate_finding_workflow_columns(connection: sqlite3.Connection) -> None:
|
|
|
867
888
|
scan_status = ?, scan_error = ?, publish_status = ?, publish_error = ?,
|
|
868
889
|
dedupe_status = ?, dedupe_error = ?, results_json = ? WHERE id = ?""",
|
|
869
890
|
(
|
|
870
|
-
state.get("repositoryPath"),
|
|
871
|
-
state.get("
|
|
872
|
-
state.get("
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
891
|
+
state.get("repositoryPath"),
|
|
892
|
+
state.get("scanRequestDigest"),
|
|
893
|
+
state.get("scanId"),
|
|
894
|
+
state.get("scanDir"),
|
|
895
|
+
state.get("artifactDigest"),
|
|
896
|
+
state.get("destination"),
|
|
897
|
+
scope.get("repositoryId"),
|
|
898
|
+
scope.get("allRepositories"),
|
|
899
|
+
stages["scan"]["status"],
|
|
900
|
+
stages["scan"].get("error"),
|
|
901
|
+
stages["publish"]["status"],
|
|
902
|
+
stages["publish"].get("error"),
|
|
903
|
+
stages["dedupe"]["status"],
|
|
904
|
+
stages["dedupe"].get("error"),
|
|
905
|
+
json.dumps(results, allow_nan=False),
|
|
906
|
+
row["id"],
|
|
877
907
|
),
|
|
878
908
|
)
|
|
879
909
|
|
|
@@ -979,12 +1009,8 @@ def apply_migrations(
|
|
|
979
1009
|
def normalize_pre_release_execution_profile_migrations(
|
|
980
1010
|
connection: sqlite3.Connection, timestamp: str
|
|
981
1011
|
) -> None:
|
|
982
|
-
scan_columns = {
|
|
983
|
-
|
|
984
|
-
}
|
|
985
|
-
workspace_columns = {
|
|
986
|
-
row["name"] for row in connection.execute("PRAGMA table_info(workspaces)")
|
|
987
|
-
}
|
|
1012
|
+
scan_columns = {row["name"] for row in connection.execute("PRAGMA table_info(scans)")}
|
|
1013
|
+
workspace_columns = {row["name"] for row in connection.execute("PRAGMA table_info(workspaces)")}
|
|
988
1014
|
legacy_columns = {"execution_model", "reasoning_effort"}
|
|
989
1015
|
renamed_columns = {
|
|
990
1016
|
"legacy_execution_model",
|
|
@@ -1091,6 +1117,10 @@ def normalize_pre_release_execution_profile_migrations(
|
|
|
1091
1117
|
|
|
1092
1118
|
def normalize_pre_release_migrations(connection: sqlite3.Connection, timestamp: str) -> None:
|
|
1093
1119
|
normalize_mirror_lineage_migrations(connection)
|
|
1120
|
+
connection.execute(
|
|
1121
|
+
"UPDATE schema_migrations SET version = 40 WHERE version = 33 AND name = ?",
|
|
1122
|
+
("index finding identity and comparison history",),
|
|
1123
|
+
)
|
|
1094
1124
|
|
|
1095
1125
|
completion_warning_migration = connection.execute(
|
|
1096
1126
|
"SELECT name FROM schema_migrations WHERE version = 25"
|
|
@@ -1332,9 +1362,7 @@ def normalize_mirror_lineage_migrations(connection: sqlite3.Connection) -> None:
|
|
|
1332
1362
|
if not any(migrations.get(version) == name for version, name in mirror_names.items()):
|
|
1333
1363
|
return
|
|
1334
1364
|
if migrations != mirror_names:
|
|
1335
|
-
raise SystemExit(
|
|
1336
|
-
"The Codex Security database has an unsupported mirror migration history."
|
|
1337
|
-
)
|
|
1365
|
+
raise SystemExit("The Codex Security database has an unsupported mirror migration history.")
|
|
1338
1366
|
for old_version, new_version in ((30, 32), (29, 31)):
|
|
1339
1367
|
connection.execute(
|
|
1340
1368
|
"UPDATE schema_migrations SET version = ? WHERE version = ? AND name = ?",
|
|
@@ -10,8 +10,9 @@ import sqlite3
|
|
|
10
10
|
import stat
|
|
11
11
|
import subprocess
|
|
12
12
|
import sys
|
|
13
|
+
import tempfile
|
|
13
14
|
from pathlib import Path
|
|
14
|
-
from typing import Any
|
|
15
|
+
from typing import Any, BinaryIO
|
|
15
16
|
|
|
16
17
|
# Some plugin hosts launch Python with safe-path isolation enabled.
|
|
17
18
|
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
@@ -127,6 +128,7 @@ def git_command(
|
|
|
127
128
|
input_data: str | bytes | None = None,
|
|
128
129
|
git_dir: Path | None = None,
|
|
129
130
|
work_tree: Path | None = None,
|
|
131
|
+
stdout_file: BinaryIO | None = None,
|
|
130
132
|
) -> subprocess.CompletedProcess[str] | subprocess.CompletedProcess[bytes]:
|
|
131
133
|
if (git_dir is None) != (work_tree is None):
|
|
132
134
|
raise ValueError("git_dir and work_tree must be provided together")
|
|
@@ -148,15 +150,20 @@ def git_command(
|
|
|
148
150
|
command.extend(["--git-dir", str(git_dir), "--work-tree", str(work_tree)])
|
|
149
151
|
full_command = [*command, *args]
|
|
150
152
|
try:
|
|
153
|
+
output_options = (
|
|
154
|
+
{"capture_output": True}
|
|
155
|
+
if stdout_file is None
|
|
156
|
+
else {"stdout": stdout_file, "stderr": subprocess.PIPE}
|
|
157
|
+
)
|
|
151
158
|
return subprocess.run(
|
|
152
159
|
full_command,
|
|
153
160
|
check=False,
|
|
154
|
-
capture_output=True,
|
|
155
161
|
env=environment,
|
|
156
162
|
text=text,
|
|
157
163
|
encoding="utf-8" if text else None,
|
|
158
164
|
errors="surrogateescape" if text else None,
|
|
159
165
|
input=input_data,
|
|
166
|
+
**output_options,
|
|
160
167
|
)
|
|
161
168
|
except FileNotFoundError:
|
|
162
169
|
# Git is optional for Codebase scans. Treat an unavailable executable like
|
|
@@ -165,13 +172,45 @@ def git_command(
|
|
|
165
172
|
return subprocess.CompletedProcess(full_command, 127, empty_output, empty_output)
|
|
166
173
|
|
|
167
174
|
|
|
168
|
-
def
|
|
175
|
+
def _update_digest_field_header(digest: Any, label: bytes, value_size: int) -> None:
|
|
169
176
|
digest.update(len(label).to_bytes(4, "big"))
|
|
170
177
|
digest.update(label)
|
|
171
|
-
digest.update(
|
|
178
|
+
digest.update(value_size.to_bytes(8, "big"))
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def update_digest_field(digest: Any, label: bytes, value: bytes) -> None:
|
|
182
|
+
_update_digest_field_header(digest, label, len(value))
|
|
172
183
|
digest.update(value)
|
|
173
184
|
|
|
174
185
|
|
|
186
|
+
def _update_digest_field_from_git(
|
|
187
|
+
digest: Any,
|
|
188
|
+
label: bytes,
|
|
189
|
+
target: Path,
|
|
190
|
+
*args: str,
|
|
191
|
+
git_dir: Path | None = None,
|
|
192
|
+
work_tree: Path | None = None,
|
|
193
|
+
) -> bool:
|
|
194
|
+
with tempfile.TemporaryFile() as output:
|
|
195
|
+
completed = git_command(
|
|
196
|
+
target,
|
|
197
|
+
*args,
|
|
198
|
+
text=False,
|
|
199
|
+
git_dir=git_dir,
|
|
200
|
+
work_tree=work_tree,
|
|
201
|
+
stdout_file=output,
|
|
202
|
+
)
|
|
203
|
+
if completed.returncode != 0:
|
|
204
|
+
return False
|
|
205
|
+
output.seek(0, os.SEEK_END)
|
|
206
|
+
value_size = output.tell()
|
|
207
|
+
_update_digest_field_header(digest, label, value_size)
|
|
208
|
+
output.seek(0)
|
|
209
|
+
for chunk in iter(lambda: output.read(1024 * 1024), b""):
|
|
210
|
+
digest.update(chunk)
|
|
211
|
+
return True
|
|
212
|
+
|
|
213
|
+
|
|
175
214
|
def worktree_content_digest(target: Path) -> str:
|
|
176
215
|
require_clean_submodule_worktrees(target)
|
|
177
216
|
repository, pathspec = git_worktree_context(target)
|
|
@@ -203,7 +242,11 @@ def worktree_content_digest_for_context(
|
|
|
203
242
|
git_dir: Path | None = None,
|
|
204
243
|
work_tree: Path | None = None,
|
|
205
244
|
) -> str:
|
|
206
|
-
|
|
245
|
+
digest = hashlib.sha256()
|
|
246
|
+
update_digest_field(digest, b"format", b"codex-security-snapshot/v1")
|
|
247
|
+
tracked_ok = _update_digest_field_from_git(
|
|
248
|
+
digest,
|
|
249
|
+
b"tracked-diff",
|
|
207
250
|
repository,
|
|
208
251
|
"diff",
|
|
209
252
|
"--binary",
|
|
@@ -228,11 +271,8 @@ def worktree_content_digest_for_context(
|
|
|
228
271
|
git_dir=git_dir,
|
|
229
272
|
work_tree=work_tree,
|
|
230
273
|
)
|
|
231
|
-
if
|
|
274
|
+
if not tracked_ok or untracked is None:
|
|
232
275
|
raise SystemExit("Could not snapshot the selected working-tree changes.")
|
|
233
|
-
digest = hashlib.sha256()
|
|
234
|
-
update_digest_field(digest, b"format", b"codex-security-snapshot/v1")
|
|
235
|
-
update_digest_field(digest, b"tracked-diff", tracked)
|
|
236
276
|
for raw_path in sorted(path for path in untracked.split(b"\0") if path):
|
|
237
277
|
relative_path = os.fsdecode(raw_path)
|
|
238
278
|
path = (work_tree or repository) / relative_path
|
|
@@ -374,21 +414,55 @@ def git_directory_snapshot_paths(target: Path) -> list[Path] | None:
|
|
|
374
414
|
if repository_root is None:
|
|
375
415
|
return None
|
|
376
416
|
repository, pathspec = git_worktree_context(target)
|
|
417
|
+
scope = repository / pathspec
|
|
418
|
+
scope_depth = len(Path(pathspec).parts)
|
|
419
|
+
matching_prefixes: dict[str, bool] = {}
|
|
420
|
+
listing_args: list[str] = []
|
|
421
|
+
inventory_pathspec = pathspec
|
|
422
|
+
if scope_depth:
|
|
423
|
+
if any(
|
|
424
|
+
not character.isascii() and character.lower() != character.upper()
|
|
425
|
+
for character in pathspec
|
|
426
|
+
):
|
|
427
|
+
# Git's icase pathspecs do not cover Unicode case aliases.
|
|
428
|
+
inventory_pathspec = "."
|
|
429
|
+
else:
|
|
430
|
+
listing_args.append("--no-literal-pathspecs")
|
|
431
|
+
inventory_pathspec = f":(icase,literal){pathspec}"
|
|
377
432
|
listed = git_bytes(
|
|
378
433
|
repository,
|
|
434
|
+
*listing_args,
|
|
379
435
|
"ls-files",
|
|
380
436
|
"--cached",
|
|
381
437
|
"--others",
|
|
382
438
|
"--exclude-standard",
|
|
383
439
|
"-z",
|
|
384
440
|
"--",
|
|
385
|
-
|
|
441
|
+
inventory_pathspec,
|
|
386
442
|
)
|
|
387
443
|
if listed is None:
|
|
388
444
|
raise SystemExit("Could not inspect files in the selected Git working tree.")
|
|
389
445
|
paths: list[Path] = []
|
|
390
446
|
for raw_path in (raw_path for raw_path in listed.split(b"\0") if raw_path):
|
|
391
|
-
|
|
447
|
+
relative = Path(os.fsdecode(raw_path))
|
|
448
|
+
path = repository / relative
|
|
449
|
+
if scope_depth:
|
|
450
|
+
if len(relative.parts) <= scope_depth:
|
|
451
|
+
continue
|
|
452
|
+
# Git's index spelling can differ after a case-only directory rename.
|
|
453
|
+
# Compare each scope-depth prefix once, without following symlink leaves.
|
|
454
|
+
prefix = repository.joinpath(*relative.parts[:scope_depth])
|
|
455
|
+
key = str(prefix)
|
|
456
|
+
if key not in matching_prefixes:
|
|
457
|
+
try:
|
|
458
|
+
matching_prefixes[key] = prefix.samefile(scope)
|
|
459
|
+
except (FileNotFoundError, NotADirectoryError):
|
|
460
|
+
matching_prefixes[key] = False
|
|
461
|
+
# realpath spelling is not a filesystem identity on case-insensitive
|
|
462
|
+
# POSIX volumes; WindowsPath equality also folds distinct names.
|
|
463
|
+
if not matching_prefixes[key]:
|
|
464
|
+
continue
|
|
465
|
+
path = scope.joinpath(*relative.parts[scope_depth:])
|
|
392
466
|
try:
|
|
393
467
|
metadata = path.lstat()
|
|
394
468
|
except FileNotFoundError:
|
|
@@ -411,7 +485,7 @@ def git_directory_snapshot_paths(target: Path) -> list[Path] | None:
|
|
|
411
485
|
for nested_path in path.rglob("*")
|
|
412
486
|
if ".git" not in nested_path.relative_to(path).parts
|
|
413
487
|
)
|
|
414
|
-
return sorted(
|
|
488
|
+
return sorted({str(path): path for path in paths}.values(), key=str)
|
|
415
489
|
|
|
416
490
|
|
|
417
491
|
def source_directory_snapshot_paths(target: Path) -> list[Path]:
|
|
@@ -424,7 +498,10 @@ def source_directory_snapshot_paths(target: Path) -> list[Path]:
|
|
|
424
498
|
paths.append(path)
|
|
425
499
|
metadata = path.lstat()
|
|
426
500
|
# Name-surrogate reparse points include Windows directory junctions.
|
|
427
|
-
if
|
|
501
|
+
if (
|
|
502
|
+
stat.S_ISDIR(metadata.st_mode)
|
|
503
|
+
and not getattr(metadata, "st_reparse_tag", 0) & 0x20000000
|
|
504
|
+
):
|
|
428
505
|
pending.append(path)
|
|
429
506
|
return sorted(paths)
|
|
430
507
|
|
|
@@ -438,7 +515,11 @@ def directory_content_digest(
|
|
|
438
515
|
excluded_relative.append(path.relative_to(target))
|
|
439
516
|
except ValueError:
|
|
440
517
|
continue
|
|
441
|
-
paths =
|
|
518
|
+
paths = (
|
|
519
|
+
source_directory_snapshot_paths(target)
|
|
520
|
+
if include_ignored
|
|
521
|
+
else git_directory_snapshot_paths(target)
|
|
522
|
+
)
|
|
442
523
|
if paths is None:
|
|
443
524
|
paths = sorted(target.rglob("*"))
|
|
444
525
|
digest = hashlib.sha256()
|
|
@@ -560,9 +641,7 @@ def copy_git_worktree_files(source: Path, destination: Path, excluded: tuple[Pat
|
|
|
560
641
|
if nested_git_dir is None:
|
|
561
642
|
raise SystemExit(f"Could not inspect nested Git working tree: {relative}")
|
|
562
643
|
copy_git_worktree_files(source_path, destination_path, excluded)
|
|
563
|
-
(destination_path / ".git").write_text(
|
|
564
|
-
f"gitdir: {nested_git_dir}\n", encoding="utf-8"
|
|
565
|
-
)
|
|
644
|
+
(destination_path / ".git").write_text(f"gitdir: {nested_git_dir}\n", encoding="utf-8")
|
|
566
645
|
else:
|
|
567
646
|
raise SystemExit(f"Unsupported Git working-tree file type: {relative}")
|
|
568
647
|
copied_target = destination if pathspec == "." else destination / pathspec
|
|
@@ -58,11 +58,7 @@ def user_text(value: str | None) -> str | None:
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
def user_context_argument(args: argparse.Namespace) -> str | None:
|
|
61
|
-
value = (
|
|
62
|
-
sys.stdin.read()
|
|
63
|
-
if getattr(args, "user_context_stdin", False)
|
|
64
|
-
else args.user_context
|
|
65
|
-
)
|
|
61
|
+
value = sys.stdin.read() if getattr(args, "user_context_stdin", False) else args.user_context
|
|
66
62
|
return user_text(value)
|
|
67
63
|
|
|
68
64
|
|
|
@@ -60,11 +60,7 @@ Return both a concise Markdown report and a JSON object conforming to [`../../sc
|
|
|
60
60
|
7. top risk drivers, protective factors, and status-quo risk; and
|
|
61
61
|
8. unknowns plus the bounded evidence plan when held.
|
|
62
62
|
|
|
63
|
-
This skill lives at `<plugin-root>/skills/assess-patch-risk/SKILL.md`, so
|
|
64
|
-
`<plugin-root>` is two directories up. Resolve `<python_command>` to the
|
|
65
|
-
configured Python interpreter (`"$PYTHON"` in POSIX shells or
|
|
66
|
-
`& "$env:PYTHON"` in PowerShell), otherwise use `python` on Windows and
|
|
67
|
-
`python3` on Unix-like hosts.
|
|
63
|
+
This skill lives at `<plugin-root>/skills/assess-patch-risk/SKILL.md`, so `<plugin-root>` is two directories up. Resolve `<python_command>` to the configured Python interpreter (`"$PYTHON"` in POSIX shells or `& "$env:PYTHON"` in PowerShell), otherwise use `python` on Windows and `python3` on Unix-like hosts.
|
|
68
64
|
|
|
69
65
|
Before returning the result, validate the JSON from any working directory with:
|
|
70
66
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Use this guidance after attack-path facts, reachability, and counterevidence are established.
|
|
4
4
|
|
|
5
5
|
-- Considerations for severity / criticality re-rating --
|
|
6
|
+
|
|
6
7
|
- For `high` and above, the impact must be materially security-relevant (for example: account takeover, auth bypass, meaningful privilege escalation, significant sensitive data exposure/exfiltration, credible RCE, or similarly severe compromise), not simply a bug or strange behavior
|
|
7
8
|
- For a finding to remain `high` or `critical`, the exploitation path and impact should be clear enough that a professional security reviewer would not need a long speculative argument to justify it.
|
|
8
9
|
- Do **not** treat ordinary code bugs as high/critical security issues just because they are bugs or because the scanner labeled them that way.
|
|
@@ -13,6 +14,7 @@ Use this guidance after attack-path facts, reachability, and counterevidence are
|
|
|
13
14
|
- If it is actually provable that there is no bug at all (the description is entirely wrong or made up and you actually got that real proof that it is so), then label it as `ignore` for criticality to mark a false-positive.
|
|
14
15
|
|
|
15
16
|
Non-exhaustive examples of vulnerabilities that often support `critical` when evidenced in code and context:
|
|
17
|
+
|
|
16
18
|
- Credible RCE or arbitrary code execution (command injection, LFI exec, trivial memory corruption exploits, etc.). Requires actual proof that attacker input causes this from an in-scope attack surface.
|
|
17
19
|
- Real XSS with meaningful proven impact (for example session/token theft, account compromise, privileged action execution, etc)
|
|
18
20
|
- Account takeover or strong authentication bypass, especially if it is 0-click
|
|
@@ -27,6 +29,7 @@ Non-exhaustive examples of vulnerabilities that often support `critical` when ev
|
|
|
27
29
|
- etc, other bugs not listed which follow this level of critical severity and impact; with actual proof that these bugs are reachable from in-scope attack-surface.
|
|
28
30
|
|
|
29
31
|
Non-exhaustive examples of vulnerabilities that often support `high` when evidenced in code and context:
|
|
32
|
+
|
|
30
33
|
- Server Side Request Forgery where there is actual proof that (1) an attacker can control the url being requested (bypassing protections around that) from in-scope attack-surface and (2) there are likely other local/lan/cloud services which can be reached to show actual impact. Be careful with reporting webhooks unless there is clear proof that it is dangerous, but do not treat a product-intended webhook/download/callback feature or optional operator allow/deny list as suppression evidence when attacker-controlled destinations can still reach internal, metadata, file-backed, redirect, or side-effecting targets.
|
|
31
34
|
- Exploitable memory corruption with clear, major impact or ease of exploitation
|
|
32
35
|
- Arbitrary file read that exposes less-sensitive user data or source code (if you have actual proof it reveals env secrets, then it is critical)
|
|
@@ -42,6 +45,7 @@ Non-exhaustive examples of vulnerabilities that often support `high` when eviden
|
|
|
42
45
|
- Deserialization, SSTI, plugin abuse, macro / template abuse, or interpreter abuse where dangerous primitives are clearly reachable and impactful, but code execution or compromise is not fully proven to the standard needed for critical.
|
|
43
46
|
|
|
44
47
|
Strong factors that often push a plausible `high` up to `critical`:
|
|
48
|
+
|
|
45
49
|
- Unauthenticated or near-unauthenticated reachability from the internet or other broad in-scope surfaces.
|
|
46
50
|
- 0-click or extremely low-friction exploitation.
|
|
47
51
|
- Cross-tenant / cross-boundary impact rather than same-user or same-tenant impact.
|
|
@@ -50,6 +54,7 @@ Strong factors that often push a plausible `high` up to `critical`:
|
|
|
50
54
|
- Clear proof of code execution, full account takeover, or crown-jewel secret access rather than only a plausible path.
|
|
51
55
|
|
|
52
56
|
Examples that usually should not remain `high`/`critical` without very strong proof of it leading to the class of vulnerabilities above:
|
|
57
|
+
|
|
53
58
|
- Generic correctness/reliability bugs
|
|
54
59
|
- Strange edge cases with unclear attacker value
|
|
55
60
|
- Low-impact information leaks
|
|
@@ -70,6 +75,7 @@ Examples that usually should not remain `high`/`critical` without very strong pr
|
|
|
70
75
|
- Arbitrary file read limited to public files, low-sensitivity files, or source fragments with no realistic security consequence.
|
|
71
76
|
|
|
72
77
|
High/Critical acceptance checklist (all should be true, unless the threat model strongly justifies an exception):
|
|
78
|
+
|
|
73
79
|
- In-scope component
|
|
74
80
|
- Realistic attacker
|
|
75
81
|
- Reasonable in-scope attack surface
|
|
@@ -106,7 +112,6 @@ Final policy-adjustment guidance:
|
|
|
106
112
|
- `none` does not increase likelihood based on exposure
|
|
107
113
|
- Then decide reportability using the existing facts:
|
|
108
114
|
- if repository evidence does not establish a realistic lower-privileged in-scope attacker path, set `ignore`
|
|
109
|
-
- if the path is internal-only, developer-only, operator-only, localhost-only, privileged-local, or otherwise not meaningfully reportable in context, set `ignore`
|
|
110
115
|
|
|
111
116
|
Do not suppress solely because the surface is private or internal when repository evidence still shows a meaningful authorization, trust-boundary, identity, or security-control regression in a real product or production-service workflow. In those cases, internal exposure should usually reduce likelihood or confidence rather than force `ignore`.
|
|
112
117
|
|
package/dist/api.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { CodexLoginHandle, type AccountStatus } from "./auth.js";
|
|
3
3
|
import { type CodexSecurityConfig, type JsonObject } from "./config.js";
|
|
4
4
|
import { type ScanCost, type ScanSessionEvent } from "./cost.js";
|
|
5
|
+
import { type DeepScanProgress } from "./deep-progress.js";
|
|
5
6
|
import { ScanResult } from "./result.js";
|
|
6
7
|
import type { SeverityLevel } from "./models.js";
|
|
7
8
|
import { type ScanActivity } from "./scan-activity.js";
|
|
@@ -16,6 +17,8 @@ export interface DeepScanOptions {
|
|
|
16
17
|
maxTimeHours?: number;
|
|
17
18
|
}
|
|
18
19
|
export interface ScanOptions extends DeepScanOptions {
|
|
20
|
+
/** Save synthetic Standard scan results without calling Codex or a model. */
|
|
21
|
+
mock?: boolean;
|
|
19
22
|
/** Opt into a durable scan -> custom publication -> dedupe workflow. */
|
|
20
23
|
workflowId?: string;
|
|
21
24
|
auth?: ScanAuthMode;
|
|
@@ -33,7 +36,8 @@ export interface ScanOptions extends DeepScanOptions {
|
|
|
33
36
|
expectedPluginVersion?: string;
|
|
34
37
|
failureSeverity?: SeverityLevel;
|
|
35
38
|
maxCostUsd?: number;
|
|
36
|
-
onCost?: (cost: Readonly<ScanCost
|
|
39
|
+
onCost?: (cost: Readonly<ScanCost>, maxCostUsd?: number) => void;
|
|
40
|
+
onBudgetApproaching?: (budget: ScanBudget) => number | undefined | Promise<number | undefined>;
|
|
37
41
|
onOutputArchived?: (archiveDir: string) => void;
|
|
38
42
|
onOutputDirReady?: (scanDir: string) => void;
|
|
39
43
|
onAuthentication?: (authentication: ScanAuthentication) => void;
|
|
@@ -43,6 +47,7 @@ export interface ScanOptions extends DeepScanOptions {
|
|
|
43
47
|
onActivity?: (activity: ScanActivity) => void;
|
|
44
48
|
onSessionEvent?: (event: ScanSessionEvent) => void;
|
|
45
49
|
onProgress?: (progress: ScanProgress) => void;
|
|
50
|
+
onDeepProgress?: (progress: DeepScanProgress) => void;
|
|
46
51
|
onWorkerStatus?: (status: ScanWorkerStatus) => void;
|
|
47
52
|
onWarning?: (warning: string, details?: ScanWarningDetails) => void;
|
|
48
53
|
onObserverError?: (observer: ScanObserverName, error: unknown) => void;
|
|
@@ -63,6 +68,9 @@ export interface ValidationResult {
|
|
|
63
68
|
export declare const SCAN_AUTH_MODES: readonly ["auto", "chatgpt", "api-key"];
|
|
64
69
|
export type ScanAuthMode = (typeof SCAN_AUTH_MODES)[number];
|
|
65
70
|
export type ScanAuthentication = {
|
|
71
|
+
method: "command";
|
|
72
|
+
verified: false;
|
|
73
|
+
} | {
|
|
66
74
|
method: "api_key";
|
|
67
75
|
source: "OPENAI_API_KEY" | "CODEX_API_KEY" | "OPENROUTER_API_KEY" | "FIREWORKS_API_KEY";
|
|
68
76
|
verified: false;
|
|
@@ -83,7 +91,12 @@ export interface ScanReconnectDetails {
|
|
|
83
91
|
export interface ScanWarningDetails {
|
|
84
92
|
kind: "target_changed";
|
|
85
93
|
}
|
|
86
|
-
|
|
94
|
+
export interface ScanBudget {
|
|
95
|
+
maxCostUsd: number;
|
|
96
|
+
cost: Readonly<ScanCost>;
|
|
97
|
+
signal: AbortSignal;
|
|
98
|
+
}
|
|
99
|
+
type ScanObserverName = "onAuthentication" | "onCost" | "onOutputArchived" | "onOutputDirReady" | "onScanStarted" | "onTrustedAccessStatus" | "onReconnect" | "onActivity" | "onSessionEvent" | "onProgress" | "onDeepProgress" | "onWorkerStatus" | "onWarning";
|
|
87
100
|
export interface ScanPreflight extends DeepScanOptions {
|
|
88
101
|
repository: string;
|
|
89
102
|
target: NormalizedTarget;
|
|
@@ -127,7 +140,9 @@ export declare function listRepositoryFindings(workbench: (args: readonly string
|
|
|
127
140
|
export declare function createSecurity(config?: CodexSecurityConfig): CodexSecurity;
|
|
128
141
|
export declare function createSecurityInternal(config: CodexSecurityConfig | undefined, runtimeOptions: CodexSecurityRuntimeOptions): CodexSecurity;
|
|
129
142
|
export declare function initialCredentialsAvailable(environment: ProcessEnvironment, ambientHome: string, isolatedHome: string, importer?: typeof importAmbientAuth): Promise<boolean>;
|
|
130
|
-
export declare function scanAuthentication(environment: ProcessEnvironment, auth?: ScanAuthMode, modelProvider?: unknown): ScanAuthentication;
|
|
143
|
+
export declare function scanAuthentication(environment: ProcessEnvironment, auth?: ScanAuthMode, modelProvider?: unknown, commandAuth?: boolean): ScanAuthentication;
|
|
144
|
+
/** Shell-neutral guidance so PowerShell users are not told to run POSIX `unset`. */
|
|
145
|
+
export declare function formatEnvironmentVariableRemovalGuidance(names: readonly string[]): string;
|
|
131
146
|
export declare function classifyConnectionFailure(error: unknown): "rate_limited" | "unauthorized" | "forbidden" | "network_error" | "timeout" | "unknown";
|
|
132
147
|
export declare function scanRuntimeCodexConfig(config: JsonObject, protectedCredentialHome?: string): JsonObject;
|
|
133
148
|
export declare function scanPreflightCodexConfig(config: JsonObject): JsonObject;
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";AAqCA,OAAO,EAGL,gBAAgB,EAGhB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAWL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AA+B5B,OAAO,EACL,UAAU,EAIX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,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