@openai/codex-security 0.1.0

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.
Files changed (178) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +306 -0
  3. package/_bundled_plugin/.app.json +20 -0
  4. package/_bundled_plugin/.codex-plugin/plugin.json +41 -0
  5. package/_bundled_plugin/.mcp.json +20 -0
  6. package/_bundled_plugin/assets/logo.png +0 -0
  7. package/_bundled_plugin/examples/completed-scan/coverage.json +22 -0
  8. package/_bundled_plugin/examples/completed-scan/findings.json +51 -0
  9. package/_bundled_plugin/examples/completed-scan/scan-manifest.json +43 -0
  10. package/_bundled_plugin/mcp/mcp-app.html.br +0 -0
  11. package/_bundled_plugin/mcp/server.mjs +24 -0
  12. package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
  13. package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
  14. package/_bundled_plugin/preflight/capability-profiles.toml +179 -0
  15. package/_bundled_plugin/references/config-preflight.md +115 -0
  16. package/_bundled_plugin/references/final-report.md +205 -0
  17. package/_bundled_plugin/references/finding-detail-fields.md +162 -0
  18. package/_bundled_plugin/references/sarif-adapter.md +26 -0
  19. package/_bundled_plugin/references/scan-artifacts.md +116 -0
  20. package/_bundled_plugin/references/scan-contract.md +164 -0
  21. package/_bundled_plugin/references/security-guidance.md +15 -0
  22. package/_bundled_plugin/references/shared-hard-rules.md +15 -0
  23. package/_bundled_plugin/references/static-finding-assessment.md +75 -0
  24. package/_bundled_plugin/schemas/coverage.schema.json +228 -0
  25. package/_bundled_plugin/schemas/findings.schema.json +359 -0
  26. package/_bundled_plugin/schemas/scan-manifest.schema.json +332 -0
  27. package/_bundled_plugin/scripts/config_preflight.py +901 -0
  28. package/_bundled_plugin/scripts/deep_scan_config.py +108 -0
  29. package/_bundled_plugin/scripts/deep_scan_workbench.py +1547 -0
  30. package/_bundled_plugin/scripts/filesystem_identity.py +30 -0
  31. package/_bundled_plugin/scripts/finalize_scan_contract.py +2208 -0
  32. package/_bundled_plugin/scripts/finding_preview.py +270 -0
  33. package/_bundled_plugin/scripts/generate_rank_input.py +1013 -0
  34. package/_bundled_plugin/scripts/normalize_candidates.py +320 -0
  35. package/_bundled_plugin/scripts/rank_preview.py +968 -0
  36. package/_bundled_plugin/scripts/report_projection.py +844 -0
  37. package/_bundled_plugin/scripts/resolve_security_md.py +158 -0
  38. package/_bundled_plugin/scripts/snapshot_sqlite.py +26 -0
  39. package/_bundled_plugin/scripts/validate_report_format.py +138 -0
  40. package/_bundled_plugin/scripts/validate_scan_contract.py +108 -0
  41. package/_bundled_plugin/scripts/validate_tracking_source.py +92 -0
  42. package/_bundled_plugin/scripts/windows_scan_local_files.py +612 -0
  43. package/_bundled_plugin/scripts/workbench/__init__.py +1 -0
  44. package/_bundled_plugin/scripts/workbench/handoff.py +238 -0
  45. package/_bundled_plugin/scripts/workbench_cli.py +325 -0
  46. package/_bundled_plugin/scripts/workbench_constants.py +81 -0
  47. package/_bundled_plugin/scripts/workbench_db.py +3728 -0
  48. package/_bundled_plugin/scripts/workbench_native_indexes.py +242 -0
  49. package/_bundled_plugin/scripts/workbench_progress.py +226 -0
  50. package/_bundled_plugin/scripts/workbench_remediation.py +125 -0
  51. package/_bundled_plugin/scripts/workbench_scan_history.py +829 -0
  52. package/_bundled_plugin/scripts/workbench_scan_start.py +149 -0
  53. package/_bundled_plugin/scripts/workbench_schema.py +714 -0
  54. package/_bundled_plugin/scripts/workbench_source_excerpt.py +99 -0
  55. package/_bundled_plugin/scripts/workbench_target.py +469 -0
  56. package/_bundled_plugin/scripts/workbench_target_state.py +63 -0
  57. package/_bundled_plugin/scripts/workbench_validation.py +294 -0
  58. package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +117 -0
  59. package/_bundled_plugin/skills/attack-path-analysis/agents/openai.yaml +4 -0
  60. package/_bundled_plugin/skills/attack-path-analysis/references/attack-path-facts.md +76 -0
  61. package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +153 -0
  62. package/_bundled_plugin/skills/deep-security-scan/SKILL.md +166 -0
  63. package/_bundled_plugin/skills/deep-security-scan/agents/openai.yaml +4 -0
  64. package/_bundled_plugin/skills/define-security-policy/SKILL.md +93 -0
  65. package/_bundled_plugin/skills/define-security-policy/agents/openai.yaml +4 -0
  66. package/_bundled_plugin/skills/finding-discovery/SKILL.md +155 -0
  67. package/_bundled_plugin/skills/finding-discovery/agents/openai.yaml +4 -0
  68. package/_bundled_plugin/skills/fix-finding/SKILL.md +112 -0
  69. package/_bundled_plugin/skills/fix-finding/agents/openai.yaml +4 -0
  70. package/_bundled_plugin/skills/propose-security-hardening/SKILL.md +240 -0
  71. package/_bundled_plugin/skills/propose-security-hardening/agents/openai.yaml +4 -0
  72. package/_bundled_plugin/skills/propose-security-hardening/references/proposal-format.md +424 -0
  73. package/_bundled_plugin/skills/security-diff-scan/SKILL.md +167 -0
  74. package/_bundled_plugin/skills/security-diff-scan/agents/openai.yaml +4 -0
  75. package/_bundled_plugin/skills/security-scan/SKILL.md +42 -0
  76. package/_bundled_plugin/skills/security-scan/agents/openai.yaml +4 -0
  77. package/_bundled_plugin/skills/security-scan/references/repository-wide-scan.md +48 -0
  78. package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +85 -0
  79. package/_bundled_plugin/skills/threat-model/SKILL.md +59 -0
  80. package/_bundled_plugin/skills/threat-model/agents/openai.yaml +4 -0
  81. package/_bundled_plugin/skills/threat-model/references/threat-model-guidance.md +48 -0
  82. package/_bundled_plugin/skills/track-findings/SKILL.md +222 -0
  83. package/_bundled_plugin/skills/track-findings/agents/openai.yaml +6 -0
  84. package/_bundled_plugin/skills/track-findings/references/github-security-advisories.md +54 -0
  85. package/_bundled_plugin/skills/track-findings/references/jira.md +77 -0
  86. package/_bundled_plugin/skills/triage-finding/SKILL.md +342 -0
  87. package/_bundled_plugin/skills/triage-finding/agents/openai.yaml +4 -0
  88. package/_bundled_plugin/skills/triage-finding/references/github-rest-intake.md +168 -0
  89. package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +62 -0
  90. package/_bundled_plugin/skills/triage-finding/references/triage-result-contract.md +108 -0
  91. package/_bundled_plugin/skills/validation/SKILL.md +110 -0
  92. package/_bundled_plugin/skills/validation/agents/openai.yaml +4 -0
  93. package/_bundled_plugin/skills/validation/references/validation-guidance.md +122 -0
  94. package/_bundled_plugin/skills/vulnerability-writeup/SKILL.md +263 -0
  95. package/_bundled_plugin/skills/vulnerability-writeup/agents/openai.yaml +4 -0
  96. package/_bundled_plugin/skills/vulnerability-writeup/references/report-format.md +104 -0
  97. package/bin/codex-security.mjs +26 -0
  98. package/dist/api.d.ts +112 -0
  99. package/dist/api.d.ts.map +1 -0
  100. package/dist/api.js +1051 -0
  101. package/dist/api.js.map +1 -0
  102. package/dist/auth.d.ts +29 -0
  103. package/dist/auth.d.ts.map +1 -0
  104. package/dist/auth.js +246 -0
  105. package/dist/auth.js.map +1 -0
  106. package/dist/bulk-scan-discovery.d.ts +35 -0
  107. package/dist/bulk-scan-discovery.d.ts.map +1 -0
  108. package/dist/bulk-scan-discovery.js +217 -0
  109. package/dist/bulk-scan-discovery.js.map +1 -0
  110. package/dist/cli.d.ts +67 -0
  111. package/dist/cli.d.ts.map +1 -0
  112. package/dist/cli.js +2128 -0
  113. package/dist/cli.js.map +1 -0
  114. package/dist/config.d.ts +19 -0
  115. package/dist/config.d.ts.map +1 -0
  116. package/dist/config.js +199 -0
  117. package/dist/config.js.map +1 -0
  118. package/dist/contract.d.ts +21 -0
  119. package/dist/contract.d.ts.map +1 -0
  120. package/dist/contract.js +848 -0
  121. package/dist/contract.js.map +1 -0
  122. package/dist/cost.d.ts +30 -0
  123. package/dist/cost.d.ts.map +1 -0
  124. package/dist/cost.js +280 -0
  125. package/dist/cost.js.map +1 -0
  126. package/dist/errors.d.ts +38 -0
  127. package/dist/errors.d.ts.map +1 -0
  128. package/dist/errors.js +52 -0
  129. package/dist/errors.js.map +1 -0
  130. package/dist/index.d.ts +22 -0
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +11 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/knowledge-base.d.ts +7 -0
  135. package/dist/knowledge-base.d.ts.map +1 -0
  136. package/dist/knowledge-base.js +181 -0
  137. package/dist/knowledge-base.js.map +1 -0
  138. package/dist/models.d.ts +231 -0
  139. package/dist/models.d.ts.map +1 -0
  140. package/dist/models.js +3 -0
  141. package/dist/models.js.map +1 -0
  142. package/dist/multiscan.d.ts +30 -0
  143. package/dist/multiscan.d.ts.map +1 -0
  144. package/dist/multiscan.js +397 -0
  145. package/dist/multiscan.js.map +1 -0
  146. package/dist/result.d.ts +39 -0
  147. package/dist/result.d.ts.map +1 -0
  148. package/dist/result.js +71 -0
  149. package/dist/result.js.map +1 -0
  150. package/dist/runtime.d.ts +69 -0
  151. package/dist/runtime.d.ts.map +1 -0
  152. package/dist/runtime.js +997 -0
  153. package/dist/runtime.js.map +1 -0
  154. package/dist/scan-comparison.d.ts +42 -0
  155. package/dist/scan-comparison.d.ts.map +1 -0
  156. package/dist/scan-comparison.js +153 -0
  157. package/dist/scan-comparison.js.map +1 -0
  158. package/dist/scan-history-renderer.d.ts +13 -0
  159. package/dist/scan-history-renderer.d.ts.map +1 -0
  160. package/dist/scan-history-renderer.js +297 -0
  161. package/dist/scan-history-renderer.js.map +1 -0
  162. package/dist/targets.d.ts +39 -0
  163. package/dist/targets.d.ts.map +1 -0
  164. package/dist/targets.js +295 -0
  165. package/dist/targets.js.map +1 -0
  166. package/dist/trusted-executable.d.ts +6 -0
  167. package/dist/trusted-executable.d.ts.map +1 -0
  168. package/dist/trusted-executable.js +77 -0
  169. package/dist/trusted-executable.js.map +1 -0
  170. package/dist/version.d.ts +6 -0
  171. package/dist/version.d.ts.map +1 -0
  172. package/dist/version.js +42 -0
  173. package/dist/version.js.map +1 -0
  174. package/dist/worker-progress.d.ts +13 -0
  175. package/dist/worker-progress.d.ts.map +1 -0
  176. package/dist/worker-progress.js +113 -0
  177. package/dist/worker-progress.js.map +1 -0
  178. package/package.json +74 -0
@@ -0,0 +1,263 @@
1
+ ---
2
+ name: vulnerability-writeup
3
+ description: Write up vulnerabilities from disclosure documents, rough notes, supplied findings, PoCs, source code, or Codex Security scan output into polished, self-contained, source-backed reports. Use for one vulnerability or a disclosure campaign; a Codex Security scan is optional.
4
+ ---
5
+
6
+ # Vulnerability Writeup
7
+
8
+ ## Overview
9
+
10
+ Produce a distributable report set from rough vulnerability notes, PoCs, and source code. Treat this as a technical disclosure campaign: every distinct vulnerability gets its own directory, its own report, its own PoC artifacts,
11
+ and its own sub-agent draft. The desired output is not a cleaned-up note. It is a calm, expert narrative that proves the bug from source, explores how far the primitive can realistically be pushed, and ships with a PoC that another researcher can build and run.
12
+
13
+ Do not require a Codex Security scan, scan ID, manifest, findings JSON, coverage receipt, or seal. Ordinary disclosure documents and supplied vulnerability material are first-class inputs. When scan artifacts are present, use their validated fields as additional evidence; otherwise inventory the supplied documents directly and proceed with the same research and quality bar.
14
+
15
+ ## Core Rules
16
+
17
+ - Use one sub-agent per vulnerability write-up. Do not assign multiple vulnerabilities to one worker.
18
+ - When this skill is used during Codex Security final reporting, the scan request is already authorization to launch the required one-finding write-up sub-agents. Do not ask for separate sub-agent authorization.
19
+ - The main agent owns inventory and deduplication. Workers receive only the single vulnerability they are writing.
20
+ - Review every sub-agent report yourself before accepting it.
21
+ - If a report falls short, run another sub-agent for that same vulnerability with the raw artifacts and a concise critique.
22
+ - Source access is mandatory for an excellent report. If the source tree or vulnerable revision is missing, stop and get it from the user unless the user explicitly accepts a lower-confidence report.
23
+ - Treat pre-captured source snippets as leads, not as the complete source of truth. Workers must inspect the target source tree or an exact revision snapshot before choosing final snippets.
24
+ - Never guess missing technical detail. Read source, inspect commits, run safe experiments, and clearly separate validated facts from hypotheses.
25
+ - Use lab or VM access only when it is explicitly authorized for this work.
26
+ Never test against public or live production instances unless the user has explicitly instructed you to do so for that target.
27
+ - Make reports self-contained and distributable. Do not mention Drive,
28
+ internal provenance, local absolute paths, or prior working folders.
29
+ - Write in the natural first-person voice of a professional vulnerability researcher. Use "we" throughout the technical walkthrough to guide the reader through source, state transitions, exploit ideas, and PoC behavior ("we first reach", "if we carry this value forward", "from here we control"). Include honest "I" statements for the work actually performed and its limits ("I reviewed revision", "I reproduced", "I could not run this without a VM"). Static review is work and may be stated as such. Never invent testing or personal observations. Do not sprinkle pronouns into otherwise impersonal prose merely to satisfy this rule; the report should feel genuinely narrated.
30
+ - Prefer readable, terminal-friendly line wrapping when it does not make the prose awkward. Do not let line length rules damage clarity, links, tables,
31
+ code references, or the natural rhythm of the report.
32
+ - Prefer source-backed narrative over labels. Each report should tell the full story: trigger, vulnerable path, bad state, impact, PoC, and fix.
33
+ - Vulnerabilities sometimes have several different options for exploitation.
34
+ Exploring and discussing alternative exploitation routes is often useful to include in a report even if it's not the best route or the one used for the PoC, so always include those discussions where they add interesting insights or explore ideas that otherwise wouldn't be covered. Where alternatives are covered, make the pros and cons clear, as one would expect in a technical discourse.
35
+ - Treat PoCs as first-class deliverables. The final report directory should contain clean PoC source, build/run instructions, representative output,
36
+ and any reliability, cleanup, or target-environment notes the reader needs.
37
+ If you feel it's not possible to develop a PoC, ask the user for guidance.
38
+
39
+ If the platform refuses to start more sub-agents, state that constraint to the user and queue the tasks. You should always delegate one report to one sub-agent. If a sub-agent starts but creates no files after one reasonable wait and one explicit finish instruction, close it and retry once with a tighter prompt for the same single vulnerability. If the retry also stalls,
40
+ mark the writeup phase blocked unless the user explicitly authorizes a main-agent fallback. Do not silently use a main-agent fallback for production scan completion.
41
+
42
+ ## Inputs
43
+
44
+ Gather and preserve these inputs before drafting:
45
+
46
+ - raw vulnerability documents, exported text, or existing rough reports;
47
+ - supplied scanner findings or Codex Security finding bundles, when present;
48
+ - existing PoCs, scripts, crash logs, traces, and screenshots;
49
+ - the target source tree and exact vulnerable revision or release tag;
50
+ - a focused inventory of relevant source paths, functions, and revisions when available;
51
+ - fix commits, upstream diffs, or advisory text when available;
52
+ - lab access details such as SSH hosts, VMs, kernels, or test accounts;
53
+ - the user's authorization boundary for testing, especially whether any live target is in scope.
54
+
55
+ When the corpus comes from an external store (e.g. cloud storage or network paths), export the key text locally first. The final reports must not refer to external storage unless the user explicitly asks for provenance notes.
56
+
57
+ The produced write-ups must be distributable on their own and not assume access to other files or systems.
58
+
59
+ ## Campaign Workflow
60
+
61
+ 1. Create a destination directory, usually `reports` or the user-provided name. Use short, representative slug names.
62
+ 2. Build an inventory of candidate documents and PoCs. Record title,
63
+ subsystem, primitive, affected paths, and likely duplicates.
64
+ 3. Deduplicate by root cause and vulnerable code path, not by document title.
65
+ Merge notes and PoCs that describe the same bug.
66
+ 4. Read `references/report-format.md` in full and use it as the report format.
67
+ Instruct every worker to do the same before drafting.
68
+ 5. Confirm that each distinct vulnerability has enough source context to let a worker trace the bug from entry point to bad state. Inspect the finding's recorded locations, reopen the source around each relevant boundary, and give the worker the focused paths, functions, revision, and short source excerpts it needs. If source access is missing, collect the missing files,
69
+ revision, fix diff, or build instructions before drafting, or proceed at explicitly lower confidence when the user accepts that limitation.
70
+ 6. If authorized lab access exists, record how to reach it and what safety limits apply. If it does not, instruct the worker to build or reason about PoCs locally and to state what could not be executed.
71
+ 7. For each distinct vulnerability, create one directory containing an appropriately-named report file as markdown (e.g. `freebsd-shm-uaf.md`)
72
+ and a `poc/` directory when PoCs exist. Don't just use a nondescript file name like `report.md`.
73
+ 8. Launch exactly one sub-agent for that vulnerability. Give it the raw notes, focused source paths and excerpts, target source tree, vulnerable revision, PoCs, output directory, format rules, lab details, and authorization boundary. Do not give it other vulnerabilities.
74
+ 9. Review the worker output immediately. Check technical correctness,
75
+ completeness, line wrapping, self-contained wording, source snippets,
76
+ exploitability depth, PoC usability, and narrative voice. Reject a report that is written as an impersonal sequence of facts, reserves "we" for one token sentence, or never states in first person what was and was not validated.
77
+ 10. Reject snippets that cut off before the vulnerable condition, missing guard, dangerous sink, relevant lifetime transition, or proposed fixed invariant. Inspect source directly before asking the worker to rewrite. If the story is thin, incomplete,
78
+ speculative, narratively compressed, impersonal, or missing a runnable PoC path, launch a new sub-agent for that same vulnerability with the raw inputs and the specific gaps to close.
79
+ 11. Make only small main-agent edits after acceptance: heading fixes, line wrapping, command-path portability, and typo cleanup. Do not paper over a weak draft with surface edits.
80
+ 12. Run final validation over the whole report set before returning.
81
+
82
+ ## Sub-Agent Prompt
83
+
84
+ Use a prompt shaped like this for each vulnerability:
85
+
86
+ ```text
87
+ Write one high-quality vulnerability disclosure report for <slug>.
88
+
89
+ You are responsible for exactly one vulnerability. Do not write about,
90
+ summarize, compare, or polish any other finding. Quality drops when one
91
+ worker handles multiple bugs, so keep all attention on this single report.
92
+
93
+ Inputs:
94
+ - Raw notes: <paths>
95
+ - Existing rough report, if any: <path>
96
+ - PoC artifacts: <paths>
97
+ - Focused source paths and excerpts: <paths and relevant functions>
98
+ - Target source tree: <path>
99
+ - Vulnerable revision/release: <revision>
100
+ - Fix commits/diffs, if any: <paths/revisions>
101
+ - Lab access: <ssh/vm details>
102
+ - Testing authorization boundary: <what is allowed and forbidden>
103
+ - Required format: `references/report-format.md`.
104
+ - Output directory: <reports-dir>/<slug>
105
+
106
+ Rules:
107
+ - Before drafting, open and read `references/report-format.md` in full. Its
108
+ headings are the beginning of the assignment, not a completeness checklist.
109
+ - Analyze source and fixes directly; never guess. Trace the bug from the
110
+ attacker-controlled entry point through the relevant state transitions to
111
+ the bad state.
112
+ - Treat supplied snippets as starting points. If a snippet ends before the
113
+ decisive branch, guard, sink, lifetime transition, or patch invariant,
114
+ reopen the source tree and quote a complete short snippet instead.
115
+ - Use the source tree throughout the report. Include short, relevant snippets
116
+ with file paths, functions, and enough surrounding explanation for a human
117
+ reader to follow the path without opening the repository.
118
+ - Treat the rough notes as leads, not gospel. Validate each claim against the
119
+ vulnerable source, the fix diff, or an experiment. Correct the notes when
120
+ the source proves them incomplete or slightly wrong.
121
+ - Explore exploitability, not just reachability. Discuss viable primitives,
122
+ constraints, allocator or protocol behavior, race windows, object lifetime,
123
+ attacker-controlled bytes, reliability, and useful dead ends. Build small
124
+ throwaway probes when they clarify an exploit path.
125
+ - Verify or improve the PoC when safe and authorized. Prefer disposable VMs
126
+ or local test targets for crashes, corruption, LPE, data loss, or denial of
127
+ service. Never run against public or live production instances unless the
128
+ authorization boundary explicitly allows that target.
129
+ - Ship a polished final PoC in `poc/`. Include source, build files, a README
130
+ when helpful, exact run commands using relative paths, required environment
131
+ details, expected output, and notes on reliability or cleanup.
132
+ - Produce a self-contained report markdown file with no provenance references
133
+ and no local absolute paths.
134
+ - Use a natural first-person researcher voice in the report itself. Guide the
135
+ reader with "we" across the substantive walkthrough: introduce why each
136
+ source excerpt matters, carry values and object state between functions,
137
+ reason through exploit options, and explain PoC behavior. Do not leave the
138
+ reader with a dense sequence of snippets and declarative conclusions.
139
+ - Include at least one truthful first-person-singular account of the validation
140
+ basis and limits. For example: "I reviewed the vulnerable revision and fix
141
+ directly, but I did not execute the panic trigger because no disposable VM
142
+ was available." Mention builds, experiments, failures, or observations only
143
+ when they actually happened.
144
+ - Give important transitions enough prose to teach why the evidence matters.
145
+ Explore promising exploitation routes, relevant alternatives, constraints,
146
+ and informative dead ends instead of collapsing exploitability into a verdict
147
+ paragraph. Add depth where the bug warrants it; do not pad the report.
148
+ - Prefer readable prose wrapping, but do not contort technical language,
149
+ links, tables, or code references to satisfy a fixed column width.
150
+ - Explain trigger, vulnerable path, bad state, impact, exploitability, PoC,
151
+ and fix as one coherent narrative. The reader should feel calmly guided
152
+ from background to source proof to practical demonstration.
153
+ - Use relative commands such as `cd poc` then `make`, not local absolute
154
+ paths.
155
+ ```
156
+
157
+ When re-running a weak report, add only the review deltas:
158
+
159
+ ```text
160
+ The prior draft was too light on <specific gaps>. Rewrite from the raw
161
+ artifacts and source so the report reads as a complete technical story. Use
162
+ "we" to guide the actual source and exploitation walkthrough, and state with
163
+ "I" what you personally validated and what you could not test. Do not merely
164
+ add first-person phrases to the existing prose.
165
+ ```
166
+
167
+ ## Technical Analysis Standard
168
+
169
+ For each report, prove the vulnerability from the target source:
170
+
171
+ - identify the exact entry point and attacker-controlled inputs;
172
+ - follow data, lifetime, locking, bounds, and state transitions;
173
+ - quote short source snippets only when they clarify the path;
174
+ - inspect vulnerable release code with commands like `git show <rev>:<file>`;
175
+ - compare fix commits when available to confirm the intended invariant;
176
+ - describe the resulting kernel or application state precisely;
177
+ - calibrate impact to the validated primitive;
178
+ - name assumptions and unverified exploitability limits.
179
+
180
+ ### Source Work
181
+
182
+ The worker should use the repository as a primary artifact:
183
+
184
+ - inspect the vulnerable revision, not just the current tree;
185
+ - use `git show <revision>:<path>` when the source tree is a Git checkout and the scanned revision is available;
186
+ - identify relevant compile-time options, configuration, permissions, and threat-model checks;
187
+ - search for sibling call sites and variants that help explain the invariant;
188
+ - include snippets from vulnerable code and, when useful, the fixing diff;
189
+ - keep snippets short and narrate the important lines before or after them.
190
+
191
+ ### Exploitability Work
192
+
193
+ The Exploitability Analysis section should be thoughtful and specific. It may include unsuccessful branches when they teach the reader something important.
194
+ Useful lines of inquiry include:
195
+
196
+ - how to maximize attacker control over corrupted data or control flow;
197
+ - how allocator, scheduler, parser, cache, sandbox, or protocol behavior affects reliability;
198
+ - how to groom state before the trigger and stabilize state afterward;
199
+ - what information leaks, write gadgets, confused-deputy paths, or privilege boundaries might combine with the primitive;
200
+ - what constraints make a stronger exploit unlikely.
201
+
202
+ ### PoC Work
203
+
204
+ Use the lab to build PoCs and run safe probes. For panic, wedge, corruption,
205
+ data-loss, or LPE cases, prefer disposable VMs and state the risk in the report. If a PoC cannot safely be run, at least verify that it builds or that its build recipe is coherent, and explain the missing execution condition.
206
+
207
+ A strong final PoC should be easy for the reader to run:
208
+
209
+ - place it under the report directory's `poc/` folder;
210
+ - include a `Makefile`, script, container recipe, or exact build command;
211
+ - include example commands from a clean checkout or unpacked report bundle;
212
+ - include representative output from a successful run;
213
+ - separate exploratory probes from the polished final PoC when both are kept;
214
+ - include cleanup or reset instructions when the PoC changes system state.
215
+
216
+ ## Report Quality Bar
217
+
218
+ Every accepted report must follow the guidance in `references/report-format.md`.
219
+
220
+ The report should read like a complete story for a security engineer who has not seen the original notes. It should patiently walk the reader from the entry point to the vulnerable transition, the bad state, exploitation routes,
221
+ PoC behavior, and the fix. Avoid filler, generic variant-analysis endings,
222
+ and claims unsupported by source or experiment, but include thoughtful discussion and maintain a warm, professional attitude: the voice of one security researcher carefully explaining the work to another.
223
+
224
+ An excellent report usually has a few recognizable traits:
225
+
226
+ - The proof is layered. It establishes the actor, entry point, vulnerable check, bad transformation or state transition, sink, and fixed source shape in an order that feels easy to follow.
227
+ - Exploitability is treated as research. The report names attacker-controlled values, useful primitives, realistic routes, constraints, fallbacks,
228
+ reliability dependencies, and dead ends that teach something.
229
+ - The PoC section separates diagnostic probes from the strongest exploit or demonstration path, gives a safe-first run order, and includes representative output.
230
+ - Remediation explains the invariant to restore, then gives minimal fixes,
231
+ deeper structural hardening where useful, and regression tests that exercise the real vulnerable path.
232
+ - The language is precise, calm, and conversationally professional. It should not read like a terse scanner finding, a marketing advisory, or a pile of disconnected notes.
233
+ - The voice sounds like a researcher writing to peers. First-person plural carries the reader through the substantive source, exploitability, and PoC reasoning rather than appearing once as decoration. First-person singular gives an honest account of actual source review, validation work, failed attempts, and limits.
234
+ - The prose explains why each important transition matters. A complete set of headings, snippets, and conclusions is not enough when the connective reasoning remains implicit.
235
+
236
+ Before accepting a report, ask whether it reaches the excellent bar:
237
+
238
+ - Can a reader understand the affected component and threat model without the original notes?
239
+ - Does the report prove the vulnerable path from source and cite the exact functions, files, and revisions that matter?
240
+ - Are code snippets chosen because they illuminate the story, not because the report needed decoration?
241
+ - Does every snippet include the decisive line or branch it is meant to prove,
242
+ rather than cutting off just before the vulnerability?
243
+ - Does the exploitability analysis explore multiple realistic paths,
244
+ including constraints and dead ends that sharpen the conclusion?
245
+ - Is there a high-quality final PoC with build/run commands and example output, or a clear reason why execution was not authorized or safe?
246
+ - Does the remediation explain the invariant that must be restored and show a plausible minimal patch or defensive pattern?
247
+ - Does the report use a natural "we" voice through the walkthrough and include a truthful "I" account of what the author validated or could not test?
248
+ - Does the prose patiently connect the evidence, or does it still read like a technically correct but lightweight scanner expansion?
249
+
250
+ ## Validation
251
+
252
+ Review the completed report set directly after drafting and after any rewrite.
253
+ Check every report against `references/report-format.md`, then run relevant project checks:
254
+
255
+ - `rg` for forbidden provenance terms and TODO markers;
256
+ - `rg -n '\b(we|We|I|our|Our|us)\b' <report>` as a quick signal for missing researcher voice, followed by a manual read for natural usage;
257
+ - `make -n` in every `poc/` directory (may need to run on the appropriate target system; doesn't necessarily need to build on whichever system the report is being written on);
258
+ - source commands used in the reports, when feasible;
259
+ - a parity check against the original report directory when rewriting.
260
+
261
+ Do not hand off until validation passes or the remaining failures are explicitly explained to the user.
262
+
263
+ A report with no natural first-person walkthrough, or no truthful singular account of the validation basis and limits, fails validation and must be rewritten. A mechanical pronoun match does not make an impersonal report pass.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Vulnerability Writeup"
3
+ short_description: "Write up a vulnerability into a polished, self-contained, source-backed report."
4
+ default_prompt: "Use $vulnerability-writeup to turn a corpus of vulnerability notes into polished, source-backed disclosure reports."
@@ -0,0 +1,104 @@
1
+ # Vulnerability Report Format
2
+
3
+ Use this guide to write a comprehensive vulnerability report that covers the details of a vulnerability, considers options for exploitation and walks the reader through the most effective steps to trigger the bug.
4
+
5
+ The report should be written in markdown. Use language hints in code snippets to indicate programming language -- e.g. use ```c rather than just ```. Choose an appropriate file name for the report that makes it clear what the vulnerability is at a glance. For example, `freebsd-shm-ftruncate-uaf-lpe.md`.
6
+ Don't just choose the name `report.md` or anything nondescript like that.
7
+
8
+ Audience: other vulnerability researchers and security engineers with a deep knowledge of software exploitation and software development. The report must be written in clear English and use precise language. Be warm and somewhat friendly in the manner of your writing, but not overly familiar: as you'd expect a technical write-up to read from one expert to another. Don't sound robotic.
9
+
10
+ Use a natural first-person researcher voice. The report should regularly guide the reader with language such as "we first reach this branch", "if we carry this value into the next call", "from here we control the length field", or
11
+ "we can now compare this with the fixed path". Use that voice in the real source, exploitability, and PoC walkthrough—not only in an introduction or summary.
12
+
13
+ Use first-person singular for actual work the report author performed and for its limits, such as "I reviewed the vulnerable revision and the fixing diff",
14
+ "I reproduced this on", "I did not get a stable shell", or "I could not exercise this path without a kernel fault-injection hook". Every report must include a truthful singular account of its validation basis. Static source review counts; do not imply that code was built or executed when it was not.
15
+ Never invent personal observations.
16
+
17
+ First person is a narrative tool, not a quota. Do not retrofit an impersonal draft by scattering "we can see" through it. The reader should feel accompanied through the reasoning: why a snippet matters, what state we carry forward, why one exploitation route looks promising, and what an experiment did or did not establish.
18
+
19
+ Talk through the details that matter and don't gloss over things or skip them when they add value.
20
+
21
+ The quality target is the "excellent" style of report: a source-backed story that patiently proves the vulnerable path, explores exploitation like a researcher actually working the bug, and leaves the reader with artifacts they can build and run. Do not settle for a short triage note with section headings.
22
+
23
+ Excellent reports usually do these things:
24
+
25
+ - establish the actor, reachable entry point, affected component, and exact source/revision basis early;
26
+ - walk the reader through the relevant call chain or state machine before naming the bug;
27
+ - use short source snippets with file paths and function names, then explain the important lines in prose;
28
+ - show the bad state with concrete values, type conversions, lifetime edges,
29
+ bounds, lock transitions, parser states, or protocol fields;
30
+ - compare the fixed source shape when a fix exists, and explain the invariant the fix restores;
31
+ - treat exploitability as research, not a verdict. Discuss promising paths,
32
+ constraints, architecture or configuration dependencies, and dead ends that clarify the primitive;
33
+ - include small probes or exploratory PoCs when they helped refine the final exploit story;
34
+ - ship a clean final PoC with build/run commands and representative output.
35
+
36
+ Use readable prose wrapping. Terminal-friendly line lengths are welcome when they fit naturally, but do not damage clarity, links, tables, code references, or the rhythm of the explanation to satisfy a fixed column width.
37
+
38
+ The report must be written using the high-level structure that follows. Use the headings as there are listed here for each section and include sub-sections (and even sub-sub sections if really necessary) judiciously to cleanly and logically organise the content.
39
+
40
+ ## Quality Bar
41
+
42
+ The report should feel like a warm, professional technical walk-through from one security researcher to another. It should not read like a scanner result,
43
+ a terse triage note, or a stitched-together collection of bullets. The reader should be guided through the component, the reachable entry point, the vulnerable transition, the bad state, exploitation options, PoC behavior, and the fix in a coherent order.
44
+
45
+ Strong write-ups generally have these qualities:
46
+
47
+ - The proof is layered: actor, entry point, relevant state, vulnerable check,
48
+ bad transformation or lifetime edge, sink, and fixed source shape.
49
+ - Source snippets are short and purposeful. Each snippet should be introduced or explained so the important lines are obvious without opening the repository.
50
+ - Exploitability is explored like research. Discuss attacker-controlled values, useful primitives, realistic routes, constraints, fallbacks,
51
+ reliability dependencies, and dead ends that clarify the primitive.
52
+ - PoC material is first-class. Separate diagnostic probes from the strongest final demonstration when both are included, give a safe-first run order,
53
+ and include representative output.
54
+ - Remediation explains the invariant to restore before showing code. It should also name regression tests that exercise the real vulnerable path and nearby variants.
55
+ - The tone is calm, precise, and conversationally professional: confident enough to be useful, careful enough not to overclaim. The voice should feel like a researcher writing to peers, with natural "we" walkthrough language and honest "I" statements for experiments actually performed.
56
+ - The prose contains the connective reasoning between source excerpts and conclusions. A report that has all required headings but reduces the bug to a sequence of snippets, terse facts, and verdicts is still incomplete.
57
+ - The validation basis is personal and precise: what I inspected, built, ran,
58
+ observed, or could not test. The rest of the technical story uses "we" to make difficult control flow and exploitation reasoning comfortable to follow.
59
+
60
+ The structure must contain the following headings:
61
+
62
+ 1. **Executive Summary**: Summarise what the vulnerability is, which versions of the software are affected, what the impact is and what it allows an attacker to do. Include the validation basis: source revision, fixed revision if known, lab target, and what was or was not executed. State this basis in a truthful first-person-singular sentence (for example, "I reviewed revision X directly, but I did not execute the trigger"). If exact advisory names, CVEs, or patch-level claims are uncertain, say that rather than overstating them. As well as the affected versions, it's often interesting to note how long ago the vulnerability was introduced to give the reader a sense of how ubiquitous it is.
63
+
64
+ 2. **Background**: Provide a technical background to set the scene. Describe,
65
+ briefly, the relevant part of the software functionality. Assume the audience is technically strong, but not necessarily intimately familiar with the relevant part of the attack surface or threat model (including actors). This section should introduce the objects, callbacks, permission model, configuration, and normal invariants needed to understand the bug.
66
+ Use source snippets here when they establish the reachable surface or the security boundary.
67
+
68
+ 3. **Vulnerability Details**: Continue naturally on from the Background section, but now work towards a full-detail walk-through of how the vulnerable code is reached and what the issue is. Tie this in with the mise-en-scène established so far so that the story of who can reach the code, by what means, and how the relevant input carries through is clear to the reader. Prove the bug from source: entry point, attacker-controlled fields, checks that should have protected the path, the exact missed invariant, and the resulting bad state. Concrete arithmetic, type truncation, lifetime diagrams, state tables, or before/after values are often more persuasive than broad claims.
69
+
70
+ 4. **Exploitability Analysis**: By this point, the reader understands the full threat model context of the vulnerability and the story of how the bad state can be reached. This section should now focus on how it's possible to maximally capitalise on the vulnerability: for example, if relevant, how does the underlying heap allocator work and be groomed to arrange data in a favourable manner, or what kind of control do we have over any objects/data we can corrupt, etc. This is an excellent opportunity for both drawing on prior art and also being creative in how unique aspects of the vulnerability can be tackled. Including diagrams and small, self-contained PoCs to trigger these aspects is especially useful. An excellent PoC demonstrates leveraging the vulnerability to the maximum within reason.
71
+ E.g. dropping to a stable interactive root shell, or confidently leaking a pointer to something useful, or achieving reliable command injection, etc.
72
+ (this will vary according to what the vulnerability is). Include multiple realistic exploitation routes when they exist. It is useful to preserve failed or partial branches when they teach an important constraint, such as allocator behavior, address-space layout, sandbox permissions, protocol sequencing, or object lifetime.
73
+
74
+ Write this as an investigation rather than a severity verdict. Walk through the strongest route with "we", then discuss meaningful alternatives,
75
+ reliability constraints, and dead ends when they sharpen the conclusion.
76
+ Spend prose on the hard or surprising parts; do not pad simple mechanics.
77
+
78
+ 5. **Proof of Concept**: This should tie together all of the exploration and creative process performed in the Exploitability Analysis section into a maximally-effective and stable proof-of-concept that can be used with minimal configuration against the target. Don't just mention that a PoC is included: describe the approach it takes, any notes about reliability, and provide sample output from building and running it. Include exact relative commands from the report directory, expected output on vulnerable and fixed targets when possible, target requirements, cleanup instructions, and a clear warning when the PoC can crash, corrupt, delete data, or escalate on the test machine. Keep exploratory probes separate from the polished final PoC when both are included.
79
+
80
+ 6. **Remediation**: Explain the most effective way to patch the vulnerability.
81
+ Include a minimal code snippet on a proposed patch that would fix it. Also make suggestions about how the surrounding structure or other parts of the project could be improved or hardened to prevent the vulnerability. Explain the invariant in plain technical terms before showing the patch, and point to regression tests that would catch the original failure and nearby variants. This is a good location to include diagrams or flow charts, for instance.
82
+
83
+ 7. **Summary**: Summarise what the impact of the vulnerability is, why the vulnerability is present and what we demonstrated through the story told in this report. Suggest areas of future research, such as where variant analysis may be effective or whether some part of the codebase "feels"
84
+ complex or underprotected.
85
+
86
+ The report must also be distributed with proof-of-concept artifacts. These should reside in a directory alongside the report and include the fully-functional, clean, high-quality proof-of-concept code plus any build files needed (e.g. a Makefile).
87
+
88
+ The PoC directory should be usable from an unpacked report bundle. Prefer relative commands such as:
89
+
90
+ ```sh
91
+ cd poc
92
+ make
93
+ ./exploit_or_probe
94
+ ```
95
+
96
+ The report should include representative output, for example:
97
+
98
+ ```text
99
+ [+] primitive reached
100
+ [+] target state validated
101
+ [+] current process is uid=0 euid=0
102
+ ```
103
+
104
+ Do not include local absolute paths, internal note provenance, or references to the drafting process in the final report.
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ async function launch() {
3
+ const [{ realpathSync }, { dirname, join }, { pathToFileURL }] =
4
+ await Promise.all([
5
+ import("node:fs"),
6
+ import("node:path"),
7
+ import("node:url"),
8
+ ]);
9
+ const entrypoint = process.argv[1];
10
+ if (entrypoint === undefined) {
11
+ throw new Error("Cannot resolve CLI entrypoint.");
12
+ }
13
+ const cli = join(dirname(realpathSync(entrypoint)), "..", "dist", "cli.js");
14
+ const { main } = await import(pathToFileURL(cli).href);
15
+ return await main();
16
+ }
17
+
18
+ void launch().then(
19
+ (exitCode) => {
20
+ process.exitCode = exitCode;
21
+ },
22
+ () => {
23
+ process.stderr.write("codex-security: Failed to start Codex Security.\n");
24
+ process.exitCode = 2;
25
+ },
26
+ );
package/dist/api.d.ts ADDED
@@ -0,0 +1,112 @@
1
+ /// <reference lib="esnext.disposable" preserve="true" />
2
+ import { CodexLoginHandle, type AccountStatus } from "./auth.js";
3
+ import { type CodexSecurityConfig, type JsonObject } from "./config.js";
4
+ import { type ScanCost } from "./cost.js";
5
+ import { type ScanExpectation } from "./contract.js";
6
+ import { ScanResult } from "./result.js";
7
+ import type { SeverityLevel } from "./models.js";
8
+ import { type ScanWorkerStatus } from "./worker-progress.js";
9
+ import { importAmbientAuth, type ProcessEnvironment } from "./runtime.js";
10
+ import { type NormalizedTarget, type ScanMode, type ScanTarget } from "./targets.js";
11
+ interface CodexThreadLike {
12
+ readonly id: string | null;
13
+ runStreamed(input: string, options: {
14
+ signal: AbortSignal;
15
+ }): Promise<{
16
+ events: AsyncGenerator<ScanEvent>;
17
+ }>;
18
+ }
19
+ interface ScanEvent {
20
+ readonly type: string;
21
+ readonly [key: string]: unknown;
22
+ }
23
+ export interface ScanOptions {
24
+ target?: ScanTarget;
25
+ mode?: ScanMode;
26
+ knowledgeBasePaths?: string[];
27
+ outputDir?: string;
28
+ archiveExisting?: boolean;
29
+ parentScanId?: string;
30
+ expectedPluginVersion?: string;
31
+ failureSeverity?: SeverityLevel;
32
+ maxCostUsd?: number;
33
+ onCost?: (cost: Readonly<ScanCost>) => void;
34
+ onOutputArchived?: (archiveDir: string) => void;
35
+ onOutputDirReady?: (scanDir: string) => void;
36
+ onAuthentication?: (authentication: ScanAuthentication) => void;
37
+ onScanStarted?: () => void;
38
+ onReconnect?: (attempt: number, maxAttempts: number, details?: ScanReconnectDetails) => void;
39
+ onWorkerStatus?: (status: ScanWorkerStatus) => void;
40
+ onObserverError?: (observer: ScanObserverName, error: unknown) => void;
41
+ signal?: AbortSignal;
42
+ }
43
+ export type ScanAuthentication = {
44
+ method: "api_key";
45
+ source: "OPENAI_API_KEY" | "CODEX_API_KEY";
46
+ verified: false;
47
+ } | {
48
+ method: "stored_credentials";
49
+ verified: false;
50
+ };
51
+ export interface ScanReconnectDetails {
52
+ reason: "rate_limit" | "network" | "authentication" | "authorization";
53
+ retryAfterSeconds?: number;
54
+ }
55
+ type ScanObserverName = "onAuthentication" | "onCost" | "onOutputArchived" | "onOutputDirReady" | "onScanStarted" | "onReconnect" | "onWorkerStatus";
56
+ export interface ScanPreflight {
57
+ repository: string;
58
+ target: NormalizedTarget;
59
+ mode: ScanMode;
60
+ knowledgeBasePaths?: string[];
61
+ outputDir: string | null;
62
+ archiveDir?: string;
63
+ authentication: ScanAuthentication;
64
+ model: string;
65
+ reasoningEffort: string;
66
+ maxCostUsd?: number;
67
+ }
68
+ export interface CodexSecurityMetadata {
69
+ sdk: "@openai/codex-sdk";
70
+ sdkVersion: string;
71
+ executable: "@openai/codex";
72
+ executableVersion: string;
73
+ }
74
+ export declare class CodexSecurity {
75
+ #private;
76
+ readonly config: Readonly<CodexSecurityConfig>;
77
+ readonly metadata: CodexSecurityMetadata;
78
+ constructor(config?: CodexSecurityConfig);
79
+ run(repository: string, options?: ScanOptions): Promise<ScanResult>;
80
+ preflight(repository: string, options?: ScanOptions): Promise<ScanPreflight>;
81
+ loginApiKey(apiKey: string): Promise<void>;
82
+ loginChatGPT(): Promise<CodexLoginHandle>;
83
+ loginChatGPTDeviceCode(): Promise<CodexLoginHandle>;
84
+ account(): Promise<AccountStatus>;
85
+ logout(): Promise<void>;
86
+ close(): Promise<void>;
87
+ [Symbol.asyncDispose](): Promise<void>;
88
+ }
89
+ export declare function initialCredentialsAvailable(environment: ProcessEnvironment, ambientHome: string, isolatedHome: string, importer?: typeof importAmbientAuth): Promise<boolean>;
90
+ interface ScanEventRunOptions {
91
+ thread: CodexThreadLike;
92
+ events: AsyncGenerator<ScanEvent>;
93
+ signal: AbortSignal;
94
+ scanDir: string;
95
+ pluginRoot: string;
96
+ expectation: ScanExpectation;
97
+ model?: string;
98
+ onFinalize?: (usage: unknown) => Promise<unknown>;
99
+ onThreadStarted?: (threadId: string) => void;
100
+ onScanStarted?: () => void;
101
+ onReconnect?: (attempt: number, maxAttempts: number, details?: ScanReconnectDetails) => void;
102
+ onWorkerStatus?: (status: ScanWorkerStatus) => void;
103
+ onObserverError?: (observer: ScanObserverName, error: unknown) => void;
104
+ }
105
+ export declare function runScanEvents(options: ScanEventRunOptions): Promise<ScanResult>;
106
+ export declare function scanAuthentication(environment: ProcessEnvironment): ScanAuthentication;
107
+ export declare function classifyConnectionFailure(error: unknown): "rate_limited" | "unauthorized" | "forbidden" | "network_error" | "timeout" | "unknown";
108
+ export declare function scanRuntimeCodexConfig(config: JsonObject): JsonObject;
109
+ export declare function scanPreflightCodexConfig(config: JsonObject): JsonObject;
110
+ export declare function environmentValue(environment: ProcessEnvironment, requested: string): string | undefined;
111
+ export {};
112
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";AAOA,OAAO,EAEL,gBAAgB,EAGhB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAevB,OAAO,EAAE,UAAU,EAA2B,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAKL,iBAAiB,EAYjB,KAAK,kBAAkB,EAGxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAEtB,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAC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