Back to skill

Security audit

Codex Review

Security checks for vulnerabilities and agentic risk

Overview

This is a local Codex usage-reporting skill, but it deserves Review because it can scan broad Codex conversation history and writes report data to a predictable temporary path.

Install only if you are comfortable with it reading recent Codex session history beyond the current workspace. Prefer running it explicitly, use a private --output path, disable automatic opening when needed with --no-open, and avoid using it on shared machines until the temp-file handling and session scoping are tightened.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/adapters/codex.mjs:19
Finding

Broad Collection of Private Codex Conversation History Without Per-Session Scoping

Content
View full analysis
walk(root, { maxDepth: 8, filter: (file) => file.endsWith(".jsonl") && recent(file, since), diagnostics, label: "Codex session directory", })); ``` ```js for (const file of sessionFiles) { const parsed = parseJsonl(file); malformedLineCount += parsed.malformed; if (!parsed.items.length) continue; const meta = parsed.items.find((item) => item.type === "session_meta")?.payload || {}; const scopedItems = parsed.items.filter((item) => { if (!item.timestamp) return item.type === "session_meta"; const time = new Date(item.timestamp).getTime(); return Number.isFinite(time) && time >= since.getTime() && time <= until.getTime(); }); const times = scopedItems .map((item) => item.timestamp) .filter(Boolean) .map((value) => new Date(value).getTime()) .filter(Number.isFinite); if (!times.length) continue; const token = tokenUsageForRange(parsed.items, since, until); const userMessages = []; for (const item of scopedItems) { if (item.type === "event_msg" && item.payload?.type === "user_message" && item.payload.message) { const clean = cleanUserMessage(item.payload.message); if (clean) userMessages.push(clean); } if (item.type === "response_item" && item.payload?.type === "message" && item.payload.role === "user") { const clean = cleanUserMessage(textOf(item.payload.content)); if (clean) userMessages.push(clean); } } if (!token.total_tokens) sessionsWithoutToken += 1; const start = Math.min(...times); const end = Math.max(...times); sessions.push({ id: meta.id || path.basename( ...[truncated 3856 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scan_usage.mjs:22
Finding

Predictable Shared Temporary Output Enables Symlink-Based File Overwrite

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (19)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 72)May include surrounding context.

md
node scripts/build_report.mjs --input /tmp/codex_review_scan.json --output <report.html>

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/core/grouping.mjs (reported line 236)May include surrounding context.

js
function matchRule(text, rules) {
  const haystack = String(text || "").toLowerCase();
  return rules.find((rule) => rule.patterns.some((pattern) => haystack.includes(pattern)));
}

function topArtifactDirectory(artifacts) {

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description is entirely in Chinese and explicitly frames when users should invoke the skill, but it does not indicate that other languages are supported or that the user can choose their preferred language. This can violate language/locale policy expectations when a skill is presented to a broader audience without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The sample prompt instructs users to invoke the skill in Chinese, with no alternative language examples or note that output can follow user preference. This effectively nudges all users into one language without explicit opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill enables implicit invocation while using a broad default prompt and no explicit scoping constraints, which can cause the assistant to trigger this skill in situations the user did not clearly intend. Because this skill scans recent Codex sessions, project artifacts, skills, automation tasks, and token records, an accidental invocation could expose sensitive local usage history and produce reports from data outside the user’s immediate request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The HTML document is explicitly marked with lang="zh-CN", and the visible UI text throughout the template is also fixed in Chinese. This imposes a specific language/locale on all users without any opt-in, fallback, or documented region-specific justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

该文件全文以中文编写,未说明这是区域性/特定受众限定文档,也未提供语言选择或用户可选项。根据规则,若技能内容强制特定语言且没有用户选择或明确合理说明,可视为自然语言层面的语言/地区策略违反。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The title and the entire specification are written as mandatory Chinese report-design guidance, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The function emits user-facing error strings entirely in Chinese, such as '没有找到 Codex 数据目录' and '工作区路径不存在'. This enforces a specific language/locale in the skill's natural-language output with no indication of user choice, fallback, or documented locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Warning and info diagnostics in this file are written only in Chinese, including messages about missing sessions, malformed records, and token counts. Under the policy, forcing a language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The report generation hard-codes the locale to "zh-CN" when formatting timestamps, which enforces a specific language/locale regardless of user preference. This is reinforced elsewhere by Chinese-only user-facing strings, but L052 is the clearest explicit locale policy violation in code.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The function formats user-visible strings using Chinese phrases such as "无法完成操作", "发生未知错误", "请检查输入后重试。", and "详情:" with no indication that the user can choose another language. This can violate a language/locale policy when a skill forces a specific language by default rather than offering opt-in or configurability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Multiple user-facing labels, summaries, and prompt templates are written only in Chinese, such as the labels in SIGNALS and all CATEGORY_TEMPLATES strings. This can violate language/locale policy because the skill imposes a specific language on users without opt-in or justification that it is intended only for a Chinese-language environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file contains multiple user-facing strings in Chinese, including validation errors and default report text, but there is no indication that the skill is intentionally region-specific or that users can opt into another language. That creates a natural-language policy risk because the skill effectively forces a specific language by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script presents diagnostics, errors, and help text in Chinese, which forces a specific language for users. There is no opt-in, language selection mechanism, or documentation that this skill is intentionally limited to a Chinese-speaking audience.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The script scans potentially sensitive local Codex data and project artifacts, then persists a detailed JSON report to disk by default, including workspace metadata, session counts, artifacts, environment details, and token usage. Because the default output path is a predictable temp-file location and the tool does not clearly warn users that this data will be stored, it increases the risk of unintended disclosure through shared machines, temp-directory access, backups, or later accidental sharing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The display name, description, and default prompt are all written in Chinese, which may impose a language expectation on users without any stated opt-in or locale rationale. The policy calls for avoiding forced language or locale constraints unless choice or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

Labels such as 'Codex 会话目录', '工作区', and similar strings are embedded directly in the code and will surface in diagnostics. This continues the pattern of imposing a single locale without user choice.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Manifest 描述强调扫描本地数据并生成 HTML 报告,但这里额外实现了通过 open/cmd/xdg-open/agent-browser 启动外部程序的能力。自动打开报告属于便捷功能而非生成报告本身的必要能力,因此相对该技能声明用途显得能力越界。

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/build_report.mjs:378