Back to skill

Security audit

CorelDRAW Exporter

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent CorelDRAW export helper with expected local file writes, but users should keep exports in a fresh folder and avoid unsafe filenames or overwrites.

Install only if you need CorelDRAW automation. Use a fresh output directory, keep --item filenames as simple basenames such as asset_01.png, review manifest and JSON paths before running, and do not use --overwrite unless you intentionally want to replace existing export files.

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/coreldraw_export.py:154
Finding

Unrestricted Export Filename Allows Output Directory Traversal

Content
View full analysis

Vulnerability Details

File Location: scripts/coreldraw_export.py, lines 154–161 and 217–220
Vulnerability Type: Path traversal and arbitrary export-file placement
Risk Level: Medium

Vulnerable Code

python
def parse_item(item: str) -> tuple[str, list[int]]:
    if ":" not in item:
        raise ValueError("Item must be filename:indexes, e.g. tree.png:4 or cluster.png:7-20")
    filename, spec = item.split(":", 1)
    filename = filename.strip()
    if not filename:
        raise ValueError(f"Missing filename in --item {item!r}")
    return filename, parse_index_spec(spec)
python
for filename, indexes in items:
    out_path = out_dir / filename
    if out_path.exists() and not args.overwrite:
        raise FileExistsError(f"Refusing to overwrite existing file: {out_path}")
    create_selection(layer, indexes)

Technical Analysis

The filename supplied through --item is accepted without validating whether it is an absolute path or contains parent-directory components such as ... The value is subsequently joined directly to the requested output directory:

python
out_path = out_dir / filename

This operation does not guarantee that the resulting path remains inside out_dir. A relative filename containing traversal components can escape the directory. Depending on Windows path semantics and the supplied value, an absolute path may also supersede the intended base directory.

The resulting path is passed to CorelDRAW's export APIs. Consequently, this is a file-write path traversal rather than merely a misleading manifest entry. The existing-file safeguard does not prevent directory escape, and the --overwrite option permits replacement of an existing accessible file.

Attack Path

  1. An attacker controls or influences an --item argument used by the operator or another automation layer.
  2. The attacker supplies a filename containing traversal components, for example:
    text
    --item "..\outside\asset.
    

...[truncated 1109 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require --item filenames to be plain basenames unless nested output directories are an intentional feature:

    python
    candidate = Path(filename)
    if candidate.is_absolute() or candidate.name != filename:
        raise ValueError("Export filename must be a plain filename")
    
  2. If nested directories must be supported, reject parent traversal and verify containment after canonicalization:

    python
    base = out_dir.resolve()
    candidate = (base / filename).resolve()
    
    try:
        candidate.relative_to(base)
    except ValueError:
        raise ValueError("Export path escapes the output directory")
    
  3. Reject empty names, . and .. path components, absolute paths, drive-qualified paths, and Windows UNC paths before invoking COM export operations.

  4. Perform the overwrite check only after canonicalization and containment validation.

  5. Consider validating that the filename extension agrees with --format to avoid misleading output names.

  6. Add automated tests covering:

    • ../ and Windows-style ..\ traversal.
    • Absolute and drive-qualified paths.
    • UNC paths.
    • Nested paths, if supported.
    • Existing destinations with and without --overwrite.
    • Valid filenames that remain inside the output directory.
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (3)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/coreldraw_export.py (reported line 240)May include surrounding context.

python
for filename, indexes in items:
            out_path = out_dir / filename
            if out_path.exists() and not args.overwrite:
                raise FileExistsError(f"Refusing to overwrite existing file: {out_path}")
            create_selection(layer, indexes)
            fmt = args.format.lower()
            if fmt in {"png", "jpg", "jpeg"}:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill instructs the agent to create output directories, write exported files, manifests, metadata JSON, previews, and contact sheets, but it declares no explicit tool scope such as allowed-tools or permissions. That mismatch can allow broader-than-expected file write behavior at runtime, increasing the chance of unintended overwrites or writes outside the intended export location if the agent or surrounding platform does not enforce stricter boundaries.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/coreldraw_export.py (reported line 62)May include surrounding context.

python
def const_value(name: str, fallback: int | None = None) -> int:
    try:
        return int(getattr(constants(), name))
    except Exception:
        if fallback is None:
            raise