Back to skill

Security audit

Photo Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local photo-processing toolkit, with install-time and metadata-privacy risks users should understand before running it.

Install in a virtual environment, review the setup script before allowing sudo or package-manager changes, prefer pinned dependencies if possible, and use --no-exif when thumbnails may be shared outside your private workflow.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:3
Finding

Unpinned Third-Party Dependencies Permit Unreviewed Supply-Chain Updates

Content
View full analysis
=0.19.0 pillow>=10.0.0 numpy>=1.24.0 pillow-heif>=0.13.0 # optional: HEIC/HEIF support (iPhone/iPad). NOTE: GPLv2 licensed ``` `scripts/setup_deps.sh:122-127`: ```bash # Install Python deps if [ ${#MISSING_PY[@]} -gt 0 ]; then echo "" echo "📦 安装 Python 依赖..." pip3 install "${MISSING_PY[@]}" fi ``` `SKILL.md:85-95`: ```bash # Create venv and install dependencies (recommended) python3 -m venv .venv source .venv/bin/activate pip install -r photo-toolkit/requirements.txt # Or use the skill's setup script (checks + installs) bash photo-toolkit/scripts/setup_deps.sh # Before each session, activate venv source .venv/bin/activate ``` ### Technical Analysis The dependency manifest specifies only minimum versions using `>=` and does not provide cryptographic hashes. Consequently, future installations can resolve to package releases that did not exist when the Skill was reviewed. The setup script also installs missing packages by name without exact versions or hash verification. Python package installation may execute package build and installation logic. If a permitted future release is compromised, an upstream maintainer account is taken over, or the configured package index is malicious, installation can execute attacker-controlled code. The absence of a lock file and hashes also makes builds non-reproducible and prevents reliable verification that users receive the reviewed dependency set. The setup script asks for confirmation before installing missing dependencies, which reduces accidental execution, but it does not address package authenticity or version drift. ### Attack Path 1. An attacker compromises a future release of one of the declared packages, its trans ...[truncated 1748 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad photography toolkit with several distinct features beyond conversion. However, this code chunk only covers one subset: batch thumbnail/JPG generation from supported photo formats. There is no logic for reading shooting dates from EXIF and filtering/grouping by date, no layout/grid generation, no deflicker processing, and no video assembly. Those omissions are material because they are listed as core supported use cases. Additionally, the code has some undeclared behaviors/interfaces—accepting JSON file lists via stdin, writing a JSON report, and symlinking/copying small JPG/HEIC inputs instead of re-encoding—that are not harmful but are capabilities not reflected in the description. Therefore the description does not accurately represent what this supplied code chunk actually does.

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 76)May include surrounding context.

md
**Declaration file:** `requirements.txt`

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 · SKILL.md (reported line 145)May include surrounding context.

md
| `--quality`    | JPEG quality (1-100)               | 85                    |
| `--workers`    | Parallel workers                   | auto (max 8)          |
| `--recursive`  | Search subdirectories              | off                   |
| `--overwrite`  | Overwrite existing files           | off                   |
| `--dry-run`    | Preview only                       | off                   |
| `--no-exif`    | Skip EXIF copy                     | off                   |
| `--report`     | Output processing report JSON path | none                  |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill documents file read/write and shell-based operations but does not declare any explicit tool scope or permission boundaries. In an agent environment, this increases the chance of overbroad execution because the runtime may permit filesystem and shell actions without a least-privilege contract visible to reviewers or enforcement layers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The documentation uses locale-specific examples such as 3月15日 and Chinese terms like 宫格, 四宫格, and 九宫格 alongside English instructions, implying a Chinese locale convention for user interaction. The policy requires avoiding forced language/locale assumptions unless the skill offers a user choice or clearly documents a justified regional constraint, which is not present here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation directs the agent to run a dependency setup shell script, which expands behavior from photo processing into arbitrary shell execution and package installation. If the script is modified, malicious, or simply too permissive, it can execute commands on the host with the agent's privileges and alter the environment beyond the task scope.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/assemble.py (reported line 183)May include surrounding context.

python
]

        print(f"\n🎬 Encoding video...")
        result = subprocess.run(cmd, capture_output=True, text=True)

        if result.returncode != 0:
            print(f"\n❌ FFmpeg failed (exit code {result.returncode}):", file=sys.stderr)

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/convert.py (reported line 148)May include surrounding context.

python
missing = []
    for pkg, pip_name in [("rawpy", "rawpy"), ("PIL", "pillow"), ("numpy", "numpy")]:
        try:
            __import__(pkg)
        except ImportError:
            missing.append(pip_name)
    if missing:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

For small JPG/HEIC inputs, the tool may symlink or copy the original file instead of producing a newly encoded JPEG thumbnail. This can bypass expected transformation and sanitization behavior, preserve original content and metadata, and create outputs that are not actually thumbnails despite the tool's stated purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Preserving EXIF metadata without explicit warning can leak sensitive data such as geolocation, capture time, serial numbers, and camera/device details. In this skill's context, users are likely to create thumbnails for sharing or downstream AI processing, making silent metadata retention more dangerous because users may wrongly assume thumbnails are privacy-reduced derivatives.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The CLI help strings for --report and --from-stdin are written in Chinese, and the success message for saving the report is also Chinese. This imposes a specific language on users without any opt-in or documented locale constraint, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains hard-coded Chinese output in the date-parse error message, and similar fixed-locale messaging appears throughout the CLI help and status output. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This shell script presents its status and prompts in Chinese, beginning with the banner text on L016 and continuing throughout the file. For an all-purpose dependency setup script, forcing a specific language without user opt-in is a natural-language locale policy issue and may make the skill unusable for users who do not read Chinese.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/setup_deps.sh (reported line 84)May include surrounding context.

sh
if [[ "$(uname)" == "Darwin" ]]; then
        echo "  安装命令: brew install ${MISSING_SYS[*]}"
    elif command -v dnf &>/dev/null; then
        echo "  安装命令: sudo dnf install LibRaw-devel"
    elif command -v yum &>/dev/null; then
        echo "  安装命令: sudo yum install LibRaw-devel"
    else

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/setup_deps.sh (reported line 86)May include surrounding context.

sh
if [[ "$(uname)" == "Darwin" ]]; then
        echo "  安装命令: brew install ${MISSING_SYS[*]}"
    elif command -v dnf &>/dev/null; then
        echo "  安装命令: sudo dnf install LibRaw-devel"
    elif command -v yum &>/dev/null; then
        echo "  安装命令: sudo yum install LibRaw-devel"
    else

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/setup_deps.sh (reported line 88)May include surrounding context.

sh
if [[ "$(uname)" == "Darwin" ]]; then
        echo "  安装命令: brew install ${MISSING_SYS[*]}"
    elif command -v dnf &>/dev/null; then
        echo "  安装命令: sudo dnf install LibRaw-devel"
    elif command -v yum &>/dev/null; then
        echo "  安装命令: sudo yum install LibRaw-devel"
    else

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
90% confidence
Finding

At this line the script can automatically invoke a privileged package-manager command after an interactive prompt, which increases risk if the script is run in untrusted contexts or reviewed insufficiently. While the intent appears to be convenience rather than abuse, auto-installing system packages with elevated privileges from a skill helper script expands the blast radius of any future compromise or package/source-chain issue.

Content

Scanner excerpt · scripts/setup_deps.sh (reported line 114)May include surrounding context.

sh
if [[ "$(uname)" == "Darwin" ]]; then
            brew install "${MISSING_SYS[@]}"
        elif command -v dnf &>/dev/null; then
            sudo dnf install -y LibRaw-devel
        elif command -v yum &>/dev/null; then
            sudo yum install -y LibRaw-devel
        else

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
90% confidence
Finding

This line performs an actual sudo-based package installation, meaning the script moves beyond dependency checking into privileged system modification. In the context of an agent skill, bundling root-level changes in setup logic is risky because users may execute it as part of a trusted workflow without closely auditing every command.

Content

Scanner excerpt · scripts/setup_deps.sh (reported line 116)May include surrounding context.

sh
elif command -v dnf &>/dev/null; then
            sudo dnf install -y LibRaw-devel
        elif command -v yum &>/dev/null; then
            sudo yum install -y LibRaw-devel
        else
            sudo apt-get install -y "${MISSING_SYS[@]/%/-dev}"
        fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
91% confidence
Finding

This line executes apt-get with sudo, causing direct privileged package installation from within the skill setup script. The danger is not that apt-get is inherently malicious, but that an agent-distributed script performing root actions can normalize elevated execution and magnify the impact of any script tampering, dependency confusion, or future code changes.

Content

Scanner excerpt · scripts/setup_deps.sh (reported line 118)May include surrounding context.

sh
elif command -v yum &>/dev/null; then
            sudo yum install -y LibRaw-devel
        else
            sudo apt-get install -y "${MISSING_SYS[@]/%/-dev}"
        fi
    fi

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's natural-language comments are entirely in Chinese, including all user-facing configuration guidance. Under the policy, forcing a specific language without opt-in or documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency is specified with a lower-bound range instead of an exact version, which makes builds non-reproducible and can introduce vulnerable or incompatible releases depending on when installation occurs. In a photo-processing skill that parses complex image formats, dependency drift increases exposure because image decoders are historically security-sensitive.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
# photo-toolkit dependencies
# System dependency: libraw (RedHat: dnf install LibRaw-devel / Debian: apt-get install libraw-dev)
rawpy>=0.19.0
pillow>=10.0.0
numpy>=1.24.0
pillow-heif>=0.13.0  # optional: HEIC/HEIF support (iPhone/iPad). NOTE: GPLv2 licensed

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

Pillow is unpinned, so deployments may resolve to different versions, including versions with known image-parsing flaws. Because this toolkit explicitly handles untrusted image files and converts many formats, a vulnerable Pillow release could enable denial of service or, in worst cases, code execution through crafted files.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
# photo-toolkit dependencies
# System dependency: libraw (RedHat: dnf install LibRaw-devel / Debian: apt-get install libraw-dev)
rawpy>=0.19.0
pillow>=10.0.0
numpy>=1.24.0
pillow-heif>=0.13.0  # optional: HEIC/HEIF support (iPhone/iPad). NOTE: GPLv2 licensed

Unverifiable Dependency: pillow has 16 known advisory(ies) (CVE-2016-2533 (Pillow buffer overflow in ImagingPcdDecode); CVE-2023-50447 (Arbitrary Code Execution in Pillow); CVE-2021-27922 (Pillow Uncontrolled Resource Consumption) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The manifest does not pin Pillow, so it is impossible to determine whether installed environments are using versions affected by known advisories. Given that this skill processes attacker-controlled image content, unverifiable Pillow versions materially increase risk because parser vulnerabilities are directly reachable.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

NumPy is not pinned, which weakens reproducibility and can result in installing versions with unresolved security or stability issues. While NumPy is less directly exposed than image decoders, it is still part of the processing pipeline and should be controlled to reduce supply-chain and compatibility risk.

Content

Scanner excerpt · requirements.txt (reported line 5)May include surrounding context.

text
# System dependency: libraw (RedHat: dnf install LibRaw-devel / Debian: apt-get install libraw-dev)
rawpy>=0.19.0
pillow>=10.0.0
numpy>=1.24.0
pillow-heif>=0.13.0  # optional: HEIC/HEIF support (iPhone/iPad). NOTE: GPLv2 licensed

Unverifiable Dependency: numpy has 16 known advisory(ies) (CVE-2014-1859 (Numpy arbitrary file write via symlink attack); CVE-2021-41495 (NumPy NULL Pointer Dereference); CVE-2021-33430 (NumPy Buffer Overflow (Disputed)) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
83% confidence
Finding

Because NumPy is unpinned, the actual installed version cannot be verified against published advisories, leaving uncertainty about exposure. The direct exploitability in this photo toolkit is lower than for image libraries, but unverifiable versions still create unnecessary supply-chain and operational risk.

Content

No source excerpt is available for this finding.