Back to skill

Security audit

Context Slim

Security checks for vulnerabilities and agentic risk

Overview

This is a local context-analysis tool, but generated HTML reports can include unescaped input from conversation files, so untrusted inputs need review.

Review generated HTML reports only from trusted or sanitized conversation files until the report escaping bug is fixed. The tool otherwise appears local and purpose-aligned, but it analyzes potentially sensitive prompts and conversations, so run it only on files you intend to expose to this local utility and choose report output paths deliberately.

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
context_report.py:247
Finding

Stored HTML Injection Through Unescaped Conversation Role

Content
View full analysis
0 else 0 bars_html += f"""
{section.source} {section.estimated_tokens:,} tokens ({percentage:.1f}%) ``` ### Technical Analysis When a JSON conversation is analyzed, the value of each message's `role` property is copied into `TokenEstimate.source`. The report generator later inserts this value into an HTML template without applying `_escape_html()`. This creates a stored HTML injection vulnerability. A crafted role such as: ```json [ { "role": "", "content": "Example content" } ] ``` will be emitted as active markup in the generated report. When a user opens the report in a browser, event-handler JavaScript may execute. The report generator correctly escapes compression-suggestion text, but it does not consistently apply that protection to section source labels. This inconsistent output encoding is the root cause. ### Attack Path 1. An attacker creates or modifies a conversation JSON file containing an HTML or JavaScript payload in a message's `role` field. 2. The attac ...[truncated 1443 chars]
Remediation
View remediation
{safe_source} {section.estimated_tokens:,} tokens ({percentage:.1f}%)
""" ``` Additional hardening should include: 1. Use an HTML templating engine with automatic escaping instead of constructing markup through f-strings. 2. Validate conversation roles against an allowlist such as `system`, `user`, `assistant`, and `tool` when arbitrary role names are unnecessary. 3. Escape all dynamic textual fields at the output boundary, even if they are currently numeric or internally generated. 4. Add a restrictive Content Security Policy to generated reports, for example: ```html ``` 5. Add regression tests using payloads containing `
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

A second mismatch exists where the skill claims actionable compression and structured prompt/system-instruction analysis, while the available description suggests limited or conditional support and undeclared local file access. Misrepresentation of capability is dangerous in agent skills because operators may deploy it assuming stronger safeguards, better analysis coverage, or narrower access than actually exists.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A second mismatch exists where the skill claims actionable compression and structured prompt/system-instruction analysis, while the available description suggests limited or conditional support and undeclared local file access. Misrepresentation of capability is dangerous in agent skills because operators may deploy it assuming stronger safeguards, better analysis coverage, or narrower access than actually exists.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises local analysis and includes usage examples that read input files and write HTML reports, but it declares no explicit tool scope or permissions. In an agent ecosystem, undocumented file read/write capability can cause users or orchestrators to grant broader access than intended, increasing the chance of unintended local data exposure or overwriting files.

Content

No source excerpt is available for this finding.

Unbounded Output

Medium
Category
Output Handling
Confidence
60% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · context_slim.py (reported line 285)May include surrounding context.

python
sections: List of token estimates in order
        
        Returns:
            Index of first section that would be truncated, or None if no truncation
        """
        running_total = 0

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. The wording centers English as the calibrated/default language and notes reduced accuracy for non-English use, without presenting a user opt-in or equivalent multilingual support expectation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The description says the estimator is accurate within 10-15% for most English text, which establishes English as the default supported language. Because the skill does not present a user language/locale choice here, this can be read as favoring one language by default rather than explicitly offering multilingual support or opt-in behavior.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · README.md (reported line 329)May include surrounding context.

md
**USE AT YOUR OWN RISK.**

- The author(s) are NOT liable for any damages, losses, or consequences arising from 
  the use or misuse of this software — including but not limited to financial loss, 
  data loss, security breaches, business interruption, or any indirect/consequential damages.
- This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

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

md
**USE AT YOUR OWN RISK.**

- The author(s) are NOT liable for any damages, losses, or consequences arising from 
  the use or misuse of this software — including but not limited to financial loss, 
  data loss, security breaches, business interruption, or any indirect/consequential damages.
- This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The disclaimer states the software does not transmit data externally unless explicitly configured by the user, which conveys a strong local-only posture. However, the same document includes external URLs for Ko-fi, Gumroad, Twitter, GitHub, PromptBase, OpenClaw, and Fiverr, so the documentation is not strictly consistent about external interaction expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.