Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(reports): spell numeric ranges with en dashes, not tildes (#2095)

1211007a04b5bc
diff --git a/plugins/codex-security/references/finding-detail-fields.md b/plugins/codex-security/references/finding-detail-fields.md
index 3702096c0..dfbfd92b9 100644
--- a/plugins/codex-security/references/finding-detail-fields.md
+++ b/plugins/codex-security/references/finding-detail-fields.md
@@ -10,6 +10,7 @@ New drafts and imports use `codeEvidence`, `rootCause`, `attackPath.dataflow`, a
- Use `attackPath.summary` to briefly explain how to reproduce the issue.
- Explain how the code causes that product behavior in `rootCause.summary`. Use plain language and avoid repetition.
- Wrap RPC names, functions, types, fields, parameters, configuration keys, literal identifiers, and short expressions in single backticks. For example: `item/rename`, `itemId`, `title`, and `ItemStore.rename()`.
+- In finding prose, write numeric ranges with an en dash (`3–5`) or the word “to” (`3 to 5`).
- Keep code out of prose. Put source snippets in `codeEvidence[].code`, then reference them from the section that explains why the snippet matters. The workspace consolidates those referenced snippets under **Root cause** so the violated invariant and its source proof stay together.
- Root cause must be a source-backed walkthrough, not a verdict paragraph. Start with the code where user-controlled data is declared, decoded, or read; follow each meaningful call, transformation, or state transition; then show the missing control, dangerous operation, and later consumer when it affects impact.
- Give each code-evidence item a stable `id`, a concise `label`, an exact source location, the smallest useful snippet, a `role`, and an `explanation`. Supported roles include `user_input`, `entrypoint`, `propagation`, `root_control`, `sink`, `outcome`, and `expected_control`.
diff --git a/plugins/codex-security/tests/test_report_projection.py b/plugins/codex-security/tests/test_report_projection.py
index f50dea278..2707419fe 100644
--- a/plugins/codex-security/tests/test_report_projection.py
+++ b/plugins/codex-security/tests/test_report_projection.py
@@ -62,17 +62,21 @@ def test_projection_normalizes_structured_fields() -> None:
assert "Text: ## Injected remediation - unsafe instruction" in markdown
-def test_projection_normalizes_tilde_fences_and_parenthesized_lists() -> None:
+def test_projection_normalizes_block_syntax_and_preserves_inline_tildes() -> None:
manifest, findings, coverage = canonical_documents()
finding = findings["findings"][0]
finding["summary"] = "~~~\ncode fence\n~~~"
- finding["remediation"] = "1) Validate the record length."
+ instruction = (
+ "1) Retry 3–5 times, then 5 to 10. See https://example.test/~docs?version=~1. "
+ "Use chmod 0~777 or chmod 0~600 key.pem."
+ )
+ finding["remediation"] = instruction
markdown = PROJECTION.build_report_markdown(manifest, findings, coverage)
assert "\n~~~" not in markdown
assert "Text: ~~~ code fence ~~~" in markdown
- assert "Text: 1) Validate the record length." in markdown
+ assert f"Text: {instruction}" in markdown
@pytest.mark.parametrize("linked_writeup", [False, True], ids=["inline", "linked"])
@@ -818,6 +822,7 @@ def test_projection_keeps_html_entities_literal_in_markdown() -> None:
"url",
[
"https://example.com/?first=1&second=2",
+ "https://example.test/~docs?version=~1&retry=3",
"http://example.com/?payload=<tag>&mode=1",
"www.example.com/?payload=<tag>&mode=1",
"WWW.example.com/?first=1&second=2",