T09 · Insecure Skill Coding Practices
- Location
main.py:27- Finding
User-Controlled Session ID Enables Credential Path Traversal
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This RCS/SMS skill is mostly aligned with sending messages, but it needs review because it can mass-send external messages while storing API secrets locally with weak disclosure and controls.
Install only if you are comfortable giving this skill authority to send real SMS/RCS messages through the configured provider. Review recipients and content carefully before use, avoid bulk sends unless intentional, do not use shared credentials, and remove or harden local plaintext credential storage before using it in a sensitive environment.
main.py:27User-Controlled Session ID Enables Credential Path Traversal
main.py:47Reusable API Secrets Are Automatically Persisted in Plaintext
send.py:29Predictable Shared Temporary File Enables Rate-Limit Manipulation and Unsafe File Overwrite
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
| Rate Limit Error | Wait 60 seconds before retry. Adjust MIN_INTERVAL_SECONDS in config. | | Format Error | Use international format (+8613700000001) or domestic format (13700000001). |
Enable debug mode for detailed output:
python3 send.py -n "+8613700000001" -m "Test" --debug
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
| Rate Limit Error | Wait 60 seconds before retry. Adjust MIN_INTERVAL_SECONDS in config. | | Format Error | Use international format (+8613700000001) or domestic format (13700000001). |
Enable debug mode for detailed output:
python3 send.py -n "+8613700000001" -m "Test" --debug
If the code persists credentials or accesses user config directories while presenting itself as a messaging workflow, it creates a hidden secret-management surface that is not obvious from the description. In agent ecosystems, this kind of undisclosed filesystem and secret handling increases the risk of credential leakage, unsafe storage, and over-privileged execution.
If the code persists credentials or accesses user config directories while presenting itself as a messaging workflow, it creates a hidden secret-management surface that is not obvious from the description. In agent ecosystems, this kind of undisclosed filesystem and secret handling increases the risk of credential leakage, unsafe storage, and over-privileged execution.
If the code persists credentials or accesses user config directories while presenting itself as a messaging workflow, it creates a hidden secret-management surface that is not obvious from the description. In agent ecosystems, this kind of undisclosed filesystem and secret handling increases the risk of credential leakage, unsafe storage, and over-privileged execution.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
session_dir = Path.home() / ".5g_messaging"
session_dir.mkdir(exist_ok=True)
cred_file = session_dir / "credentials.json"
if cred_file.exists():
print("✅ 会话凭证已配置")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
session_dir = Path.home() / ".5g_messaging"
session_dir.mkdir(exist_ok=True)
cred_file = session_dir / "credentials.json"
if cred_file.exists():
print("✅ 会话凭证已配置")
The skill handles APP_ID and APP_SECRET as sensitive values and persists them without any explicit warning, consent, or protective controls visible in this module. In the context of a telecom messaging skill, compromise of these credentials could permit unauthorized message sending, abuse of carrier-backed messaging features, billing impact, or access to downstream APIs.
The invocation text is overly broad: phrases like 'send a text message', 'check text messages', 'use SMS', and especially 'needs to forward or mass send received text messages' can match ordinary user conversations and cause the skill to activate in sensitive messaging contexts. Because this skill can send or forward messages to external phone numbers, ambiguous triggering increases the risk of unintended message transmission, privacy violations, and abuse.
The README advertises mass sending and forwarding but does not prominently warn that these actions can disclose user data to external recipients, incur carrier/API costs, or propagate sensitive message contents. In a messaging skill, lack of a user-facing warning materially increases the chance of accidental privacy-impacting actions, especially when combined with natural language triggering.
The skill advertises capabilities that imply access to environment variables, filesystem, and network, but it does not declare any explicit tool scope or permission boundaries. In an agent setting, missing scope declarations can allow the skill to be invoked with broader-than-expected access, making credential reads, local file access, or outbound requests less transparent to reviewers and users.
The skill promotes sending and mass forwarding of messages without clearly warning that transmission may be irreversible, may expose personal data, and may impact third-party recipients. In a messaging context, absent consent and privacy warnings are especially risky because a mistaken send can immediately leak sensitive information to real phone numbers at scale.
The activation text is broad enough to match many ordinary messaging-related requests, which can cause the skill to trigger outside the user's intended scope. Because this skill can send or forward messages, overbroad activation increases the chance of accidental transmission, privacy violations, or unexpected use of credentials and external APIs.
The examples instruct users to export application credentials and enable a debug mode that reveals detailed request information, but they provide no warning about secret leakage in shell history, logs, screenshots, or console output. In a messaging skill that handles authentication and potentially recipient/message data, debug output can expose sensitive tokens, phone numbers, and message contents, increasing the risk of credential compromise or privacy violations.
The file’s title, docstrings, and user-facing output are presented in Chinese only, which imposes a specific language on users without indicating any option to select another language. This matches the policy concern for language or locale constraints that are not user-selectable or explicitly justified.
The file’s natural-language descriptions and parsing logic are entirely Chinese-specific, including the title, comments, trigger keywords, and a hardcoded China phone-number format. There is no indication that the user can choose another language/locale or that this restriction is explicitly documented as a justified region-specific constraint.
The docstring and user-facing examples indicate the skill processes natural-language input in Chinese and presents prompts entirely in Chinese, with no opt-in or alternative locale mentioned. This can be a natural-language policy issue when a skill effectively forces a specific language without giving the user a choice.
The code persists APP ID and APP SECRET to a predictable local file under the user's home directory without explicit consent, secure file permissions, encryption, or lifecycle controls. On multi-user systems, shared environments, backups, or compromised local accounts, these API credentials could be recovered and abused to send messages or access the provider account.
The file’s user-facing description and prompts are written entirely in Chinese, including the module docstring and later CLI messages, with no indication that another language is supported. This creates a language/locale policy issue when users are not given an explicit opt-in or alternative language choice.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
try:
response = requests.post(url, json=payload, headers=headers, timeout=30)
response.raise_for_status()
# 更新发送时间戳
This module persists APP_ID and APP_SECRET to local disk in plaintext under the user's home directory, creating a recoverable secret store that can be accessed by other local processes, backups, or users depending on filesystem permissions. For a messaging skill, retaining long-lived API credentials is sensitive and expands the blast radius of host compromise or accidental disclosure.
The code writes and deletes credential files silently, with no user-facing disclosure or consent mechanism, so users may not realize sensitive API credentials are being retained locally. This undermines informed consent and can leave secrets resident on disk longer than expected, increasing exposure during endpoint compromise or troubleshooting.
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
"app_id": app_id,
"app_secret": app_secret,
"session_id": session_id,
"saved_at": __import__('time').time()
}
with open(cred_file, 'w') as f:
The description frames the skill as 'the upgraded 5G intelligent SMS' with carrier real-name security, and examples throughout use China-specific numbers (+86 / 137...). This suggests a locale-specific messaging workflow, but the documentation does not clearly state that the skill is restricted to a specific region or offer any language/locale opt-in or choice.
The file title, headings, and usage instructions are entirely in Chinese, which effectively forces a specific language for users without any opt-in or alternative locale guidance. Under the stated policy, a language-specific constraint should either be optional for users or clearly documented as a justified region-specific limitation.