Back to skill

Security audit

News Brief Skill

Security checks for vulnerabilities and agentic risk

Overview

This news briefing skill mostly matches its stated purpose, but its handling of user IDs, delivery endpoints, and stored credentials creates review-worthy security risk.

Review before installing. Use only in a contained environment with a dedicated non-privileged account, restrict outbound network access to intended news and delivery providers, avoid storing high-value SMTP or bot credentials, and require fixes for user_id path validation, secret storage, endpoint allowlisting, and backup retention before multi-user or production use.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/config_manager.py:64
Finding

Unsanitized User Identifiers Permit Filesystem Path Traversal

Content
View full analysis
bool: try: user_dir = self.users_dir / user_id user_dir.mkdir(exist_ok=True) config_file = user_dir / "current_config.json" if config_file.exists(): self._backup_user_config(user_id) encrypted_config = self._encrypt_sensitive_fields(initial_config.copy()) with open(config_file, 'w', encoding='utf-8') as f: json.dump(encrypted_config, f, ensure_ascii=False, indent=2) return True ``` The same unvalidated identifier is used when loading and backing up configurations: ```python config_file = self.users_dir / user_id / "current_config.json" ``` ```python backup_dir = self.backups_dir / user_id backup_dir.mkdir(exist_ok=True) ``` It is also used for restoration and history files: ```python backup_file = self.backups_dir / user_id / f"config_backup_{backup_timestamp}.json" config_file = self.users_dir / user_id / "current_config.json" shutil.copy2(backup_file, config_file) ``` ```python user_dir = self.users_dir / user_id log_file = user_dir / "optimization_log.json" ``` ```python user_dir = self.users_dir / user_id history_file = user_dir / "feedback_history.json" ``` ### Technical Analysis `user_id` is treated as a safe directory name without validation. Python's `pathlib` does not automatically constrain a joined path to its intended parent. A value containing path separators, `..` components, or an absolute path can therefore resolve outside `data/users` or `dat ...[truncated 1497 chars]
Remediation
View remediation
Path: if not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", user_id): raise ValueError("Invalid user identifier") resolved_root = root.resolve() target = (resolved_root / user_id).resolve() if not target.is_relative_to(resolved_root): raise ValueError("User path escapes storage root") return target ``` 4. Apply equivalent validation to `backup_timestamp`, preferably parsing it as a fixed timestamp format rather than using it as an arbitrary filename component. 5. Obtain the authenticated user identity from trusted framework context rather than accepting it directly from untrusted input. 6. Add authorization checks before loading, restoring, or updating another user's data. 7. Add regression tests covering `../`, nested traversal, absolute paths, Windows drive paths, UNC paths, and encoded separators. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/config_manager.py:33
Finding

Incomplete Credential Encryption and Colocated Encryption Key

Content
View full analysis
bytes: """获取或创建加密密钥""" key_file = self.config_dir / "encryption.key" if key_file.exists(): with open(key_file, 'rb') as f: return f.read() else: key = Fernet.generate_key() with open(key_file, 'wb') as f: f.write(key) return key ``` Sensitive-field encryption only covers a limited hardcoded list: ```python def _encrypt_sensitive_fields(self, config: Dict[str, Any]) -> Dict[str, Any]: """加密敏感字段""" sensitive_fields = [ 'email_password', 'dingtalk_token', 'wechat_token', 'smtp_password', 'api_keys' ] encrypted_config = config.copy() for field in sensitive_fields: if field in encrypted_config and encrypted_config[field]: encrypted_config[field] = self._encrypt_data( str(encrypted_config[field]) ) return encrypted_config ``` However, the pusher consumes credential-bearing fields that are not in that list: ```python webhook_url = self.user_config.get('dingtalk_webhook') if not webhook_url: self.logger.warning("钉钉Webhook未配置") return False response = requests.post(webhook_url, json=message, timeout=10) ``` ```python bot_token = self.user_config.get('telegram_bot_token') chat_id = self.user_config.get('telegram_chat_id') if not bot_token or not chat_id: self.logger.warning("Telegram配置不完整") return False telegram_url = f"https://api.telegram.org/bot{bot_token}/sendMessage" ``` ### Technic ...[truncated 1897 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/pusher.py:173
Finding

Unrestricted Delivery Endpoints Enable SSRF and SMTP Credential Disclosure

Content
View full analysis
bool: try: smtp_server = self.user_config.get('smtp_server', 'smtp.gmail.com') smtp_port = self.user_config.get('smtp_port', 587) email_user = self.user_config.get('email_user') email_password = self.user_config.get('email_password') recipient_email = self.user_config.get('recipient_email') if not all([smtp_server, email_user, email_password, recipient_email]): self.logger.warning("邮件配置不完整") return False msg = MIMEMultipart() msg['From'] = email_user msg['To'] = recipient_email msg['Subject'] = f"新闻简报 - {datetime.now().strftime('%Y-%m-%d')}" msg.attach(MIMEText(content, 'plain', 'utf-8')) server = smtplib.SMTP(smtp_server, smtp_port) server.starttls() server.login(email_user, email_password) text = msg.as_string() server.sendmail(email_user, recipient_email, text) server.quit() return True ``` The DingTalk destination is also unrestricted: ```python def _push_dingtalk(self, content: str) -> bool: try: webhook_url = self.user_config.get('dingtalk_webhook') if not webhook_url: self.logger.warning("钉钉Webhook未配置") return False message = { "msgtype": "text", "text": { "content": content } } response = requests.post(webhook_url, json=message, timeout=10) return response.status_code == 200 ``` Connectivity tests repeat ...[truncated 2785 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:78
Finding

Unpinned Third-Party Dependencies Create a Mutable Supply-Chain Boundary

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config_manager.py:195
Finding

Broken Backup Retention Causes Indefinite Accumulation of Credential-Bearing Configurations

Content
View full analysis
/`. 3. `_cleanup_old_backups` executes and ...[truncated 758 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (34)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding indicates the code performs real outbound transmission to third-party services such as SMTP, DingTalk webhooks, and Telegram APIs while the declared permissions are empty and the skill description centers on broader news-brief functionality. Undeclared external transmission is especially risky because it can expose user content, metadata, or credentials to external systems without clear authorization or review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding indicates the code performs real outbound transmission to third-party services such as SMTP, DingTalk webhooks, and Telegram APIs while the declared permissions are empty and the skill description centers on broader news-brief functionality. Undeclared external transmission is especially risky because it can expose user content, metadata, or credentials to external systems without clear authorization or review.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises capabilities that imply file and network access, but it does not declare an explicit tool scope or permissions boundary. This is dangerous because the runtime may grant broader access than users or reviewers expect, reducing transparency and making misuse of filesystem or network operations harder to detect and control.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description does not clearly warn users that the skill may automatically collect preferences, store configuration and logs, and transmit data through third-party push channels and news sources. In a skill built around automated fetching and external delivery, weak disclosure increases the risk of uninformed consent, privacy violations, and accidental sharing of sensitive interests or contact endpoints.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are generic enough to overlap with normal conversation, which can cause unintended activation of a skill that performs network access, stores preferences, and may send outbound messages. In this context, accidental activation is more dangerous because the skill is designed for automated recurring actions and third-party transmission rather than a one-shot local response.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This JSON config contains multiple natural-language descriptions exclusively in Chinese, such as media labels on L09, L17, L27, L37, and L47. The file provides no indication that the skill is region-specific or that users can opt into this locale, which can violate the language/locale policy for skills that should not force a specific language by default.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template advertises very broad trigger words like "反馈" and especially "优化", which are common in normal conversation and can unintentionally invoke the optimization workflow. In a news-brief skill that accepts free-form user replies, this increases the chance of accidental state changes or unwanted workflow activation, even if it is not directly a code-execution issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This plain-text template hard-codes Chinese labels such as "来源" and "可信度", which would cause generated output to appear in a specific language regardless of user preference. The file does not indicate that the skill is region-specific or that users can opt into this locale, which conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

This JSON manifest uses only Chinese natural-language descriptions for all configured tools and feeds, with no indication that the skill is region-specific or that users can opt into this locale. Under the stated policy, forcing a specific language without user choice or clear justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation describes web crawling, multi-channel delivery, and optional third-party APIs, but does not clearly warn users that content, preferences, or delivery metadata may be transmitted to external services. This creates a transparency and consent gap that can expose user data to third parties without informed understanding of where data goes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation phrases are overly broad and overlap with normal conversation, increasing the chance the skill triggers unintentionally. Because this skill can fetch external content, modify settings through follow-up interaction, and push messages to channels, accidental activation could lead to unintended data processing or outbound communication.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation makes a misleading privacy claim by stating the skill does not collect user identity information, while elsewhere it explicitly stores a user_id and uses per-user directories and access control. This can cause users and operators to underestimate privacy exposure, weakening consent, retention, and compliance decisions around personally identifiable or linkable data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The get_all_users method enumerates every user directory in the local datastore, which expands the module's access beyond a single user's configuration and feedback scope. In a multi-user skill, this creates an unnecessary cross-tenant discovery capability that can aid information disclosure, account targeting, or later unauthorized access if exposed through other code paths.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The restore_user_config function replaces the current configuration file with a backup via shutil.copy2, which can overwrite the user's active config state. Although the function creates a backup first, there is no confirmation prompt or explicit user-facing disclosure in the method documentation or runtime output that a restore will overwrite current data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code presents end-user prompts entirely in Chinese (for example, the feedback prompt and optimization guides), while also expecting some English inputs such as "adjust", "optimize", and channel identifiers like "wechat/email/dingtalk/telegram". Because the skill does not offer the user a language or locale choice, it effectively forces a specific language pattern without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s natural-language documentation is written entirely in Chinese, including the module description and class docstring, with no indication that users can opt into another language or that the skill is intentionally region-specific. Under the language/locale policy, forcing a specific language without user choice or documented justification is a policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a skill that retrieves news, generates briefs, pushes them to channels, and supports feedback-driven optimization. In this file, the code not only fetches news but also rewrites tool priorities, switches source domains, and marks channels inactive, which is operational state management affecting system configuration rather than just user-facing news retrieval.

Content

No source excerpt is available for this finding.

Dynamic Request Target

Medium
Category
Server-Side Request Forgery
Confidence
92% confidence
Finding

The request target is built from configuration-controlled domain data and fetched directly with requests.get, enabling server-side requests to arbitrary hosts if an attacker can influence sources.json or related crawler/source inputs. In skill or agent environments, SSRF can be more dangerous because it may probe internal services, cloud metadata endpoints, or restricted network locations that are unreachable from outside.

Content

Scanner excerpt · scripts/news_fetcher.py (reported line 170)May include surrounding context.

python
def _is_domain_available(self, domain: str) -> bool:
        """检测域名是否可用"""
        try:
            response = requests.get(f"https://{domain}", timeout=10)
            return response.status_code == 200
        except:
            return False

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The email push path sends brief content over SMTP and uses stored email credentials from configuration, but the function only has an internal docstring and logger messages for failures/config issues. There is no confirmation prompt or explicit user-facing disclosure that content will be transmitted externally using those credentials.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This function posts message content to a user-configured DingTalk webhook URL, which is a network operation that transmits user data externally. Aside from a minimal internal docstring, there is no visible confirmation prompt or user-facing warning that the content will be sent to a remote service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/pusher.py (reported line 225)May include surrounding context.

python
}
            }
            
            response = requests.post(webhook_url, json=message, timeout=10)
            return response.status_code == 200
            
        except Exception as e:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The Telegram push path constructs an API URL with the bot token and sends message content to Telegram, which involves both credential use and external data transmission. The code lacks a confirmation prompt or clear user-facing disclosure of this behavior.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/pusher.py (reported line 242)May include surrounding context.

python
self.logger.warning("Telegram配置不完整")
                return False
            
            telegram_url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
            payload = {
                'chat_id': chat_id,
                'text': content,

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/pusher.py (reported line 321)May include surrounding context.

python
self.logger.warning("Telegram配置不完整")
                return False
            
            telegram_url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
            payload = {
                'chat_id': chat_id,
                'text': content,

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/pusher.py (reported line 249)May include surrounding context.

python
'parse_mode': 'HTML'
            }
            
            response = requests.post(telegram_url, json=payload, timeout=10)
            return response.status_code == 200
            
        except Exception as e: