Back to skill

Security audit

Hot Topics Daily

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does the described hot-topic roundup, but it includes under-disclosed extra news-fetching code that uses API keys and an unsafe fixed temporary-file write.

Install only if you are comfortable with scheduled outbound news retrieval and Discord-oriented posting. Before enabling automation, confirm the Discord destination, run it as an unprivileged account, remove or fix the /tmp backup write, and either document/remove the Currents/GNews backup module or provide only limited API keys you are willing to use for that purpose.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Note
Location
scripts/global_news_fetcher.py:33
Finding
API Credentials Exposed Through URL Query Parameters<![CDATA[ ## Vulnerability Details **File Location**: `scripts/global_news_fetcher.py`, lines 33–40 and 68–75 **Vulnerability Type**: API credential exposure through URL query strings **Risk Level**: Low ### Vulnerable Code ```python params = { "language": "en", "country": "US,GB,JP,KR", "limit": limit, "apiKey": self.currents_key } response = requests.get(url, params=params, timeout=10) ``` ```python params = { "topic": "technology", "lang": "en", "country": "us", "max": limit, "token": self.gnews_key } response = requests.get(url, params=params, timeout=10) ``` ### Technical Analysis The script reads `CURRENTS_API_KEY` and `GNEWS_API_KEY` from environment variables and supplies them as query parameters in HTTPS GET requests. The credentials are sent only to the corresponding hard-coded Currents and GNews endpoints, so the behavior supports the declared news-fetching functionality and is not evidence of malicious exfiltration. Nevertheless, credentials in URL query strings can be recorded in reverse-proxy logs, API gateway logs, network-monitoring systems, server access logs, or diagnostic output. HTTPS protects the URL while it is in transit but does not prevent endpoints and authorized intermediaries from logging the complete request target. ### Attack Path 1. A legitimate Skill execution sends a request containing the API key in the query string. 2. A server, proxy, gateway, or monitoring component records the complete request URL. 3. An attacker obtains access to those logs through a separate compromise, excessive log permissions, or accidental log disclosure. 4. The attacker extracts the `apiKey` or `token` value. 5. The attacker reuses the credential against the corresponding API until the key is revoked, restricted, or rate-limited. This path requires access to infrastructure capable of observing or retaining the request URL; the code does not intentionally send credentials to an unrelated destination. ### ...[truncated 499 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Use an authorization header instead of a query parameter if the relevant API supports header-based authentication. 2. If query-parameter authentication is mandatory, configure all proxies, gateways, monitoring tools, and server logs to redact `apiKey` and `token`. 3. Do not include complete request URLs in application logs or exception messages. 4. Apply provider-supported key restrictions, rate limits, quota alerts, and expiration policies. 5. Store the credentials only in an approved secret manager or protected environment variables. 6. Rotate credentials if request URLs may already have been retained in accessible logs. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/push.cjs:149
Finding
Predictable Temporary File Permits Symlink-Based File Overwrite<![CDATA[ ## Vulnerability Details **File Location**: `scripts/push.cjs`, lines 149–151 **Vulnerability Type**: Unsafe temporary-file handling **Risk Level**: Medium ### Vulnerable Code ```javascript // 同时保存到文件备份 const outputPath = '/tmp/hot-topics-message.md'; fs.writeFileSync(outputPath, message); console.error(`\n✅ 完成: ${successCount} 成功, ${failCount} 失败`); console.error(`📍 备份: ${outputPath}`); ``` ### Technical Analysis The script writes its generated message to the fixed path `/tmp/hot-topics-message.md`. Shared temporary directories are normally writable by multiple local users. `fs.writeFileSync()` follows symbolic links and opens an existing target for truncation without exclusive creation or a no-follow check. Consequently, another local user may create the predictable path as a symbolic link to a different file before the scheduled script executes. If the Skill's operating-system account can write to the linked target, execution will truncate and replace that target with the generated news message. The backup is not required for obtaining or formatting news, and using a shared fixed path therefore exceeds the minimum filesystem access needed for the primary stdout-based workflow. ### Attack Path 1. An attacker obtains local access to the same host and can write within `/tmp`. 2. Before the scheduled Skill execution, the attacker creates `/tmp/hot-topics-message.md` as a symbolic link to a chosen target. 3. The cron or Agent process runs `scripts/push.cjs`. 4. `fs.writeFileSync()` follows the symbolic link and truncates the target. 5. The generated Markdown message is written into the target file. Successful exploitation requires the Skill's execution account to have write permission for the chosen target. Running the Skill with elevated privileges would substantially increase the possible impact. ### Impact Assessment The attacker may overwrite or corrupt files writable by the Skill's account. Potential consequences include application fail ...[truncated 344 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the backup write if stdout is the only required output channel. 2. If a backup is necessary, create a private temporary directory using `fs.mkdtempSync()` and assign restrictive permissions. 3. Generate a non-predictable filename inside that private directory. 4. Use exclusive file creation, such as the `wx` flag, to prevent silently opening an attacker-created file. 5. Where supported, use no-follow protections and verify with `lstat()` that the destination is not a symbolic link. 6. Ensure that the parent directory is owned by the Skill's execution account and is not writable by untrusted users. 7. Run the Skill under a dedicated, unprivileged account with access only to the resources required for news retrieval and output. ]]>
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 (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A description-behavior mismatch is security-relevant because users may approve the skill expecting domestic hot-topic collection, while the package appears to fetch different news sources and may not actually perform the claimed Discord delivery. This undermines informed consent and can conceal unreviewed network behavior or undeclared data handling, which is especially risky for scheduled automation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill declares executable behavior that requires network access and likely environment/config access, but it does not declare any explicit tool scope or permissions. This weakens reviewability and can lead users or orchestrators to grant broader capabilities than expected, increasing the chance of unintended outbound access or misuse.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
A scheduled skill that transmits fetched content to Discord should prominently warn users about the automatic outbound posting behavior. Without explicit disclosure, users may enable the skill without realizing it will periodically send externally sourced content to a third-party service, creating privacy, compliance, and operational risks.

Vague Triggers

Medium
Confidence
80% confidence
Finding
This manifest description says the skill will 'automatically fetch' trending topics from multiple platforms and send them to Discord, but it does not specify the trigger conditions, schedule, scope, or constraints for when this happens. In a manifest file, that lack of specificity can make invocation behavior ambiguous and increase the chance of unintended activation or user misunderstanding.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a skill that aggregates daily hot-search rankings from specific Chinese platforms (Weibo, Zhihu, Baidu, Bilibili, Douyin, Toutiao) and pushes them to Discord. This module explicitly adds international news sources via Currents API and GNews, which is a different content domain from the declared platform hot-search roundup.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This code file contains natural-language strings and documentation entirely in Chinese, including the module description and runtime output, which imposes a specific language on users. The policy allows locale constraints only when users are given a choice or when the restriction is clearly documented and justified, neither of which appears here.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The code loads CURRENTS_API_KEY and GNEWS_API_KEY to access external international news APIs. Given the manifest’s stated purpose of fetching hot-search lists from named platforms and sending them to Discord, introducing separate global news providers and their credentials is not clearly justified by the declared scope.

External Transmission

Medium
Category
Data Exfiltration
Content
self.currents_key = os.getenv('CURRENTS_API_KEY')
        self.gnews_key = os.getenv('GNEWS_API_KEY')

        self.CURRENTS_URL = "https://api.currentsapi.services/v1"
        self.GNEWS_URL = "https://gnews.io/api/v4"

    def get_world_news_currents(self, limit: int = 10) -> Optional[List[Dict]]:
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The script formats the date with the fixed locale 'zh-CN' and builds the main message text entirely in Chinese. This is a natural-language policy concern because it forces a specific language/locale on all users without any opt-in or configuration mechanism in the file.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The manifest describes an automation that grabs hot-topic feeds and sends them to Discord, which implies network retrieval and message generation. This script additionally persists the full generated message to `/tmp/hot-topics-message.md`, a local side effect not mentioned in the stated purpose and not required by the description.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The natural-language description and instructions are presented entirely in Chinese, which can constitute a language/locale policy issue when no user opt-in or justification is provided. The file does not state that the skill is intentionally region-specific or offer an alternative language option.

Description-Behavior Mismatch

Low
Confidence
88% confidence
Finding
The manifest and README consistently describe this skill as fetching and pushing hot topics from six specified Chinese platforms to Discord. However, the documented file structure includes `global_news_fetcher.py` labeled as '国际新闻(备用)', which is a distinct content scope not mentioned in the manifest description.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The platform display names are all specified in Chinese string literals, which imposes a specific language/locale in the skill configuration. There is no indication in this file of user opt-in, language selection, or documentation that the skill is intentionally limited to a Chinese-language or region-specific context.

Intent-Code Divergence

Low
Confidence
96% confidence
Finding
The file header claims the script fetches Weibo, Zhihu, Baidu, B站, and Douyin hot topics. However, the implementation includes `formatToutiao` and registers `'toutiao'` in the formatter map, so the documentation understates actual behavior and contradicts the code's supported platform set.

Static analysis

Detected: suspicious.potential_exfiltration

File read combined with network send (possible exfiltration).

Warn
Code
suspicious.potential_exfiltration
Location
scripts/push.cjs:17