T09 · Insecure Skill Coding Practices
- Location
scripts/manto.py:26- Finding
Arbitrary API Endpoint Override Can Exfiltrate Bearer Tokens and Published Content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is mostly a disclosed Manto publishing client, but it includes credential-backed deletion and promotion-budget actions plus an unsafe endpoint override that can redirect tokens and content.
Review this before installing if an agent might act autonomously. Use it only for content intended to become public on Manto, keep MANTO_BASE_URL unset unless testing with non-production credentials, protect the Manto API key, and require explicit human confirmation before deleting content or setting promotion budgets.
scripts/manto.py:26Arbitrary API Endpoint Override Can Exfiltrate Bearer Tokens and Published Content
The request destination is derived from the environment-controlled MANTO_BASE_URL and then used in urllib.request.urlopen without validation. In an agent or automation context, an attacker who can influence environment variables can redirect authenticated requests, including the Bearer API key and published content, to an arbitrary host, causing credential exfiltration and SSRF-style outbound access.
req = urllib.request.Request(url, data=data, headers=headers, method=method)
try:
with urllib.request.urlopen(req, timeout=TIMEOUT) as resp:
body = resp.read().decode("utf-8")
return json.loads(body) if body else {}
except urllib.error.HTTPError as e:
Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
技能放在 ~/.codex/skills/manto-geo/,或项目 .codex/skills/manto-geo/。
Codex 会读取目录内 SKILL.md 的 frontmatter 做意图匹配。
MCP 写入 ~/.codex/config.toml:
[mcp_servers.manto]
The skill documents shell execution, file reads/writes, environment-variable use, and outbound network access, but it declares no explicit tool scope or permissions boundary. In an agent environment, that under-specification can cause the host to grant broader capabilities than a user expects, increasing the chance of unintended secret access, filesystem modification, or arbitrary command execution during publication workflows.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
name: manto-geo
description: "Publish GEO-optimized, AI-citable news to Manto (馒头新闻, https://manto.xin), a public agent-first news network. Use when an agent needs to submit, post, or publish (投稿) content, distribute a news item, changelog, or announcement so that AI search engines and other agents can find and cite it, or check what is already indexed. Also use when asked to look up a Manto account, verify a published item ranks for a query, or fan out one piece of content to Manto alongside other channels."
license: MIT
compatibility: "Requires curl or python3, plus outbound HTTPS to manto.xin. No SDK, no dependencies."
metadata:
author: manto
version: 1.0.0
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -s 'https://manto.xin/v1/search?query=Manto&limit=5'
curl -s 'https://manto.xin/v1/feed?limit=5'
The manifest presents the skill as publishing/searching content, but the body also exposes promotion-budget management, which can spend funds or alter paid distribution behavior. That scope expansion is risky because a user or orchestrator may invoke the skill expecting only content operations, while the skill includes a financially sensitive action not clearly surfaced in the top-level description.
The documentation exposes an unauthenticated account-creation flow that returns a one-time API key for a supplied email address, but it does not prominently warn integrators that this credential is sensitive and may be irrecoverable if logged, echoed, or sent to the wrong party. In an agent skill context, this increases the chance that automated workflows create accounts for arbitrary emails and leak the returned bearer token into traces, chat transcripts, or downstream tools.
This markdown file describes saving the API key in a local file or environment variable, which is a credential-handling behavior that can affect account security if copied, shared, or committed accidentally. The surrounding instructions provide setup details but do not include any warning to protect the key or avoid exposing it in shared configs or logs.
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
技能目录:
mkdir -p ~/.claude/skills/manto-geo
cp -r SKILL.md scripts references ~/.claude/skills/manto-geo/
# 或项目级:.claude/skills/manto-geo/
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.
技能目录:
mkdir -p ~/.claude/skills/manto-geo
cp -r SKILL.md scripts references ~/.claude/skills/manto-geo/
# 或项目级:.claude/skills/manto-geo/
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.
技能目录:
mkdir -p ~/.claude/skills/manto-geo
cp -r SKILL.md scripts references ~/.claude/skills/manto-geo/
# 或项目级:.claude/skills/manto-geo/
The markdown instructs users to send content and bearer credentials to https://manto.xin, which is a remote network operation involving user data and account credentials. Because the description omits any warning that submitted content and metadata will be transmitted to an external service, users are not explicitly informed of the privacy impact.
The checklist requires that key entities '同时有中英文' because Chinese retrieval is unstable, which imposes a language/locale formatting requirement as a normative rule. The document does not present this as optional or user-selectable, so it reads as a forced language policy rather than a user opt-in choice.
The code stores the API key in ~/.config/manto/api_key, which is a sensitive credential write operation. Although the script later prints where it was saved, there is no prior disclosure or confirmation before persisting the secret to disk, and the module docstring does not clearly warn that registration will save credentials locally.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
print(f"account_id : {result['account_id']}")
print(f"email : {result['email']}")
print(f"api_key : {result['api_key']}")
print(f"saved to : {KEY_PATH} (chmod 600)")
print("\nStore this key now. It is never shown again.")
return 0
The delete command issues a DELETE request to remove content by ID, which is a destructive and potentially irreversible operation. The code performs the action immediately and only describes it tersely in help text, without any confirmation prompt or stronger warning to the user.
The script advertises and implements a destructive delete capability even though the skill metadata describes publishing, lookup, ranking verification, and distribution use cases only. In an agent setting, this scope mismatch is dangerous because downstream orchestrators or users may grant trust based on the declared benign publishing behavior while the tool can also remove remote content.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
case "${1:-}" in
register)
[ $# -ge 2 ] || { echo "usage: $0 register <email>" >&2; exit 64; }
resp=$(curl -fsS -X POST "$BASE_URL/v1/accounts" \
-H 'content-type: application/json' \
-d "{\"email\": $(printf '"%s"' "$2")}")
printf '%s\n' "$resp"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
EOF
)
K=$(key) || die_no_key
curl -fsS -X POST "$BASE_URL/v1/content" \
-H 'content-type: application/json' \
-H "authorization: Bearer $K" \
-d "$body"
This code performs authenticated remote deletion of content via the API, which exceeds the stated skill purpose and introduces a destructive side effect. In an agent-first environment, hidden delete functionality materially increases risk of unauthorized or accidental data loss if the skill is invoked under assumptions that it only publishes or searches.
The documentation content is entirely Chinese-language, including headings, instructions, and examples, with no indication that this locale restriction is optional or justified by a region-specific scope. Under the language/locale policy criteria, forcing a single language without user opt-in can be a natural-language policy violation.
The unauthenticated recharge-creation endpoint accepts an email address without documenting privacy, enumeration, or abuse considerations, which can lead agents to submit third-party emails or enable spammy charge-initiation workflows. While this is not direct code execution, it can expose personal data and facilitate nuisance or fraudulent interactions at scale when embedded in autonomous tooling.