Back to skill

Security audit

实时新闻

Security checks for vulnerabilities and agentic risk

Overview

This real-time news skill appears purpose-related, but it requires a user API key and stores it persistently in a local plaintext .env file without adequate controls.

Install only if you are comfortable giving this skill a Xiaobenyang API key and having it saved in a local .env file. Prefer using an isolated workspace, a low-privilege or revocable API key, and manually deleting or rotating the key after use; do not use this in shared directories until secret storage and endpoint validation are tightened.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:43
Finding

API Key Persisted Without Restrictive File Permissions

Content
View full analysis
bool: """将API key保存到.env文件""" try: env_path = Path(".env") lines = [] if env_path.exists(): lines = env_path.read_text(encoding="utf-8").splitlines() found = False new_lines = [] for line in lines: if line.startswith("XBY_APIKEY="): new_lines.append(f"XBY_APIKEY={api_key}") found = True else: new_lines.append(line) if not found: new_lines.append(f"XBY_APIKEY={api_key}") env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8") os.environ["XBY_APIKEY"] = api_key return True except Exception as e: print(f"保存API key失败: {e}") return False ``` ### Technical Analysis The function persists the API key as plaintext in a `.env` file using `Path.write_text()`. It neither creates the file with a restrictive mode such as `0600` nor verifies or corrects the permissions of an existing file. The resulting permissions depend on the process umask and pre-existing file state. In a shared workspace, container volume, CI environment, or multi-user host, another local principal may be able to read the credential. The function also follows filesystem links normally. If an attacker can create or replace `.env` with a symbolic link before this function runs, the write could target another file accessible to the process. The exact consequences of that condition depend on the process privileges and filesystem protections. ### Attack Path 1. An attacker obtains local access to the project directory or a process capable of reading files in that directory. 2. The user supplies an API key as required by the Skill ...[truncated 1034 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:9
Finding

Configurable API Endpoint Can Redirect Credential-Bearing Requests

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Dependencies Are Not Reproducibly Pinned

Content
View full analysis
=2.31.0 pydantic>=2.7.0 pydantic-settings>=2.2.0 python-dotenv>=1.0.1 ``` ### Technical Analysis Every dependency uses a lower-bound-only version constraint. A future installation can therefore resolve to any newer compatible release available from the configured package index. This makes builds non-reproducible and allows code that was not part of the reviewed dependency set to enter the runtime automatically. The audit found no evidence that the listed package names are typosquatted or currently malicious. The risk is instead that a future compromised, malicious, or incompatible release could be selected without an explicit review. No lock file or package hashes are present to authenticate the exact artifacts expected by the project. ### Attack Path 1. A future package version satisfying one of the `>=` constraints is published or becomes available through the configured package index. 2. The release is compromised, malicious, or contains a security regression. 3. A fresh installation resolves the dependency to that unreviewed version. 4. Package installation hooks or imported package code execute in the Skill's Python environment. 5. The resulting impact depends on the malicious or vulnerable dependency and the privileges of the installation or runtime process. This is a supply-chain hardening issue rather than evidence of a currently malicious dependency. ### Impact Assessment If a malicious dependency release is resolved, it may execute with the privileges of the package installer or Skill runtime. Depending on that environment, potential scope could include reading project files and environment variables, stealing the API key, modifying application files, or making outbound network requests. The current file alone does not prove that any such c ...[truncated 115 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as a news feature, yet it also reads and writes local configuration, accesses environment variables, and persists API credentials. Those behaviors materially exceed user expectations for a simple content-retrieval skill and increase the risk of secret exposure, unauthorized configuration changes, and abuse of local state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a news feature, yet it also reads and writes local configuration, accesses environment variables, and persists API credentials. Those behaviors materially exceed user expectations for a simple content-retrieval skill and increase the risk of secret exposure, unauthorized configuration changes, and abuse of local state.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 13)May include surrounding context.

python
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 32)May include surrounding context.

python
model_config = SettingsConfigDict(
        env_prefix="XBY_GAOKAO_",
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The model_post_init method forcibly reads .env and extracts XBY_APIKEY outside the normal typed settings flow, creating hidden credential handling behavior. This increases risk by silently sourcing secrets from local disk and making the code’s secret ingestion less transparent and harder to audit.

Content

Scanner excerpt · scripts/config.py (reported line 31)May include surrounding context.

python
default_year: int = 2025

    def model_post_init(self, __context):
        # 强制从 .env 文件读取 XBY_APIKEY
        env_path = Path(".env")
        if env_path.exists():
            content = env_path.read_text(encoding="utf-8")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/config.py (reported line 39)May include surrounding context.

python
if line.startswith("XBY_APIKEY="):
                    self.api_key = line.split("=", 1)[1].strip()
                    break
        # 如果环境变量有值,覆盖 .env 的值
        env_val = os.getenv("XBY_APIKEY", "")
        if env_val:
            self.api_key = env_val

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

This function explicitly saves API credentials to a local .env file, creating a persistent secret at rest on disk. If the file is readable by other local users, included in backups, exposed in logs/tools, or accidentally committed, the credential can be stolen and abused against the remote service.

Content

Scanner excerpt · scripts/config.py (reported line 48)May include surrounding context.

python
def save_api_key_to_env(api_key: str) -> bool:
    """将API key保存到.env文件"""
    try:
        env_path = Path(".env")
        lines = []
        if env_path.exists():
            lines = env_path.read_text(encoding="utf-8").splitlines()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares no explicit tool/permission scope while its documented project structure and workflow imply access to environment variables, local file read/write, and networked API calls. That mismatch weakens least-privilege controls and makes it harder for a host to constrain what the skill may do, especially since it also persists secrets locally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill’s manifest and operating instructions are entirely written in Chinese and present the interaction model as mandatory, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not documented here.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to collect an API key from the user and persist it locally for later use. Persisting user-supplied secrets inside skill-managed files or environment state is dangerous because it expands the secret's exposure window, may store it insecurely, and can enable later unintended reuse or leakage by other components.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation mixes a real-time news skill with unrelated gaokao/school-search workflow and project naming, which is a strong integrity signal that the skill may be repurposed, copied, or incorrectly wired. Such inconsistencies make review and policy enforcement less reliable and can hide broader capabilities than the user intended to install.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow makes secret collection and saving a mandatory step before operation, normalizing credential harvesting inside the conversational flow. In a skill with unclear scope and broader-than-advertised capabilities, this increases the risk that users disclose credentials to functionality that is not adequately isolated or transparent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file’s configuration clearly targets a different service domain ('高考' with XBY_GAOKAO_ settings and a fixed remote endpoint) than the declared skill purpose of real-time news. This mismatch is suspicious because it can mislead users and reviewers about what backend is actually contacted and what credentials are being collected, increasing the chance of unauthorized data use or deceptive functionality.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code persists an API key into a local .env file even though the stated skill purpose does not suggest any need for durable credential storage. Storing secrets on disk broadens exposure through accidental commits, local disclosure, shared workspaces, backups, or later misuse by unrelated code in the same environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The function writes supplied API credentials directly to .env and exports them into the process environment without any visible confirmation, warning, or disclosure in code. This is dangerous because users or callers may unknowingly convert a transient secret into persistent local storage, increasing credential retention and leakage risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The docstrings for all functions use Chinese-only descriptions such as 实时数据/微博热搜 and similar labels, which imposes a specific language on users and maintainers. Under the policy rule, language-specific behavior should be opt-in or explicitly justified as region-specific, but no such choice or justification appears in this file.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency specifier uses a lower-bound only (requests>=2.31.0), which allows future releases to be installed without review and makes builds non-reproducible. This increases supply-chain risk and makes it difficult to verify whether a deployed version includes known security fixes or newly introduced vulnerabilities.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

Requests has multiple known advisories, and because the manifest does not pin the package, there is no reliable way to determine from this file alone whether an affected version will be installed. This is dangerous because environments may resolve to versions with known flaws, including credential leakage or other security defects, depending on installer behavior and timing.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The pydantic dependency is not pinned to a specific version, so installations may resolve to different releases over time. That weakens reproducibility and can expose the skill to vulnerable or incompatible versions without any code change in the repository.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: pydantic has 4 known advisory(ies) (CVE-2021-29510 (Use of "infinity" as an input to datetime and date fields causes infinite loop i); CVE-2024-3772 (Pydantic regular expression denial of service); CVE-2021-29510 (Pydantic is a data validation and settings management using Python type hinting.) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

Pydantic has published security advisories, but the unpinned requirement makes it impossible to verify whether the resolved version is affected. This uncertainty is a supply-chain risk because deployments can drift into vulnerable versions or remain on insecure ones without visibility.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

Using pydantic-settings>=2.2.0 permits unreviewed newer versions to be installed, which is a software supply-chain hygiene issue. In the presence of published advisories for this package family, lack of pinning prevents assurance that deployed environments avoid affected releases.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: pydantic-settings has 1 known advisory(ies) (CVE-2026-58203 (pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
86% confidence
Finding

The manifest does not constrain pydantic-settings to a known-safe version despite at least one published advisory. That means the actual installed version may be vulnerable, and the file provides no assurance that the environment avoids affected releases.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The python-dotenv package is specified with only a minimum version, allowing future versions to be pulled automatically. That creates uncertainty around security posture and can introduce vulnerable or behavior-changing releases into runtime environments.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
86% confidence
Finding

Python-dotenv has known advisories, and the lack of version pinning prevents verification that installations will avoid affected versions. This creates a low but real risk of pulling a vulnerable release, especially across different environments or future deployments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The class docstring identifies the skill in Chinese only, which is natural-language content embedded in code. This may indicate a fixed language experience without offering the user a language or locale choice.

Content

No source excerpt is available for this finding.