Back to skill

Security audit

delete-when-unzip

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent archive-extraction purpose, but it can permanently delete files and contains confirmed unsafe code paths that can execute user-supplied Python or write outside the extraction folder.

Review carefully before installing. Only use this on archives you can afford to lose or have backed up, in a dedicated directory with no unrelated files nearby. Do not process untrusted archives, do not enter anything but plain numeric chunk sizes, and avoid password-protected archives unless the password exposure risk is acceptable.

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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
app.py:190
Finding

Arbitrary Code Execution Through Unsafe eval() of Chunk-Size Input

Content
View full analysis
2: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) if len(sys.argv) > 3: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) password = sys.argv[3] ``` ```python # delete_when_unzip_multi.py:82-88 if len(sys.argv) > 2: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) if len(sys.argv) > 3: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) password = sys.argv[3] ``` ```python # delete_when_unzip_rar.py:159-165 if len(sys.argv) > 2: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) if len(sys.argv) > 3: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) password = sys.argv[3] ``` ```python # delete_when_unzip_rar_multi.py:165-171 if len(sys.argv) > 2: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) if len(sys.argv) > 3: FILE_PATH = sys.argv[1] CHUNK_SIZE = eval(sys.argv[2]) password = sys.argv[3] ``` ### Technical Analysis `eval()` interprets its input as an unrestricted Python expression. The affected values originate directly from a GUI field or command-line argument and are not constrained to numeric syntax. An attacker who can influence the chunk-size value can invoke Python built-ins, import modules, execute operating-system commands, read or modify files, or start additional processes. Converting the eventual result to an integer does not mitigate the issue because expression side effects occu ...[truncated 1111 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
delete_when_unzip.py:50
Finding

Archive Path Traversal Allows Files to Be Written Outside the Extraction Directory

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
delete_when_unzip_multi.py:15
Finding

Unanchored Volume Matching Can Select and Delete Unrelated Neighboring Files

Content
View full analysis
Remediation
View remediation

other

Error
Location
delete_when_unzip_rar_multi.py:87
Finding

Extraction Errors Are Suppressed While Destructive Volume Deletion Continues

Content
View full analysis
>>> Get blocks ERROR <<<<') ``` ```python # delete_when_unzip_rar_multi.py:155-156 with libap.stream_reader(fs, passphrase=password) as e: unzip_buffer(e, os.path.join(dir_path, file_folder)) ``` ### Technical Analysis The broad, bare `except:` around `entry.get_blocks()` catches all exceptions, including decompression failures, checksum failures, truncated-volume errors, I/O errors, and process-level exceptions. It prints a generic message and then continues processing. At the same time, the stream implementation deletes a volume whenever it advances to the next stream and deletes the last listed volume at end-o ...[truncated 1344 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
delete_when_unzip_cli.py:91
Finding

Archive Passwords Are Exposed Through Process Command-Line Arguments

Content
View full analysis
1: FILE_PATH = sys.argv[1] CHUNK_SIZE = 1024*1024*512.0 if len(sys.argv) > 2: FILE_PATH = sys.argv[1] CHUNK_SIZE = int(sys.argv[2]) if len(sys.argv) > 3: FILE_PATH = sys.argv[1] CHUNK_SIZE = int(sys.argv[2]) password = sys.argv[3] CHUNK_SIZE = 10_240_000 main_unzip(FILE_PATH, CHUNK_SIZE, password) ``` ### Technical Analysis The password is accepted as a Python command-line argument and then embedded in the unrar subprocess argument `-p`. Process command lines may be observable through system process-inspection interfaces, administrative monitoring tools, diagnostic logs, crash reports, shell history, or endpoint security products. Using a subprocess argument list prevents shell metacharacter injection, but it does not protect the confidentiality of argument values. ### Attack Path 1. A user invokes the script with an archive password or enters a password through the GUI. 2. The script constructs an unrar command containing `-p`. 3. The subprocess command line remains visible for the duration of extraction. 4. Another process or user with sufficient process-inspection access records the command line. 5. The recovered password can be used to decrypt the archive or other archives where the user reused the same password. When the password is supplied to the Python script on the command line, i ...[truncated 439 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (50)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch explicitly includes use of eval() on a command-line chunk-size argument, which introduces arbitrary code execution far beyond the stated archive-extraction purpose. In the context of a skill that may construct or relay shell commands, documenting and normalizing unsafe argument parsing makes the skill materially dangerous, even if framed as a convenience feature.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This mismatch explicitly includes use of eval() on a command-line chunk-size argument, which introduces arbitrary code execution far beyond the stated archive-extraction purpose. In the context of a skill that may construct or relay shell commands, documenting and normalizing unsafe argument parsing makes the skill materially dangerous, even if framed as a convenience feature.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This mismatch explicitly includes use of eval() on a command-line chunk-size argument, which introduces arbitrary code execution far beyond the stated archive-extraction purpose. In the context of a skill that may construct or relay shell commands, documenting and normalizing unsafe argument parsing makes the skill materially dangerous, even if framed as a convenience feature.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cli.py` | segmented **RAR** (`.part1.rar .part01.rar .r01 .rar`, `.rar.001`) | `unrar.exe` subprocess, output monitored | deletes a volume as soon as unrar prin

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cli.py` | segmented **RAR** (`.part1.rar .part01.rar .r01 .rar`, `.rar.001`) | `unrar.exe` subprocess, output monitored | deletes a volume as soon as unrar prin

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cli.py` | segmented **RAR** (`.part1.rar .part01.rar .r01 .rar`, `.rar.001`) | `unrar.exe` subprocess, output monitored | deletes a volume as soon as unrar prin

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cli.py` | segmented **RAR** (`.part1.rar .part01.rar .r01 .rar`, `.rar.001`) | `unrar.exe` subprocess, output monitored | deletes a volume as soon as unrar prin

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Using eval() to parse chunk-size input creates arbitrary code execution from what should be a simple numeric parameter. In a skill that may be used through an agent or shell wrapper, an attacker could supply a malicious expression and execute commands on the host under the same privileges as the extraction process.

Content

No source excerpt is available for this finding.

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

The GUI reads the chunk-size value from a user-editable Spinbox and passes it to eval(), which allows arbitrary Python expression execution. A local user can enter payloads such as imports or system calls instead of a numeric size, leading to code execution with the privileges of the application.

Content

Scanner excerpt · app.py (reported line 193)May include surrounding context.

python
file_path = file_entry.get()
    number = number_entry.get()
    number = eval(number)*1024*1024
    # number = str(number)
    mode = var_mode.get()

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file implements classic ZIP weak decryption/key-update logic that is unrelated to the declared skill purpose of low-space streaming extraction and deletion of processed archive parts. Adding decryption functionality expands the skill's capability into handling protected content, increases misuse potential, and is especially suspicious because it is hidden in a generated Cython extension rather than being clearly documented as part of the feature set.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file implements ZIP password-based decryption logic even though the skill is described as a low-disk-space unzip-and-delete utility. That capability materially expands the trust boundary: users may run code that can process protected archives without that behavior being disclosed, which is dangerous in an agent skill because hidden capability mismatch can enable unauthorized data access or repurposing beyond the declared function.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest says the skill covers segmented archives such as .z01/.zip.001/.part1.rar/.r01 and RAR archives, but the implementation passes a single file stream into stream_unzip, which is ZIP-focused, and contains a TODO noting segmented ZIP support is unfinished. There is no code to discover, join, or iterate over multiple volume parts, and no RAR handling logic at all.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script unconditionally deletes the original archive after extraction with os.remove(file), without verifying complete success of all extracted files or obtaining explicit user confirmation. Given the skill's destructive 'delete when unzip' purpose, this behavior is somewhat expected, but it is still dangerous because any partial extraction, decoding issue, or path-handling error can permanently destroy the only copy of the archive.

Content

No source excerpt is available for this finding.

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

The script evaluates user-controlled command-line input with eval(), which allows arbitrary Python code execution before extraction begins. In a skill specifically meant to be run on local files, this becomes highly dangerous because a crafted chunk-size argument can execute commands with the user's privileges, leading to full local compromise or destructive file operations.

Content

Scanner excerpt · delete_when_unzip.py (reported line 74)May include surrounding context.

python
CHUNK_SIZE = 1024*1024*512.0  # 512MB per chunk
    if len(sys.argv) > 2:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])
    if len(sys.argv) > 3:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

This is a second reachable eval() on the same user-controlled CLI parameter path, again permitting arbitrary Python execution. Because the tool already performs destructive filesystem actions, combining code execution with archive deletion amplifies the risk of data loss and system compromise.

Content

Scanner excerpt · delete_when_unzip.py (reported line 77)May include surrounding context.

python
CHUNK_SIZE = eval(sys.argv[2])
    if len(sys.argv) > 3:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])
        password = sys.argv[3]
    main_unzip(FILE_PATH,CHUNK_SIZE,password)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The extracted path comes from the archive entry name and is joined directly to the destination directory without canonicalization or boundary checks. A malicious archive can use absolute paths or '..' traversal sequences to write files outside the intended extraction folder, potentially overwriting sensitive files.

Content

No source excerpt is available for this finding.

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

The script evaluates the user-supplied chunk size with eval(), which allows arbitrary Python code execution when the program is invoked. An attacker who can influence the command-line argument can run code unrelated to archive extraction, making this a direct code execution sink.

Content

Scanner excerpt · delete_when_unzip_multi.py (reported line 84)May include surrounding context.

python
CHUNK_SIZE = 1024*1024*512.0  # 512MB per chunk
    if len(sys.argv) > 2:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])
    if len(sys.argv) > 3:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The command-line chunk size is treated as Python code rather than data, so a crafted argument can execute arbitrary commands with the privileges of the user running the script. In a utility skill that users may run directly from instructions, this is especially dangerous because exploit payloads can be disguised as a 'size' parameter.

Content

No source excerpt is available for this finding.

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

This is the same unsafe eval() pattern on the chunk-size argument in another code path, again permitting arbitrary Python execution from attacker-controlled input. Because the skill is intended for local use on user-specified archives, this increases the chance that unsafe copy-pasted commands could trigger code execution.

Content

Scanner excerpt · delete_when_unzip_multi.py (reported line 87)May include surrounding context.

python
CHUNK_SIZE = eval(sys.argv[2])
    if len(sys.argv) > 3:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])
        password = sys.argv[3]
    main_unzip(FILE_PATH,CHUNK_SIZE,password)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script extracts archive contents and then deletes or truncates the source archive as part of normal operation without an interactive warning, confirmation, or safety guard in the code path. In this skill context, destructive behavior is central to the tool, which makes the lack of explicit safeguards more dangerous because accidental invocation, wrong path selection, or partial extraction failures can irreversibly destroy user data.

Content

No source excerpt is available for this finding.

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

The script evaluates user-controlled command-line input with eval(), which allows arbitrary Python code execution if an attacker can influence the second argument. In this skill context, the script is intended to be run locally on user-supplied archives and parameters, so passing a malicious chunk-size argument would directly execute code on the host.

Content

Scanner excerpt · delete_when_unzip_rar.py (reported line 161)May include surrounding context.

python
CHUNK_SIZE = 1024*1024*512.0  # 512MB per chunk
    if len(sys.argv) > 2:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])
    if len(sys.argv) > 3:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

This is a second reachable eval() on the same user-controlled CLI parameter path, again enabling arbitrary code execution. Even though CHUNK_SIZE is later overwritten, the dangerous behavior already occurs during argument parsing, so an attacker can execute code before extraction begins.

Content

Scanner excerpt · delete_when_unzip_rar.py (reported line 164)May include surrounding context.

python
CHUNK_SIZE = eval(sys.argv[2])
    if len(sys.argv) > 3:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])
        password = sys.argv[3]
    CHUNK_SIZE = 10_240_000
    main_unzip(FILE_PATH,CHUNK_SIZE,password)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script deletes archive segments during processing with no explicit confirmation, dry-run mode, or prominent warning at the point of execution. Because the source archive is intentionally destroyed, any mistake in path selection, archive ordering, or extraction failure can cause irreversible data loss.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code appends deletion targets using os.path.join(file_path, file) even though file_path is the archive file, not the containing directory. This can cause deletion or open operations to target incorrect paths, leading to failed extraction, unintended file removal attempts, or unsafe behavior when handling similarly named files.

Content

No source excerpt is available for this finding.

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

The script evaluates sys.argv[2] with Python eval(), allowing arbitrary code execution if an attacker can influence the chunk-size argument. In a CLI utility that also deletes archive parts and writes extracted files, successful exploitation can lead to full system compromise or destructive side effects beyond the intended extraction behavior.

Content

Scanner excerpt · delete_when_unzip_rar_multi.py (reported line 167)May include surrounding context.

python
CHUNK_SIZE = 1024*1024*512.0  # 512MB per chunk
    if len(sys.argv) > 2:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])
    if len(sys.argv) > 3:
        FILE_PATH = sys.argv[1]
        CHUNK_SIZE = eval(sys.argv[2])

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
app.py:193

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
delete_when_unzip_multi.py:84

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
delete_when_unzip_rar_multi.py:167

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
delete_when_unzip_rar.py:161

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
delete_when_unzip.py:74