Back to skill

Security audit

targeted-tech-research

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent technical research workflow, but it should be reviewed because it can scrape broadly, proceed automatically in quick mode, and silently retain research evidence and metadata.

Install only if you are comfortable with a research skill that performs delegated web/browser scraping and stores local evidence and run metadata. Treat outputs as research drafts, review sources carefully, and avoid feeding confidential PDFs or proprietary materials unless your environment has clear retention and deletion controls.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/compress_content.py:17
Finding

Indirect Prompt Injection Through Untrusted Scraped Content

Content
View full analysis

Vulnerability Details

File Location: scripts/compress_content.py:17-35
Related Locations: SKILL.md:101-103, SKILL.md:115-117, references/prompts.md:5, references/dynamic_sites_whitelist.json:20-25
Vulnerability Type: Untrusted scraped content is passed to an LLM without prompt-injection defenses
Risk Level: Medium

Vulnerable Code and Configuration

scripts/compress_content.py:17-35:

python
def compress_html(html_content: str, max_length: int = 3000) -> str:
    """Clean HTML content, extract plain text, and limit length."""
    # Remove script and style tags along with their contents
    content = re.sub(r'<script[^>]*>.*?</script>', ' ', html_content, flags=re.DOTALL | re.IGNORECASE)
    content = re.sub(r'<style[^>]*>.*?</style>', ' ', content, flags=re.DOTALL | re.IGNORECASE)
    
    # Remove all HTML tags
    content = re.sub(r'<[^>]+>', ' ', content)
    
    # Replace common HTML entities
    entities = {
        '&nbsp;': ' ', '&lt;': '<', '&gt;': '>', '&amp;': '&',
        '&quot;': '"', '&apos;': "'", '&#39;': "'"
    }
    for entity, char in entities.items():
        content = content.replace(entity, char)
    
    # Compress whitespace (multiple spaces, newlines, tabs to single space)
    content = re.sub(r'\s+', ' ', content).strip()

SKILL.md:101-103:

markdown
4. **Content Cleaning**: Before feeding scraped text to LLM, invoke the cleaning script:
   ```bash
   python scripts/compress_content.py --max-length 3000 < raw_text.txt > cleaned_text.txt
text

`SKILL.md:115-117`:

```markdown
1. **Context Preparation**: Use the cleaned text from Step 0 as core context. If user provided private PDFs/patents, also process via `scripts/compress_content.py` and merge.
2. The Skill invokes internal LLM, strictly following the **Step 1 Prompt** template in `references/prompts.md`.

references/prompts.md:5:

markdown
**Input**: Cleaned text from initial search results.

`references/dynamic_s ...[truncated 2990 chars]

Remediation
View remediation

Remediation Suggestions

  1. Establish an explicit trust boundary

    • Place retrieved material inside uniquely delimited blocks.
    • State in the highest-priority prompt that text within those blocks is untrusted evidence, not an instruction source.
    • Prohibit following commands, role changes, tool requests, or output-format changes found inside source material.
  2. Separate instructions from evidence structurally

    • Prefer structured model input fields for trusted task instructions and untrusted source documents.
    • Preserve each source's URL and identity rather than merging multiple documents into an undifferentiated text block.
  3. Detect and quarantine instruction-like content

    • Flag phrases that attempt to override prior instructions, impersonate system messages, request tool use, or direct the model to conceal information.
    • Treat detection as a warning rather than relying on pattern matching as the sole defense.
    • Exclude or separately quote suspicious passages while retaining them in the evidence package for review.
  4. Validate generated output

    • Enforce the required report schema after generation.
    • Verify that factual claims map to supplied source identifiers.
    • Reject unsupported citations, missing attribution labels, and unexpected instructions or tool requests.
    • Require human confirmation before consequential follow-up actions based on untrusted content.
  5. Restrict dynamic-site matching

    • Replace broad patterns such as docs.*.com with exact trusted hosts or a reviewed allowlist.
    • Match normalized hostnames at registrable-domain boundaries.
    • Reject deceptive suffixes, embedded credentials, unexpected redirects, and attacker-controlled subdomains unless explicitly approved.
  6. Apply defense in depth

    • Keep scraper and analysis tools least-privileged.
    • Do not expose credentials or unrestricted execution tools to a model processing untrusted webpage content.
    • Record source ...[truncated 63 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/report_template.md (reported line 4)May include surrounding context.

md
# [Vendor Full Name] - [Solution Full Model] Technical Research Report

## Executive Summary
<!-- ≤100 words core conclusion -->

## Chapter 1: Overall Architecture Anchoring & Information Boundaries

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly describes silently saving raw scraped evidence to an evidence/ directory without notifying the user about retention, scope, or sensitivity handling. This creates a privacy and data governance risk because collected source content, user-supplied materials, or derived execution artifacts may persist on disk longer than expected and become accessible to later processes or operators.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The workflow definition states that Step 0 must generate a Research Feasibility Brief and wait for user confirmation before proceeding, with 'After user confirmation' called out explicitly. However, the example at L241 documents the skill as bypassing that confirmation and proceeding automatically, which contradicts the stated control flow and user-consent gate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The hook changes validation logic based solely on whether Chinese characters are present, which creates inconsistent behavior across languages and can exclude or mis-handle users without clear justification. In a pre-flight gate, this can cause denial of service for legitimate inputs, biased data collection, or easier bypasses depending on language/script choice, making the skill’s security and reliability properties uneven.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The pattern docs.*.com is overly broad and can match a large number of unrelated domains, causing the Playwright scraper to be triggered on many sites outside the intended set. In a security-sensitive agent pipeline, this expands the browsing and content-processing surface unnecessarily, increasing exposure to malicious pages, prompt injection content, and resource abuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The pattern developer.*.com lacks clear domain-boundary constraints and may match many unintended hosts, broadening when dynamic scraping is invoked. Because this file controls which sites receive richer automated interaction, an overbroad rule can increase attack surface by sending the scraper to adversarial or low-trust sites that merely fit the loose naming pattern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

L204 explicitly asserts 'Zero LLM calls' for the Researcher's Narrative generation, but the skill overall is only a documentation file and elsewhere simply invokes python scripts/generate_narrative.py without demonstrating or constraining that script to be non-LLM-based. This is an intent-level contradiction in the documentation because it makes a stronger behavioral guarantee than the defined execution steps substantiate.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

Generating execution_meta.json with input parameters, execution statistics, scraping details, and compliance data introduces a persistence surface for potentially sensitive user queries, provided sources, and operational traces. Even if intended for auditability, the absence of a clear privacy and data-handling warning increases the chance of collecting and retaining metadata users did not expect to be stored.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire template is written in English and prescribes English section headings and field labels, but there is no indication that the user can choose another language or locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code performs a file write when --output is provided, but there is no confirmation prompt or user-facing warning near the write operation indicating that an existing file may be overwritten. Although the CLI argument implies output behavior, the code itself does not disclose overwrite risk or modification impact.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.