Back to skill

Security audit

Q&A Prep Partner

Security checks for vulnerabilities and agentic risk

Overview

This is a simple local presentation Q&A helper with a path-validation weakness, but no hidden network access, persistence, credential use, or destructive behavior was found.

Use this only with abstract text or file paths you intentionally provide, preferably within the project workspace. Avoid passing sensitive local paths as --abstract until the publisher adds path validation and separates inline abstract text from file input.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/main.py:123
Finding

Unrestricted Local File Read Through the Abstract Argument

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 123-127
Vulnerability Type: Unrestricted local file access and path traversal
Risk Level: Medium

Vulnerable Code:

python
if args.abstract:
    try:
        with open(args.abstract) as f:
            topic = f.read()[:100] + "..."
    except:
        topic = args.abstract[:100]

Technical Analysis

The user-controlled --abstract argument is passed directly to open() without path canonicalization, traversal checks, workspace confinement, symbolic-link validation, or file-type validation. An absolute path or a relative path containing traversal components such as ../ can therefore reference any file readable by the process.

This violates least-privilege principles because the program only needs presentation-related input, but it can attempt to read arbitrary local files under the permissions of the executing account. It also conflicts with the path-validation controls identified in SKILL.md.

Only the first 100 characters are read, and the resulting topic value is not subsequently used by generate_questions(). No network transmission, direct output of the file content, or other exfiltration mechanism was identified. Consequently, the current implementation provides an unauthorized file-read primitive but does not independently expose the retrieved data to the caller.

The broad except: clause also suppresses all exceptions, making unauthorized access attempts and operational failures difficult to detect.

Attack Path

  1. An attacker or untrusted caller invokes the program with an absolute path or traversal path, for example:
    bash
    python scripts/main.py --abstract ../../sensitive-file
    
  2. The value is accepted without validation.
  3. open(args.abstract) resolves the supplied path using the working directory and operating-system path rules.
  4. If the process has permission, the program reads ...[truncated 930 chars]
Remediation
View remediation

Remediation Suggestions

  1. Resolve the requested path against an explicitly approved input directory and reject paths outside that directory:
    python
    from pathlib import Path
    
    input_root = Path.cwd().resolve()
    candidate = (input_root / args.abstract).resolve()
    
    if input_root not in candidate.parents:
        parser.error("Abstract file must be inside the approved workspace")
    
  2. Reject absolute paths, traversal components, symbolic links where inappropriate, and non-regular files.
  3. Open files with an explicit encoding and a bounded read:
    python
    if not candidate.is_file() or candidate.is_symlink():
        parser.error("Abstract must be a regular file")
    
    try:
        with candidate.open("r", encoding="utf-8") as abstract_file:
            topic = abstract_file.read(100)
    except (OSError, UnicodeError):
        parser.error("Unable to read the abstract file")
    
  4. Catch specific expected exceptions instead of using a bare except: clause.
  5. Do not treat an inaccessible path as literal abstract text. Use separate arguments for inline text and file input so their security boundaries are unambiguous.
  6. Remove file-reading functionality if abstract content remains unused, or ensure the validated content genuinely contributes to question generation.
  7. Run the Skill under a sandboxed account with access restricted to the designated workspace.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.