Back to skill

Security audit

kb-digest

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it fetches arbitrary URLs and sends source-derived content to external endpoints without enough scoping or warnings.

Install only if you are comfortable sending processed content to your configured LLM provider. Avoid using it on confidential PDFs, private notes, internal URLs, localhost services, or cloud metadata addresses unless the runtime has strong network egress controls. Treat Feishu push as public sharing to that webhook destination, and prefer pinned dependencies plus a trusted HTTPS LLM endpoint.

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

T09 · Insecure Skill Coding Practices

Error
Location
handler.py:37
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis
str: import requests if "arxiv.org/abs/" in url: resp = requests.get(url, timeout=15) from markdownify import markdownify as md return md(resp.text, strip=["script", "style"])[:8000] headers = {"User-Agent": "Mozilla/5.0 (compatible; kb-digest/1.0)"} resp = requests.get(url, headers=headers, timeout=15) resp.raise_for_status() try: from markdownify import markdownify as md content = md(resp.text, strip=["script", "style", "nav", "footer"]) except ImportError: import re content = re.sub(r"\s+", " ", re.sub(r"<[^>]+>", " ", resp.text)) return content[:8000] ``` The affected function is invoked with user-controlled values in both individual and batch processing: ```python result = digest(fetch_url(url), url, output_type, cfg) ``` ```python if args.url: content, source_name = fetch_url(args.url), args.url ``` ### Technical Analysis The Skill makes outbound requests to arbitrary user-supplied URLs without validating the URL scheme, destination hostname, resolved IP address, destination port, or redirect targets. Python Requests follows HTTP redirects by default, so validating only the initial textual URL would not be sufficient. An attacker can direct the runtime to request loopback addresses, private-network services, link-local endpoints, or cloud metadata services. The retrieved response is converted to text and then passed to `digest()`, which sends up to 4,000 characters to the configured LLM endpoint. Consequently, the flaw can provide both an internal-network read primitive and a path for indirectly disclosing retrieved data. The network access needed to retrieve public articles is co ...[truncated 1498 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
handler.py:120
Finding

API Credentials and Source Content Can Be Sent to an Unrestricted LLM Endpoint

Content
View full analysis
dict: api_key = api_key or os.getenv("OPENCLAW_LLM_API_KEY") if not api_key: raise RuntimeError("未检测到 LLM 配置,请通过 OpenClaw 运行或传入 --llm-api-key") base_url = (base_url or os.getenv("OPENCLAW_LLM_BASE_URL", "")).rstrip("/") if not base_url: raise RuntimeError("未检测到 LLM 地址,请通过 OpenClaw 运行或传入 --llm-base-url") model_raw = model or os.getenv("OPENCLAW_LLM_MODEL", "") model = model_raw.split("/")[-1] if not model: raise RuntimeError("未检测到 LLM 模型,请通过 OpenClaw 运行或传入 --llm-model") return {"api_key": api_key, "base_url": base_url, "model": model} ``` ```python import requests as _req resp = _req.post( f"{cfg['base_url']}/chat/completions", headers={"Authorization": f"Bearer {cfg['api_key']}", "Content-Type": "application/json"}, json={ "model": cfg["model"], "messages": [{"role": "user", "content": prompts.get(output_type, prompts["card"])}], "temperature": 0.3, "max_tokens": 1500, }, timeout=60, ) resp.raise_for_status() return resp.json()["choices"][0]["message"]["content"].strip() ``` ### Technical Analysis The LLM base URL is accepted from a command-line argument or environment variable and used without validating its scheme or destination. The code then sends an authorization bearer token and prompt content to that endpoint. If the endpoint uses plaintext HTTP, credentials and document content can be exposed to parties capable of observing or modifying network traffic. If an attacker or unsafe wrapper can influence `OPENCLAW_LLM_BASE_URL` or `--llm-base-url`, the endpoint can be changed to an attacker-controlled server. That server receives both the API key in the ...[truncated 1782 chars]
Remediation
View remediation

other

Note
Location
handler.py:66
Finding

Untrusted Documents Can Inject Instructions into the LLM Prompt

Content
View full analysis
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (24)

Tainted flow: 'url' from os.getenv (line 155, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

This is the same SSRF class issue on the arXiv-specific branch: the code fetches any URL containing arxiv.org/abs/ without validating scheme, redirects, or final destination. An attacker can abuse URL parsing edge cases or redirection behavior to make the agent access unintended endpoints from its network location.

Content

Scanner excerpt · handler.py (reported line 38)May include surrounding context.

python
import requests

    if "arxiv.org/abs/" in url:
        resp = requests.get(url, timeout=15)
        from markdownify import markdownify as md
        return md(resp.text, strip=["script", "style"])[:8000]

Tainted flow: 'url' from os.getenv (line 155, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The skill accepts a user-supplied URL and fetches it directly with requests.get, which enables server-side request forgery (SSRF) against internal services or cloud metadata endpoints if the agent runs in a privileged network environment. In this skill’s context, fetching arbitrary links is a core feature, which increases exposure because the risky behavior is on the main execution path rather than an edge case.

Content

Scanner excerpt · handler.py (reported line 43)May include surrounding context.

python
return md(resp.text, strip=["script", "style"])[:8000]

    headers = {"User-Agent": "Mozilla/5.0 (compatible; kb-digest/1.0)"}
    resp = requests.get(url, headers=headers, timeout=15)
    resp.raise_for_status()
    try:
        from markdownify import markdownify as md

Tainted flow: 'url' from os.getenv (line 155, 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 · handler.py (reported line 160)May include surrounding context.

python
print("⚠️  未设置 FEISHU_WEBHOOK_URL")
        return
    import requests
    requests.post(url, json={"msg_type": "text", "content": {"text": content}})
    print("✅ 已推送到飞书")

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 · handler.py (reported line 15)May include surrounding context.

python
try:
    from dotenv import load_dotenv
    load_dotenv(Path(__file__).parent / ".env")
except ImportError:
    pass

Ssd 1

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Untrusted webpage, PDF, or user text is embedded directly into a single user prompt to the LLM, allowing prompt injection within the source material to influence the model’s behavior. In a digestion skill this is especially dangerous because processing arbitrary external content is the primary feature, so hostile instructions can alter summaries, cause hidden data disclosure in output, or manipulate downstream actions like external sharing.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares environment, file, and network capabilities but does not explicitly scope or document tool permissions. This increases the chance of overbroad execution, unexpected network/file access, and weak reviewability, especially since the skill fetches remote URLs and uses injected API credentials.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation description is very broad ('any link/PDF/text' and generic knowledge-management use cases), which can cause the skill to trigger on common user requests that may include sensitive or proprietary content. In this context, over-triggering is risky because the skill sends content to external services and performs network retrieval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill does not warn users that supplied text, fetched URL contents, and extracted PDF text may be transmitted to an external LLM API. This is dangerous because users may unknowingly send confidential documents, private notes, or internal URLs to third-party services, creating data leakage and compliance risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill omits an explicit warning that it performs outbound network actions when fetching remote URLs and when pushing output to a Feishu webhook. This matters because network access can contact untrusted or internal endpoints and webhook delivery can transmit processed data off-platform without the user appreciating that an external send is occurring.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The prompts ask the model to transform source content into summaries, Q&A, mind maps, and scripts, and those generated outputs can then be forwarded externally via Feishu. That creates a natural-language leakage channel: sensitive input may be paraphrased or quoted into output and exfiltrated even if the user did not intend broad sharing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Multiple prompt templates explicitly require output in Chinese using phrases like '用中文输出' and '中文输出'. This is a natural-language locale policy issue because the skill imposes a specific language on all generated results without offering the user a language selection or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Tainted flow: 'result' from os.getenv (line 145, credential/environment) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · handler.py (reported line 148)May include surrounding context.

python
result = digest(fetch_url(url), url, output_type, cfg)
            print(result)
            out_file = Path(f"digest_{i:02d}.md")
            out_file.write_text(result)
            print(f"  → 已保存: {out_file}")
        except Exception as e:
            print(f"  ❌ 失败: {e}")

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises summarization/digestion, but it also contains a feature to send generated output to an external Feishu webhook. This matters because users may not expect outbound sharing from a knowledge-processing tool, and the mismatch raises the risk of accidental disclosure of sensitive source-derived content.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · handler.py (reported line 160)May include surrounding context.

python
print("⚠️  未设置 FEISHU_WEBHOOK_URL")
        return
    import requests
    requests.post(url, json={"msg_type": "text", "content": {"text": content}})
    print("✅ 已推送到飞书")

Tainted flow: 'content' from requests.get (line 47, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
93% confidence
Finding

Content fetched from arbitrary URLs or provided by the user can be sent to an external Feishu webhook without any data-classification, redaction, or confirmation step. This creates a data exfiltration path, especially if users digest sensitive documents and then use --push, or if prompt-injected source text causes the model to reproduce secrets in the output.

Content

Scanner excerpt · handler.py (reported line 160)May include surrounding context.

python
print("⚠️  未设置 FEISHU_WEBHOOK_URL")
        return
    import requests
    requests.post(url, json={"msg_type": "text", "content": {"text": content}})
    print("✅ 已推送到飞书")

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language description and instructions are presented in Chinese, which may impose a language expectation on users without opt-in or explanation. Under the stated policy, a skill should not force a specific language or locale unless it offers a choice or clearly documents why the locale restriction is necessary.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a lower-bound version only, which allows installation of different future releases over time. This weakens build reproducibility and makes it difficult to determine whether a vulnerable version of requests is being pulled into the skill, especially because the skill fetches remote content from arbitrary links.

Content

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

text
requests>=2.28.0
python-dotenv>=1.0.0
markdownify>=0.11.0
pypdf>=3.0.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
91% confidence
Finding

requests has multiple known advisories, and because no exact version is pinned, it is impossible to verify from this manifest whether the installed release is affected. This matters more here because the skill retrieves arbitrary URLs, so HTTP client flaws could affect confidentiality or request handling in realistic usage.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

Using an unpinned python-dotenv version means deployments may resolve to different package releases, including releases later found vulnerable. This is primarily a supply-chain and reproducibility risk rather than an immediately exploitable flaw in the manifest itself.

Content

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

text
requests>=2.28.0
python-dotenv>=1.0.0
markdownify>=0.11.0
pypdf>=3.0.0

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

python-dotenv has listed advisories, but the manifest does not identify the exact installed version, preventing verification of exposure. The risk is lower than directly exposed network parsers, but still relevant if this package is used in file-writing or environment-loading workflows during setup or runtime.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The markdownify dependency is not pinned, so the environment may install an unpredictable version with different security characteristics. In this skill, content transformation is part of the core function, so parser-related dependency drift can increase the risk of denial-of-service or parsing bugs.

Content

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

text
requests>=2.28.0
python-dotenv>=1.0.0
markdownify>=0.11.0
pypdf>=3.0.0

Unverifiable Dependency: markdownify has 2 known advisory(ies) (CVE-2025-46656 (markdownify allows large headline prefixes such as <h9999999>, which causes memo); CVE-2025-46656 (markdownify allows large headline prefixes such as <h9999999>, which causes memo)), 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

markdownify has known advisories and the unpinned manifest prevents determining whether a safe release is installed. Given this skill converts arbitrary content into structured notes, parser and conversion library issues are more relevant than in a non-content-processing tool.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

pypdf is unpinned, allowing future or environment-specific versions to be installed without review. Because this skill processes user-supplied PDFs, an unexpected vulnerable parser version could materially increase exposure to denial-of-service or malformed-document parsing issues.

Content

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

text
requests>=2.28.0
python-dotenv>=1.0.0
markdownify>=0.11.0
pypdf>=3.0.0

Unverifiable Dependency: pypdf has 16 known advisory(ies) (CVE-2026-84310 (pypdf: Possible long runtimes/large memory usage when retrieving outlines); CVE-2026-48156 (pypdf: Possible long runtimes for zero-only width values in cross-reference stre); CVE-2026-24688 (pypdf has possible Infinite Loop when processing outlines/bookmarks) +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
95% confidence
Finding

pypdf has numerous advisories and the manifest leaves the installed version unverifiable. In this skill context, users may supply arbitrary PDFs, making parser-level issues such as excessive CPU, memory consumption, or hangs more dangerous because they can be triggered through normal feature use.

Content

No source excerpt is available for this finding.