Back to skill

Security audit

codex-juxingyi-setup

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for configuring Codex with a third-party gateway, but it also exposes broad local Codex configuration and session history without enough scoping or warnings.

Install only if you are comfortable giving this skill access to your Codex configuration and prior session history. Before running codex-context.sh or codex-sessions.sh, assume the output may contain sensitive prompts, code, file paths, tool outputs, or secrets. Prefer reviewing the scripts first, avoid running them in automation, and use a test CODEX_HOME or sanitized config when possible.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/codex-context.sh:26
Finding

Unrestricted Disclosure of Codex Configuration and Session History

Content
View full analysis
/dev/null | sed 's/\[projects\.\(.*\)\]/\1/' || echo "") if [ -n "$PROJECTS" ]; then echo "| 项目路径 | 信任级别 |" echo "|---|---|" echo "$PROJECTS" | while read -r proj; do TRUST=$(grep -A1 "^\[projects\.$proj\]" "$CONFIG_FILE" 2>/dev/null | grep 'trust_level' | sed 's/.*= *"\(.*\)".*/\1/' || echo "") echo "| \`$proj\` | $TRUST |" done else echo "(无配置项目)" fi fi ``` `scripts/codex-context.sh:96-127` extracts conversation messages and session metadata: ```bash if [ -d "$SESSIONS_DIR" ] && command -v jq &>/dev/null; then # 找到最近 N 个 rollout 文件 RECENT_FILES=$(find "$SESSIONS_DIR" -name "rollout-*.jsonl" -type f 2>/dev/null | sort -r | head -"$SESSION_DETAIL_COUNT") if [ -n "$RECENT_FILES" ]; then for FILE in $RECENT_FILES; do echo "### $(basename "$FILE")" echo "" # 提取会话元信息 META=$(head -1 "$FILE" 2>/dev/null || echo "") if [ -n "$META" ]; then CWD=$(echo "$META" | jq -r '.payload.cwd // "未知"' 2>/dev/null || echo "未知") ORIGINATOR=$(echo "$META" | jq -r '.payload.originator // "未知"' 2>/dev/null || echo ...[truncated 4523 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/configure.sh:97
Finding

TOML Configuration Injection Through Unescaped Environment and User Input

Content
View full analysis
"$CONFIG_FILE" ``` ### Technical Analysis `API_BASE` and `MODEL` are placed inside quoted TOML values without escaping quotes, backslashes, carriage returns, or newline characters. Validation of the selected model only produces a warning and does not reject values absent from the gateway model list. An attacker able to influence `JUXINGYI_MODEL`, interactive input, or the process environment can close the intended TOML string and add arbitrary TOML keys or tables. For example, a multiline model value can create an additional `[mcp_servers.*]` section containing an attacker-selected command. Codex may then interpret that injected section when i ...[truncated 1660 chars]
Remediation
View remediation
&2 exit 1 } ``` 3. Reject all control characters, newlines, carriage returns, quotes, and backslashes unless they are correctly serialized. 4. Parse `JUXINGYI_API_BASE` as a URL and require an `https` scheme, a valid hostname, and no embedded credentials or control characters. 5. Treat a model not found in the retrieved model list as an error by default rather than continuing after a warning. 6. Validate the generated file with a TOML parser before replacing the existing configuration. 7. Write to a temporary file with restrictive permissions, then atomically rename it only after validation succeeds. 8. Preserve the existing configuration through structured parsing instead of deleting lines with `grep`, which can change configuration semantics unexpectedly. 9. Add regression tests using quotes, backslashes, newlines, Unicode control characters, and injected table headers. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/install.sh:52
Finding

Unpinned Global Installation of a Third-Party Package

Content
View full analysis
/dev/null; then echo " 正在安装..." npm install -g @openai/codex echo " 安装完成" else echo " npm 未安装,请先安装 Node.js" fi fi fi fi ``` ### Technical Analysis The installer requests the current registry version of `@openai/codex` and installs it globally. No audited version, package digest, lockfile, registry restriction, or provenance verification is applied. As a result, the code installed by the Skill can change after the Skill itself has been reviewed. If the upstream package, maintainer account, registry resolution, or local npm configuration is compromised, installation can introduce unintended code. npm lifecycle behavior may execute with the privileges of the user performing the installation. The package name is recognizable and there is no evidence in the audited repository that it is intentionally malicious. The risk arises from mutable, unverified supply-chain resolution. ### Attack Path 1. An attacker compromises the resolved package release, its publishing account, the configured npm registry, or dependency resolution. 2. The user runs `scripts/install.sh` and approves installation. 3. `npm install -g @openai/codex` resolves the then-current package version rather than a reviewed version. 4. npm downloads and installs the altered package globally and may execute permitted lifecycle behavior. 5. The installed `codex` command subsequently ...[truncated 683 chars]
Remediation
View remediation
`. 2. Document the expected version and update it only after explicit security review. 3. Verify package provenance, signatures, or published integrity metadata before installation. 4. Explicitly use the intended official npm registry and detect unexpected registry overrides. 5. Avoid elevated installation privileges and warn users not to run the script through `sudo`. 6. Prefer a project-local or isolated installation when global installation is not essential. 7. Provide the resolved package version to the user before requesting installation confirmation. 8. Consider downloading a versioned official release artifact and verifying a vendor-published checksum or signature. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description underplays outbound network interactions by framing the skill mainly as local installation and configuration, while it also contacts a third-party gateway to enumerate models and validate connectivity using the user's API key. Undisclosed network use increases data-handling and trust risks, especially when paired with config modification.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description underplays outbound network interactions by framing the skill mainly as local installation and configuration, while it also contacts a third-party gateway to enumerate models and validate connectivity using the user's API key. Undisclosed network use increases data-handling and trust risks, especially when paired with config modification.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description underplays outbound network interactions by framing the skill mainly as local installation and configuration, while it also contacts a third-party gateway to enumerate models and validate connectivity using the user's API key. Undisclosed network use increases data-handling and trust risks, especially when paired with config modification.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description underplays outbound network interactions by framing the skill mainly as local installation and configuration, while it also contacts a third-party gateway to enumerate models and validate connectivity using the user's API key. Undisclosed network use increases data-handling and trust risks, especially when paired with config modification.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
93% confidence
Finding

The skill accesses and modifies ~/.codex/config.toml, which is a sensitive agent configuration location that may contain provider settings, project mappings, and other operational data. Unauthorized or poorly disclosed access to this directory can leak configuration details or alter agent behavior in ways the user does not expect.

Content

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

text

配置过程:
1. 备份现有 `~/.codex/config.toml`
2. 从聚星逸 `GET /v1/models` 拉可用模型列表
3. 写入聚星逸 provider 配置(保留原有 plugins/mcp_servers/projects 段)
4. 验证连通性(用配置的 key 调一次 `/v1/models`)

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs an agent to aggregate a user's Codex session history, project metadata, and conversation context for one-shot consumption. This creates a substantial privacy and data-minimization risk because a broad sweep of prior sessions can reveal secrets, proprietary code, credentials, and unrelated work without need-to-know boundaries.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README frames the skill as a simple install/configure/perceive workflow, but later documents that the agent can inspect active projects, recent sessions, and conversation summaries. That mismatch can mislead users about the scope of data exposure and cause them to grant access without understanding that conversation history and metadata may be surfaced to an agent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README explicitly states that running the context script allows an agent to obtain session lists, user messages, Codex replies, and tool-call summaries, but it does not provide a clear privacy warning or consent boundary. This creates a meaningful risk of exposing sensitive prompts, project names, or operational details to another agent or system context.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Aggregating recent session metadata and conversation summaries into agent-readable context creates a natural-language exfiltration channel. Even if intended for convenience, titles, IDs, timestamps, user messages, replies, and tool-usage summaries can contain secrets, customer data, codebase details, or internal operational information that another agent may further disclose or misuse.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs users to run shell scripts and install software, but it does not declare any tool scope or permissions. That omission reduces transparency and prevents meaningful review of what command execution and filesystem access the skill requires, which is risky given it modifies local Codex configuration and performs network calls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill documents commands that let an agent read recent Codex sessions and full conversation contents, but it does not provide a clear privacy warning. Users may not realize these commands can surface sensitive prompts, outputs, code snippets, filesystem paths, and project context to the agent.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script is explicitly designed to aggregate Codex configuration and recent conversation data into a single natural-language report for one-shot consumption. In the context of an agent skill, this is particularly dangerous because it creates a convenient bulk disclosure primitive that can expose sensitive local state to any downstream consumer of the output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script prints the entire local Codex configuration file directly, without warning or redaction. Configuration files commonly contain API endpoints, tokens, project paths, trust settings, and other sensitive details, so dumping them wholesale creates a clear disclosure risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script reads stored session logs and prints summaries of recent user and agent messages, which may include secrets, credentials, proprietary code, personal data, or sensitive prompts. Exposing conversation content in a one-shot report materially exceeds normal 'working status' telemetry and creates an easy exfiltration path to any caller that can invoke the skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script emits recent user and agent message summaries without any privacy warning, despite those messages likely containing sensitive operational, personal, or proprietary data. Because the output is formatted for easy reading and collection, it lowers the barrier to disclosure substantially.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

These lines intentionally extract and display user messages from stored conversation logs, turning persistent local history into immediately exposed plaintext output. This is a direct confidentiality issue because user messages often contain secrets, internal discussions, credentials, or other sensitive information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script performs an unsolicited network probe to the configured gateway by requesting "$BASE_URL/models", which goes beyond passive local status collection. This can disclose the existence of the local Codex setup, contact an attacker-controlled endpoint from config, and create unintended outbound traffic or telemetry.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code prints full session metadata, user messages, agent messages, tool-call arguments, and tool outputs from local Codex session files. Those records can contain sensitive prompts, filesystem paths, secrets, or command outputs, but the script provides no warning or confirmation before displaying them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script’s comments and all user-visible status messages are in Chinese, including usage guidance and operational output. This imposes a specific language on users without opt-in or justification, which matches the language/locale policy-violation category.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script prompts for an API key and then uses it in outbound curl requests to a remote gateway without giving the user an explicit warning that the credential will be transmitted over the network or describing how it will be handled. In this skill’s context, the whole purpose is to connect Codex to a third-party gateway, so network transmission is expected, but the lack of clear disclosure can still lead users to provide sensitive credentials without informed consent, especially since the endpoint is not an official Codex/OpenAI domain.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/codex-context.sh (reported line 43)May include surrounding context.

sh
echo "[1/2] 检测 ChatGPT 桌面版..."
CHATGPT_APP="/Applications/ChatGPT.app"
if [ -d "$CHATGPT_APP" ]; then
  VERSION=$(defaults read "$CHATGPT_APP/Contents/Info.plist" CFBundleShortVersionString 2>/dev/null || echo "未知")
  echo "  已安装 (版本 $VERSION)"
  echo "  路径: $CHATGPT_APP"
  CODEX_CLI_PATH="$CHATGPT_APP/Contents/Resources/codex"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/install.sh (reported line 13)May include surrounding context.

sh
echo "[1/2] 检测 ChatGPT 桌面版..."
CHATGPT_APP="/Applications/ChatGPT.app"
if [ -d "$CHATGPT_APP" ]; then
  VERSION=$(defaults read "$CHATGPT_APP/Contents/Info.plist" CFBundleShortVersionString 2>/dev/null || echo "未知")
  echo "  已安装 (版本 $VERSION)"
  echo "  路径: $CHATGPT_APP"
  CODEX_CLI_PATH="$CHATGPT_APP/Contents/Resources/codex"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language instructions and headings in the skill documentation are entirely Chinese, and there is no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking context. This can conflict with a language/locale policy requiring user opt-in or documented justification for a forced language.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

Line L20 states the skill does not hardcode any user-private information, which suggests a privacy-minimizing setup. However, the same README documents use of JUXINGYI_API_KEY as an input credential elsewhere, meaning the skill's actual operation depends on handling user-secret material even if it is not hardcoded.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

All user-facing comments and terminal output strings in the script are in Chinese, with no option for language selection or documentation that the skill is intentionally Chinese-only. This can violate language/locale policy when users are not given a choice or informed of the constraint.

Content

No source excerpt is available for this finding.