Back to skill

Security audit

Foreshadowing Tracker

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches a foreshadowing-tracker purpose, but it ships an undocumented LLM helper that can upload the full selected manuscript to DashScope without clear user consent.

Review before installing. The documented local tracker is reasonable for Chinese manuscript foreshadowing analysis, but avoid running the LLM helper on confidential drafts unless you are comfortable sending the full selected file to DashScope. Prefer the local script, pin dependencies in a controlled environment, and treat the generated JSON record/report paths as files that may be overwritten or created.

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

Warning
Location
scripts/track_foreshadowing_llm.py:61
Finding

Undisclosed transmission of complete manuscript content to a third-party LLM service

Content
View full analysis

Vulnerability Details

File Location: scripts/track_foreshadowing_llm.py, lines 61–99
Vulnerability Type: Sensitive-data transmission without adequate disclosure, consent, or data minimization
Risk Level: Medium

Evidence

python
url = "https://coding.dashscope.aliyuncs.com/v1/chat/completions"

payload = {
    "model": model,
    "messages": [
        {
            "role": "system",
            "content": "You are a fiction analysis expert. You must return standard JSON.",
        },
        {"role": "user", "content": prompt},
    ],
    "temperature": 0.3,
}

try:
    response = requests.post(url, headers=headers, json=payload, timeout=60)
    response.raise_for_status()
    result = response.json()
    content = result["choices"][0]["message"]["content"]
    return json.loads(content)

The prompt inserted into the user message includes the complete contents of the file selected through --input.

Technical Analysis

The script reads the entire input file and embeds it, without filtering or truncation, in a request sent to the fixed DashScope endpoint. Although HTTPS protects the content in transit, the remote service receives the complete manuscript and associated chapter information.

This network behavior is not documented in SKILL.md, which describes a local keyword-based tracker and lists only the local track_foreshadowing.py CLI. The documentation does not identify the LLM script, the DashScope recipient, the categories of data transmitted, or applicable third-party retention and processing considerations. There is also no confirmation prompt, explicit opt-in flag, redaction facility, size limit, or local-only mode in the LLM script.

Transmission of text is necessary for the selected remote-LLM implementation, but sending the entire file exceeds minimum data access where analysis could be performed in chunks, on selected passages, or through the documented l ...[truncated 1650 chars]

Remediation
View remediation

Remediation Suggestions

  1. Document the LLM script and clearly state that the complete selected text is sent to DashScope, including the destination hostname and relevant privacy and retention considerations.
  2. Require explicit consent before transmission, such as a --allow-remote-processing flag. In interactive use, display the destination, file path, and byte count before sending.
  3. Preserve the documented local analyzer as the default. Remote processing should be an explicit alternative rather than an implicit extension of local functionality.
  4. Minimize transmitted data by supporting selected passages, bounded chunks, or pre-extracted candidate sentences instead of uploading the complete manuscript.
  5. Add configurable content redaction for personal information, secrets, credentials, and other user-defined sensitive patterns.
  6. Enforce an input-size limit and report exactly how much data will be transmitted.
  7. Allow an administrator-approved endpoint configuration while validating an HTTPS allowlist. Do not permit arbitrary endpoints without an explicit unsafe override.
  8. Document provider data-processing terms and advise users not to submit confidential material unless their deployment and provider agreement permit it.
  9. Avoid printing raw model responses on parsing failures where model output may reproduce sensitive manuscript content.

T08 · Insecure Dependencies

Note
Location
scripts/requirements.txt:1
Finding

Unpinned and unverifiable third-party dependencies

Content
View full analysis

Vulnerability Details

File Location: scripts/requirements.txt, lines 1–2
Vulnerability Type: Unpinned dependency versions and missing integrity constraints
Risk Level: Low

Evidence

text
rich
PyYAML

Technical Analysis

The dependency file specifies package names without exact versions or hashes. Consequently, separate installations can resolve to different releases, including newly published versions that were not reviewed with the Skill. This weakens build reproducibility and increases exposure to upstream package compromise, malicious account takeover, or an unexpectedly incompatible release.

The package names correspond to established projects, and no typosquatting or custom untrusted package index was observed. Therefore, this is a supply-chain hardening weakness rather than evidence that the listed packages are currently malicious.

The LLM script additionally imports requests, but requests is absent from this dependency file. That omission principally creates an availability and environment-consistency problem: the script only works if requests is already installed through another mechanism.

Attack Path

  1. A user or automated environment runs pip install -r scripts/requirements.txt.
  2. The package resolver selects whatever compatible releases are current at installation time.
  3. If an upstream release is compromised or introduces a security regression, that release can be installed without any repository change or integrity mismatch.
  4. Dependency installation executes package build and installation behavior with the privileges of the invoking user or build environment.
  5. A compromised dependency could therefore access files, environment variables, network resources, and credentials available to that installation process.

This is a conditional supply-chain path. The audited files do not establish that a currently resolved release is compromised.

Impact Assessmen

...[truncated 583 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to a reviewed version, including the requests dependency used by the LLM script.
  2. Generate and commit a lock file containing hashes for all direct and transitive dependencies.
  3. Install with hash verification, for example through a requirements file generated for pip install --require-hashes.
  4. Use a controlled package index or approved internal mirror in CI and production environments.
  5. Add automated dependency vulnerability and provenance scanning.
  6. Establish a review process for lock-file updates rather than resolving unrestricted latest versions during deployment.
  7. Install dependencies in an isolated virtual environment as an unprivileged user.
  8. Remove PyYAML if it is not actually required; no import of it was observed in the audited scripts.
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Tainted flow: 'headers' from os.environ.get (line 74, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/track_foreshadowing_llm.py (reported line 92)May include surrounding context.

python
}

    try:
        response = requests.post(url, headers=headers, json=payload, timeout=60)
        response.raise_for_status()
        result = response.json()
        content = result["choices"][0]["message"]["content"]

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared behavior is a local foreshadowing tracker, but the finding indicates additional undeclared network access and file I/O, while key advertised features are not actually implemented. This mismatch is dangerous because users may provide manuscript content assuming only local analysis, while the skill could transmit sensitive creative material to an external API or modify local files beyond what the description suggests.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill documentation exposes capabilities consistent with local file read/write and possible network use, but it declares no tool scope or permission boundaries. In an agent setting, undocumented capabilities increase the risk of over-privileged execution, unexpected data access, and unsafe composition with other skills because operators cannot constrain what resources the skill is allowed to touch.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s user-facing instructions and descriptions are predominantly in Chinese, but there is no statement that the skill is Chinese-only, region-specific, or that users may choose another language. This can violate language/locale policy because it effectively forces a specific language without explicit user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The docstring and subsequent CLI messages and prompt strings are written exclusively in Chinese, effectively forcing a specific language experience. Under the policy, locale constraints should either be optional for the user or explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a tracker that supports adding newly identified foreshadowing, reminding about unrecovered foreshadowing, and marking recovered items. In contrast, this script only reads a text file, sends it to an LLM for identification, and writes the extracted list to JSON; it contains no logic for persistent tracking, reminder generation, or recovery-state updates.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script transmits the full input text to a third-party LLM service, but the skill description suggests a local tracking-oriented tool and does not clearly disclose external data transfer. This can expose sensitive unpublished manuscript content, proprietary text, or personal data to an external processor without informed user consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code depends on outbound network access to a third-party LLM service, which expands the trust boundary beyond a simple tracking utility. In context, this is more dangerous because users may reasonably expect manuscript analysis utilities to stay local, while this implementation sends content externally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script sends the entire user-provided text to an external LLM API without an explicit user-facing warning at runtime. If the input contains confidential drafts, customer data, or regulated content, users may unknowingly disclose sensitive information to a third party.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This code performs external transmission of full input text to a third-party API. In this skill context, that is security-relevant because the tool is presented as a foreshadowing tracker rather than clearly as a cloud-connected manuscript uploader, increasing the chance of unexpected disclosure of sensitive text.

Content

Scanner excerpt · scripts/track_foreshadowing_llm.py (reported line 92)May include surrounding context.

python
}

    try:
        response = requests.post(url, headers=headers, json=payload, timeout=60)
        response.raise_for_status()
        result = response.json()
        content = result["choices"][0]["message"]["content"]

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency rich is unpinned, which makes builds non-reproducible and allows future installs to pull in unexpected versions with breaking changes or newly introduced malicious/compromised releases. While rich is not inherently high risk here, leaving versions unconstrained weakens supply-chain integrity and hampers vulnerability management.

Content

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

text
rich
PyYAML

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
99% confidence
Finding

The dependency PyYAML is unpinned, so installations may resolve to different versions over time, including versions with known security issues or incompatible behavior. Because PyYAML has a history of unsafe deserialization and input-validation advisories, the lack of version pinning is more dangerous than for a purely cosmetic library.

Content

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

text
rich
PyYAML

Unverifiable Dependency: PyYAML has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
95% confidence
Finding

PyYAML has multiple historical security advisories, and because no version is pinned, there is no assurance that deployments will avoid affected releases. If this skill or supporting scripts ever parse YAML from untrusted or semi-trusted sources, an outdated PyYAML version could expose the environment to unsafe deserialization or related parsing flaws.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The module docstring and user-facing descriptions are written entirely in Chinese, and the implementation's detection patterns are also exclusively Chinese-language expressions. There is no indication that the skill is region-specific or that users may choose another language or locale, which makes this a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The argparse description, argument help strings, warnings, errors, and success messages are presented only in Chinese. Because the skill does not offer a language choice or explicitly document a justified Chinese-only scope, this may violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This function performs a file write operation to a user-specified path, but there is no confirmation, logging about overwrite behavior, or explanatory warning near the write. For safety-sensitive auditing, file modifications should have some visible disclosure unless clearly documented elsewhere.

Content

No source excerpt is available for this finding.