Back to skill

Security audit

App智能巡检(异动报告)

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its UApp monitoring purpose, but it also enables default usage reporting through an external CLI and handles sensitive credentials in leak-prone ways.

Review before installing. Use this only if you are comfortable granting access to UApp monitoring credentials and application analytics data. Disable statistics with UMENG_ENABLE_STATS=false unless you explicitly want appkey/date usage events sent through umeng-cli. Avoid passing ak/sk on the command line, keep umeng-config.json out of version control, restrict its file permissions, and prefer pinned, local dependencies over a global unpinned npm install.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/helper.py:194
Finding

UApp Credentials Exposed Through URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: scripts/helper.py:194-198 and scripts/helper.py:221-224
Vulnerability Type: Credentials transmitted in URL query parameters
Risk Level: High

Vulnerable Code

python
params = {
    'ak': self.ak,
    'sk': self.sk,
    'appkey': appkey,
    'ds': date
}

response = requests.get(url, params=params, headers=self.headers)
response.raise_for_status()
python
params = {
    'ak': self.ak,
    'sk': self.sk
}

response = requests.get(url, params=params, headers=self.headers)
response.raise_for_status()

The same authentication design is documented in SKILL.md:75-88 and SKILL.md:110-122.

Technical Analysis

The API key and API security token are supplied through the params argument. The requests library consequently constructs URLs containing values such as:

text
https://mobile.umeng.com/ht/api/v3/ai/getYesterdayOutliers?ak=API_KEY&sk=SECURITY_TOKEN

HTTPS protects the URL while it is in transit, but it does not prevent the complete URL from being recorded by application diagnostics, HTTP proxies, gateways, server access logs, monitoring systems, or exception handlers.

This exposure is compounded by response.raise_for_status(). An HTTPError generated for a failed response can contain the request URL. The top-level exception handler at scripts/helper.py:379-381 prints exception text to standard error:

python
except Exception as e:
    print(f"Error: {e}", file=sys.stderr)
    sys.exit(1)

As a result, an HTTP failure may place both credentials in terminal output, CI/CD logs, agent transcripts, or centralized log storage.

Attack Path

  1. A user runs an outlier-report or yesterday-outliers request with valid UApp credentials.
  2. The script places ak and sk into the request URL.
  3. An attacker, network intermediary, service failure, or invalid request causes the endpoint to ...[truncated 1072 chars]
Remediation
View remediation

Remediation Suggestions

  1. Prefer an authorization header or protected request body instead of URL query parameters whenever supported by the UApp API.
  2. If the remote API requires query-string authentication, catch requests.HTTPError explicitly and never print the generated exception or prepared request URL directly.
  3. Construct sanitized errors using only the HTTP status code and a bounded, reviewed response message:
    python
    try:
        response.raise_for_status()
    except requests.HTTPError:
        raise RuntimeError(
            f"UApp request failed with HTTP status {response.status_code}"
        ) from None
    
  4. Add a centralized redaction function that removes ak, sk, Authorization, and bearer-token values from logs and errors.
  5. Disable verbose HTTP and proxy logging for authenticated requests, or configure those systems to redact sensitive query parameters.
  6. Review CI/CD, terminal, proxy, gateway, and server logs for prior exposure. Rotate credentials if credential-bearing URLs may have been retained.
  7. Add automated tests that trigger non-successful HTTP responses and verify that neither credential appears in standard output, standard error, exceptions, or logs.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:257
Finding

Unpinned Global Telemetry Dependency Creates a Supply-Chain Execution Risk

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:257-260 and requirements.txt:1
Vulnerability Type: Unpinned third-party dependencies and global package installation
Risk Level: Medium

Vulnerable Code

SKILL.md:257-260 instructs users to globally install an unpinned npm package:

bash
npm install -g @umengfe/umeng-cli

requirements.txt:1 also permits any compatible future release of requests without an upper bound or integrity hash:

text
requests>=2.28.0

Technical Analysis

The telemetry client invokes umeng-cli as a local executable. The installation command does not select a reviewed version and installs the package globally. Therefore, the package contents ultimately installed can change after this skill has been audited.

npm packages may execute lifecycle scripts during installation. If the package publisher account, registry delivery path, or a future release is compromised, installation can run attacker-controlled code with the permissions of the user executing npm. Global installation also makes the resulting executable available outside this project and increases the impact of a compromised release.

The lower-bound-only Python requirement similarly produces non-reproducible installations. Future versions satisfying requests>=2.28.0 are accepted automatically, and no hash verifies the downloaded artifact. This is weaker than a locked, integrity-verified dependency set, although no evidence was found that the currently named requests package is malicious.

Attack Path

  1. An attacker compromises the npm publisher account, package release pipeline, registry distribution path, or a future release of @umengfe/umeng-cli.
  2. The attacker publishes a release containing a malicious lifecycle script or executable.
  3. A user follows the documented unversioned command.
  4. npm resolves the package to the compromised release and executes any applicable installation l ...[truncated 1120 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin @umengfe/umeng-cli to a specific reviewed version:
    bash
    npm install --save-dev --save-exact @umengfe/umeng-cli@REVIEWED_VERSION
    
  2. Avoid global installation. Keep the dependency project-local and invoke it through a locked package script or an exact-version mechanism.
  3. Commit a package lockfile with integrity metadata and review changes before upgrading.
  4. Where operationally possible, disable npm lifecycle scripts during installation and separately review any package that requires them.
  5. Pin Python dependencies to reviewed versions and use hashes, for example through a generated lockfile and pip install --require-hashes.
  6. Run dependency tooling with least privilege in an isolated environment. Never install it as root or with unnecessary administrative permissions.
  7. Make telemetry tooling explicitly optional and disabled by default so core API functionality does not encourage installation of an additional global executable.
  8. Add automated dependency scanning and a controlled update process that reviews publisher identity, package integrity, release changes, and transitive dependencies.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose is querying UApp anomaly data, but the skill also introduces unrelated telemetry behavior, local queue/state handling, pseudo-device identification, and CLI-based reporting. This mismatch is dangerous because users and orchestrators may grant access expecting a simple read-only data query skill, while the skill performs additional tracking and local state operations that expand privacy and security risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README instructs users to place live API credentials in a local JSON file or environment variables but provides no guidance on preventing accidental disclosure through committed files, copied terminal output, shell history, or shared environments. In a skill that accesses production monitoring data, leaked credentials could allow unauthorized access to app anomaly reports and account-level inspection data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README explicitly demonstrates passing the API key and secret on the command line, which exposes secrets via shell history, process listings, audit logs, and CI job output. Because these credentials authorize access to UApp monitoring APIs, an attacker who observes them could query sensitive operational data or continue access until the keys are rotated.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares no explicit tool scope while instructing behavior that uses environment access, local file access, network requests, and shell execution. This creates an over-privileged and under-specified execution model where a caller cannot easily tell that the skill may read local config/secrets and invoke external commands, increasing the chance of unintended data access or command execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says to use the skill when users ask about 'app anomaly detection, outlier reports, abnormal metrics, application inspection,' which are broad phrases that could apply to many analytics or monitoring contexts, not just UApp. Although UApp/友盟+ is mentioned, the trigger scope is not narrowly constrained and lacks exclusion examples for non-UApp systems.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Sending usage statistics through an external CLI is not necessary to fulfill the stated function of querying anomaly reports, and it introduces an unnecessary outbound data channel. Even if the documented fields are limited, external telemetry can expose sensitive operational metadata such as app identifiers, usage patterns, and timing, and the CLI itself becomes part of the trust boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill states that it reports usage statistics after each API call, but this data transmission is not surfaced prominently in the main user workflow where consent and expectation are established. Hidden or de-emphasized telemetry is dangerous because users may provide appkeys and anomaly context without realizing operational metadata is being sent elsewhere.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Requiring installation and execution of an unrelated external CLI expands the attack surface beyond the core API-querying behavior. This can introduce supply-chain risk, shell execution risk, and unexpected privilege use on the user's machine, especially because the CLI is not essential to retrieving UApp anomaly data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script instantiates a StatsClient unrelated to its stated purpose of querying UApp anomaly data, creating an undisclosed side channel for operational metadata. Even if the telemetry only records event names and appkeys, it can leak sensitive usage patterns, monitored app identifiers, and query timing to another service without user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code sends ak, sk, appkey, and date values to a remote Umeng endpoint via HTTP request parameters, but the script provides no user-facing warning at execution time that credentials and application metadata will be transmitted externally. Although network access is central to the tool's purpose, there is no explicit disclosure that secrets are included in outbound requests, which is relevant for safe use of a helper script.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The helper performs extra side effects by reporting each API action through StatsClient after fetching UApp data. This expands the data flow beyond the advertised function of the tool and may expose sensitive business metadata such as which apps are being inspected and when, especially in monitoring or incident-response contexts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The code performs a remote HTTP request using Authorization: Bearer {self.sk}, but there is no visible confirmation prompt, warning, or runtime disclosure that a sensitive credential will be sent to an external service. For a code file handling credentials, this lack of user-facing warning reduces transparency around privacy-sensitive behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file is a telemetry client that reports usage statistics, which is unrelated to the skill's declared purpose of querying UApp outlier and inspection data. Hidden or unnecessary telemetry expands data exposure and supply-chain risk, especially when users would not reasonably expect background reporting from this skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code collects event metadata and submits it to an external CLI, creating an undeclared exfiltration path that is not justified by the skill's functional requirements. Because extra fields are merged directly into the payload, future callers could unintentionally include sensitive app identifiers or operational context in outbound telemetry.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Usage statistics are sent to an external command without any user-facing warning or confirmation in this file, which creates a covert telemetry channel. In the context of a skill whose stated purpose is data querying rather than analytics collection, undisclosed outbound reporting materially increases privacy and trust risk.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/stats_client.py (reported line 80)May include surrounding context.

python
def _send_via_cli(self, payload):
        """Send trace via umeng-cli command."""
        try:
            result = subprocess.run(
                ["umeng-cli", "trace", json.dumps(payload)],
                capture_output=True,
                text=True,

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The user-facing description and all natural-language invocation examples are presented only in Chinese. This can constitute a language-policy issue when no opt-in, alternative language option, or explicit region-specific justification is provided.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified as requests>=2.28.0, which allows installation of any future version and does not guarantee a reviewed, reproducible package set. This creates supply-chain and stability risk because vulnerable or incompatible releases could be pulled in without notice, especially in environments that resolve dependencies at install time.

Content

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

text
requests>=2.28.0

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
89% confidence
Finding

Because the manifest does not pin a specific requests version, there is no way to verify whether deployment will use a release affected by known advisories. In a skill that queries monitoring and application data over HTTP, use of an affected requests release could expose credentials, weaken transport verification, or mishandle sensitive network interactions depending on the resolved version.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file includes Chinese-only natural-language strings in the module description, error descriptions, and later CLI output, which effectively forces a specific language for users. The policy allows locale constraints when they are opt-in or clearly justified, but this script does not provide a language option or explain that it is intentionally Chinese-only.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
99% confidence
Finding

The module docstring says it 'Falls back to local queue if umeng-cli is not available,' but report() only calls _send_via_cli(payload) and ignores the false return value. Although queue load/save helpers and flush() exist, failed sends are never enqueued here, so the documented fallback contradicts the actual behavior.

Content

No source excerpt is available for this finding.