Back to skill

Security audit

Algernon Texto

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent guided-reading helper, but it can read broad local material paths and silently write session-derived content locally or to Notion without clear user confirmation.

Review this skill before installing. It fits an OpenAlgernon study workflow, but only use it with trusted material databases and manifests, and be aware that configured Notion credentials may cause generated concepts and flashcards to be uploaded. Prefer a version that validates slugs and material paths, previews external exports, and asks before saving local memory.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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

Error
Location
SKILL.md:28
Finding
Unvalidated Slug Enables SQL Injection and Potential Shell Command Injection<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:28-30` **Vulnerability Type**: SQL injection and potential shell command injection **Risk Level**: High ### Vulnerable Code ```bash sqlite3 "$DB" "SELECT id, name, local_path FROM materials WHERE slug = 'SLUG';" ``` If no result, stop: "Material 'SLUG' not found. Run `list` to see installed materials." ``` ### Technical Analysis The material slug originates from a user command, but the skill instructs the agent to insert it directly into an SQL statement. No input validation, escaping, or parameter binding is specified. A slug containing a single quote and additional SQL syntax can terminate the intended string literal and alter the query. Depending on the SQLite CLI configuration and available database permissions, this may permit unauthorized database reads, modifications, or additional SQLite operations. There is also a potential shell command injection path if the agent implements the instruction by replacing `SLUG` directly in the displayed shell command. The SQL argument is enclosed in shell double quotes, which do not prevent command substitution through constructs such as `$(...)` or backticks. Thus, a malicious slug could be evaluated by the shell before `sqlite3` receives the query. ### Attack Path 1. An attacker invokes the skill using a maliciously constructed material slug. 2. The agent substitutes the supplied slug into the documented SQLite command. 3. A single quote in the slug terminates the intended SQL string and introduces attacker-controlled SQL syntax. 4. Alternatively, shell substitution syntax embedded in the slug is evaluated while the double-quoted command argument is constructed. 5. The injected SQL accesses or modifies the study database, or the injected shell expression runs a local command with the privileges of the agent process. ### Impact Assessment Successful SQL injection could expose or modify material records and other information in the SQLite databas ...[truncated 402 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not construct SQL by concatenating or substituting user-controlled values. - Use a SQLite library that supports prepared statements and bind the slug as a parameter. - If the SQLite CLI must be used, pass values through a safe parameter mechanism rather than embedding them in SQL text. - Validate slugs against a strict allowlist before database access. For example, permit only expected identifier characters with a rule such as `^[A-Za-z0-9_-]+$`. - Reject slugs containing quotes, whitespace, shell metacharacters, control characters, or path separators. - Avoid invoking a shell for database operations. Execute the database client with a fixed argument array so shell expansion cannot occur. - Apply least-privilege filesystem permissions to the database and run the skill under an account with only the access required for reading installed materials. - Add tests covering SQL metacharacters, command substitutions, backticks, newlines, and malformed Unicode input. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:34
Finding
Unrestricted Material Paths Permit Arbitrary Local File Read<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:34-38` **Vulnerability Type**: Path traversal and unauthorized local file access **Risk Level**: High ### Vulnerable Code ```text Read `LOCAL_PATH/algernon.yaml` to get: - `content`: list of content files - `sections`: section titles mapped to file names Read all content files and split into blocks of approximately 300 words each. ``` ### Technical Analysis The `LOCAL_PATH` value is obtained from the local database, and the content filenames are loaded from `algernon.yaml`. The skill then instructs the agent to read every referenced content file without requiring path normalization or containment validation. A malicious or corrupted material record can set `local_path` to an absolute path or a directory outside the expected materials root. Likewise, a content entry can contain an absolute path, `../` traversal components, or a symlink that resolves outside the material directory. Because the instructions do not require checking the canonical path after resolving symlinks, a superficially valid path beneath the materials directory can still lead to an unintended local file. ### Attack Path 1. An attacker creates or modifies a material database record or installed material package. 2. The attacker sets `local_path` to an unintended filesystem location, or adds a malicious content path such as `../../sensitive-file` to `algernon.yaml`. 3. Alternatively, the attacker places a symlink in the material directory that points to a file outside the permitted materials root. 4. The agent follows the skill instructions and reads the referenced file without validating its canonical location. 5. The file content is displayed as study material or processed into summaries and generated cards. 6. If optional Notion synchronization is configured, derived sensitive content may also be transmitted to the configured Notion page. ### Impact Assessment An attacker able to influence material metadata may read an ...[truncated 574 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Treat database paths and every filename from `algernon.yaml` as untrusted input. - Define `$MATERIALS` as the only permitted root for installed material data. - Reject absolute paths and entries containing traversal components such as `..`. - Canonicalize the material directory and each requested file before reading it. - Verify that every canonical file path remains beneath the canonical permitted material root. - Resolve and validate symlinks before access, or reject symlinks entirely for material manifests and content files. - Require `local_path` database values to be relative identifiers rather than arbitrary filesystem paths. - Restrict accepted content files to expected extensions and regular files; reject devices, sockets, pipes, and directories. - Apply least-privilege filesystem permissions so the agent cannot read unrelated sensitive files. - Before optional external synchronization, clearly identify the destination and require confirmation when generated content could contain information loaded from local files. - Add negative tests for absolute paths, nested traversal, encoded traversal, symlink escapes, and paths with misleading prefixes. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Vague Triggers

Medium
Confidence
92% confidence
Finding
The trigger phrases include broad natural-language expressions like 'quero ler [material]' and 'modo texto', which can overlap with ordinary conversation and cause unintended skill activation. In context, accidental activation matters because this skill can read local materials, generate derivative content, and potentially write data externally or to local logs.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
The skill advertises a guided reading mode, but it also performs additional actions unrelated to simply presenting content: generating study cards, exporting material-derived content to Notion, and persisting session metadata locally. This violates least surprise and expands the data-handling surface, creating privacy and scope-creep risk if users invoke the skill expecting only transient reading assistance.

Context-Inappropriate Capability

Medium
Confidence
87% confidence
Finding
Automatic card generation is outside the narrow scope of a block-by-block reading skill and introduces additional processing of user interaction history, especially the tracked `/explain` and `/deep-dive` terms. While less severe than external export, it still broadens the skill's function beyond what a user may reasonably expect from 'texto' mode.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
Uploading session-derived content to Notion is a separate exfiltration pathway from the local reading workflow. Even though it is conditioned on environment variables, the skill provides no explicit runtime user confirmation before transmitting generated summaries and concepts to a third-party service, which can expose sensitive reading activity or derived notes.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill description does not warn users that session-derived content may be uploaded to Notion, reducing transparency about external data sharing. Lack of notice undermines informed consent and can lead to unintended disclosure of reading topics, summaries, and generated study artifacts.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The skill silently appends session metadata to a local conversation log without telling the user, which creates an undisclosed persistence mechanism. Although the stored data appears limited to material name and counts, it still records reading activity and could be sensitive in some environments.

Static analysis

No suspicious patterns detected.