Back to skill

Security audit

韭研公社 每日异动简报

Security checks for vulnerabilities and agentic risk

Overview

This market-report skill is mostly coherent, but it ships hardcoded external publishing credentials, a fixed QQ recipient, and scheduled delivery instructions that users should review before installing.

Install only if you intend this skill to browse Jiuyan market pages and produce Chinese market briefs. Before using IMA saving, QQ push, or the daily scheduled task, replace or remove the bundled API key, notebook ID, and QQ recipient, and require explicit confirmation for external delivery.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
SKILL.md:223
Finding

Hardcoded IMA API Credentials Exposed in Skill Documentation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:223-227 and SKILL.md:294-298
Vulnerability Type: Hardcoded reusable API credentials
Risk Level: High

Vulnerable Code

bash
curl -X POST "https://ima.qq.com/openapi/note/v1/import_doc" \
  -H "ima-openapi-clientid: d1cd187e233cb8fff251a16e2cf917e6" \
  -H "ima-openapi-apikey: QXQQ9SbApkGn7FwOhm/M3vu8KqZkAccFzFVupdcPChLUAYclwKOYcXwQgYsYV3Vu/IvGrN9tyA==" \
  -H "Content-Type: application/json" \
  -d '{"content_format": 1, "content": "...", "folder_id": "folder94d1f87c74708a21"}'

The same credential is repeated in the configuration section:

json
{
  "client_id": "d1cd187e233cb8fff251a16e2cf917e6",
  "api_key": "QXQQ9SbApkGn7FwOhm/M3vu8KqZkAccFzFVupdcPChLUAYclwKOYcXwQgYsYV3Vu/IvGrN9tyA==",
  "notebook_id": "folder94d1f87c74708a21"
}

Technical Analysis

The Skill contains a plaintext client identifier and reusable API key. The accompanying command demonstrates exactly how to authenticate to the IMA import endpoint and identifies the target notebook.

Secrets embedded in a distributed Skill package are available to every person or process that can read the package, its source repository, build artifacts, logs, backups, or audit output. File permissions do not provide adequate protection once the Skill is distributed. If the credential remains active, an attacker can replay it independently of the Skill.

External IMA publishing may be part of the optional delivery functionality, but shipping a specific account credential is not necessary. The minimum-privilege design is to obtain a credential from the installing user at runtime and grant it only the permissions required to create the requested note.

Attack Path

  1. An attacker obtains a copy of the Skill package or reads SKILL.md.
  2. The attacker extracts the client ID, API key, notebook ID, API URL, and expected header names.
  3. The attacker constructs an authenticate ...[truncated 1332 chars]
Remediation
View remediation

Remediation Suggestions

  1. Revoke the exposed API key immediately and issue a replacement.
  2. Remove the credential from SKILL.md, all examples, package artifacts, repository history, logs, and release archives.
  3. Obtain credentials at runtime from a protected secret store or environment variables, for example:
    bash
    -H "ima-openapi-clientid: ${IMA_CLIENT_ID}" \
    -H "ima-openapi-apikey: ${IMA_API_KEY}"
    
  4. Fail safely when credentials are absent; never recommend placing credentials directly in scheduled-task instructions.
  5. Require each installer to configure their own notebook identifier rather than shipping an account-specific destination.
  6. Grant the replacement credential only document-import access to the intended notebook, with no broader account permissions.
  7. Add automated secret scanning to source control and release pipelines.
  8. Prevent credentials from appearing in command-line arguments, diagnostic output, exception messages, or generated reports.
  9. Review external-service access logs for unauthorized requests made with the exposed credential.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:304
Finding

Hardcoded QQ Recipient and Cross-Session Delivery Expand the Skill Beyond Least Privilege

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:233 and SKILL.md:304-305
Vulnerability Type: Fixed external recipient and cross-session message delegation
Risk Level: Medium

Vulnerable Code

text
Use `delivery` configuration to let the Gateway push automatically, or use `sessions_send` to delegate delivery to the main session.
json
{
  "openid": "D874BFCD11062CFC1A8E4C6ACA0D2E76",
  "target": "qqbot:c2c:D874BFCD11062CFC1A8E4C6ACA0D2E76"
}

Technical Analysis

The Skill embeds one specific QQ identity and destination instead of obtaining a recipient selected and authorized by the current user. It also recommends delegating delivery to the main session when an isolated session cannot send across channels.

Sending a generated report to QQ is documented functionality, but sending it to a package-controlled, fixed identity is not required to analyze market data. Cross-session delegation also extends the effective authority of the isolated execution context. If the main session has broader messaging permissions, the Skill can use that authority to deliver content outside the channel in which the request originated.

The local Python analyzer does not itself send messages. The risk originates from the operational instructions and fixed configuration in SKILL.md, which an agent may follow when the Skill is invoked.

Attack Path

  1. A user installs the Skill without replacing or reviewing the embedded QQ configuration.
  2. The user triggers a market analysis or an associated scheduled execution.
  3. The Skill generates a report, potentially containing user-selected stocks, custom analysis, or other request-derived content.
  4. The isolated session encounters a cross-channel delivery restriction.
  5. Following SKILL.md, it uses Gateway delivery or asks the main session to send the message.
  6. The report is delivered to the hardcoded qqbot:c2c destination rather than a recipient ...[truncated 1108 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the hardcoded openid and target values from the distributed Skill.
  2. Require the installing user to supply and verify their own destination through protected runtime configuration.
  3. Default to returning the report in the current session; make external delivery explicitly opt-in.
  4. Display the resolved recipient and obtain confirmation before the first outbound delivery.
  5. Maintain an allowlist of destinations authorized by the user and reject package-supplied or unrecognized recipients.
  6. Do not use sessions_send merely to work around isolation restrictions. Permit delegation only when the current request explicitly authorizes the destination and channel.
  7. Give scheduled tasks a narrowly scoped delivery capability tied to one user-approved destination.
  8. Separate report generation from external delivery so the analysis feature can operate without messaging privileges.
  9. Avoid placing request-sensitive or personal content in externally delivered reports unless the user has explicitly approved that disclosure.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill’s stated purpose is scraping and analyzing market-page content, but this section adds unrelated external publishing behavior to IMA and QQ, including a direct API call path. That broadens the skill from local analysis into data exfiltration/persistence and outbound messaging, increasing abuse potential if page content, user context, or generated summaries are transmitted without explicit user approval.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This configuration embeds live-looking credentials and delivery targets for IMA and QQ directly in the skill file. Hardcoded secrets and message targets can enable unauthorized note import, persistent storage, and outbound delivery, and they convert a content-analysis skill into one capable of external actions far beyond user-visible scraping.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README defines very broad trigger phrases such as everyday questions about the market, which can cause the skill to auto-run in situations where the user did not explicitly intend to invoke external browsing or analysis. Because the skill navigates to a third-party financial site and performs automated extraction, accidental invocation can expose browsing context, create unintended outbound requests, and produce investment-related output without clear consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill states it will automatically access an external site and elsewhere notes it may require an already logged-in browser session, but it does not prominently warn the user up front that their browser/session context may be used against a third-party site. This creates a consent and privacy risk: if auto-invoked, the skill could leverage an authenticated session or transmit identifying browser state to the external service without the user's explicit awareness.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger section activates on common conversational phrases such as "今天市场怎么样", "当前热门板块有哪些", and "龙头股是哪些". These are broad finance-related questions and the skill does not provide exclusion conditions or clearer scope boundaries, increasing the chance of accidental activation when a user is merely asking for general commentary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The rules require that both output formats use Chinese numbering and the entire document is framed as fixed Chinese output behavior. There is no user opt-in or alternative language option, which constitutes a language/locale constraint not justified as region-specific compliance or explicitly presented as optional.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill states that raw page data may be written to a local temp directory without warning the user or defining retention limits. Even if the scraped source is nominally public, local persistence creates unnecessary data handling risk and can expose scraped content, session-derived data, or generated artifacts to other processes or users on the host.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
100% confidence
Finding

The documented curl example performs external transmission to an IMA API using embedded credentials, which is a concrete outbound data path. In context, this is especially dangerous because it is paired with hardcoded secrets and a skill whose primary purpose does not require direct API-based publishing, creating a clear exfiltration and unauthorized-persistence risk.

Content

Scanner excerpt · SKILL.md (reported line 223)May include surrounding context.

md
- **解决**: 在定时任务指令中显式包含 IMA 凭证,或使用 `curl` 直接调用 API
   - **示例**:
     ```bash
     curl -X POST "https://ima.qq.com/openapi/note/v1/import_doc" \
       -H "ima-openapi-clientid: d1cd187e233cb8fff251a16e2cf917e6" \
       -H "ima-openapi-apikey: QXQQ9SbApkGn7FwOhm/M3vu8KqZkAccFzFVupdcPChLUAYclwKOYcXwQgYsYV3Vu/IvGrN9tyA==" \
       -H "Content-Type: application/json" \

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire template is written as a required Chinese output format, including headings and disclaimer text, with no indication that users may choose another language or locale. Under the policy criteria, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language docstrings and CLI output entirely in Chinese, including the usage message and generated report text. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation when no choice or justification is provided.

Content

No source excerpt is available for this finding.