Back to skill

Security audit

context-compressor

Security checks for vulnerabilities and agentic risk

Overview

This skill should be reviewed carefully because it can automatically overwrite and prune project state files without clear confirmation, backups, or rollback.

Install only if you are comfortable with the agent rewriting selected state files. Use it on dedicated, backed-up project state files, avoid broad or sensitive paths, and do not enable background mode unless you have an external backup or review workflow.

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
SKILL.md:16
Finding

Unrestricted and Destructive File Rewriting

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 16–23 and 31–36
Vulnerability Type: Unvalidated file access and destructive file mutation
Risk Level: Medium

Vulnerable Instructions

markdown
### compress
1. Analizează istoricul recent și datele din `<target>`.
2. Extrage informația esențială (Obiectiv, Status, Decizii, Knowledge, Next step).
3. Transformă în format NCM (Neural-Compressed Markdown) ultra-dens:
   - Tag-uri scurte: `[O]`, `[S]`, `[D]`, `[K]`, `[N]`.
   - Format: `[Tag]:valoare` sau `[Tag]:cheie:valoare`.
   - Elimină gramatica și zgomotul conversational.
4. Scrie în `<target>` și execută pruning pentru a menține fișierul la dimensiune minimă.
markdown
### auto (Background Mode)
1. **Monitorizare:** Verifică periodic numărul de tokeni al sesiunii active.
2. **Trigger:** La atingerea unui prag (ex: 50k tokeni), declanșează automat `compress` pe fișierul de stare al proiectului.
3. **Pruning:** Identifică și elimină informațiile redundante sau expirate din fișierele de stare pentru a preveni creșterea dimensiunii fișierelor.

Technical Analysis

The Skill accepts a caller-controlled <target> path, reads the referenced file, and directs the agent to overwrite and prune that same file. It defines no path allowlist, dedicated state directory, extension restriction, canonical-path validation, symlink protection, backup, atomic replacement, or user confirmation.

The background mode further directs the agent to trigger compression and deletion automatically. Because pruning is inherently lossy and the document provides no rollback or integrity mechanism, an incorrect target or an inaccurate assessment of “redundant” information can cause irreversible data loss.

This is an insecure Skill design rather than evidence of intentionally malicious code. The package contains no executable scripts, and the audited material does not demonstrate command execution or priv ...[truncated 1233 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict all reads and writes to a dedicated, explicitly configured state directory.
  2. Canonicalize the target path and reject absolute paths, traversal components, paths outside the approved root, and symbolic links.
  3. Permit only documented state-file extensions and reject unrelated project or system files.
  4. Write compressed output to a new temporary file in the same directory, validate it, and use an atomic rename only after successful completion.
  5. Preserve a versioned backup of the original file and provide a documented rollback procedure.
  6. Require explicit user confirmation before overwriting or pruning an existing file.
  7. Disable unattended destructive pruning by default. In background mode, generate a proposed output or diff and request approval before committing it.
  8. Apply file-size limits and verify that the selected file is a regular file owned or explicitly authorized by the user.
  9. Define deterministic retention rules rather than allowing unconstrained deletion based on subjective redundancy.
  10. Record the target, backup location, affected content categories, and operation result in an audit log without storing sensitive file contents.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The compress procedure performs in-place rewriting of the target file and then prunes content to keep it minimal, which is inherently destructive if the extraction is incomplete or incorrect. Because the skill claims ultra-dense compression and noise removal, the context increases risk: important instructions, provenance, or edge-case decisions may be irreversibly discarded and future agent behavior may be steered by a lossy summary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly describes unattended background monitoring that can automatically trigger compression and pruning of project state files, but it provides no warning, confirmation step, backup strategy, or rollback path. In an agent setting, silent modification of state files can cause data loss, state corruption, or unexpected behavior across later sessions, especially because the rewritten files are intended to influence future agent context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Nearly all natural-language content in the skill is presented only in Romanian, which effectively imposes a language/locale on users. The file does not indicate that Romanian is optional, user-selected, or required for a region-specific compliance reason.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.