Back to skill

Security audit

Photo Screener

Security checks for vulnerabilities and agentic risk

Overview

This photo-screening skill is mostly purpose-aligned, but it needs review because it downloads and loads external ML model files, including one automatic GitHub download, without integrity verification.

Install only in a virtual environment, review the setup script first, avoid --auto-download unless you approve the model sources, and consider manually downloading verified model artifacts. Do not run it with elevated privileges or on sensitive photo directories unless you accept the local processing and dependency supply-chain risks.

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

T08 · Insecure Dependencies

Warning
Location
requirements.txt:3
Finding

Unpinned Python dependencies permit installation of unreviewed package versions

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:3-7; scripts/setup_deps.sh:55-59
Vulnerability Type: Supply-chain exposure through open-ended dependency constraints
Risk Level: Medium

Vulnerable Code

requirements.txt:3-7:

text
torch>=2.0.0
open-clip-torch>=2.24.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:55-59:

bash
if [[ "$answer" =~ ^[Yy]$ ]]; then
    echo ""
    echo "📦 安装 Python 依赖..."
    pip3 install "${MISSING_PY[@]}"
    echo -e "${GREEN}✓ Python 依赖安装完成${NC}"

Technical Analysis

The dependency declaration uses open-ended lower bounds rather than exact, reviewed versions. A future release satisfying these constraints can therefore be installed without any corresponding review of this project.

The setup script further installs package names directly from the active package index. It does not use a lock file, require package hashes, constrain the package index, or install from the declared requirements file. Python packages can execute code during installation and whenever they are imported. Consequently, compromise of an accepted upstream release or the configured package index would affect the code executed under the invoking user's account.

This is a supply-chain hardening issue; the reviewed project does not itself contain evidence that any currently named dependency is malicious.

Attack Path

  1. An attacker compromises an upstream package release, package maintainer account, or package-index delivery path.
  2. The compromised version retains a version number accepted by the open-ended constraint, or is selected by the direct pip3 install command.
  3. A user follows the documented setup process and approves installation.
  4. pip3 downloads and installs the unreviewed package.
  5. Malicious package code executes during in ...[truncated 600 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every direct and transitive dependency to an exact, reviewed version using a generated lock file.
  2. Record and enforce cryptographic hashes, for example with pip install --require-hashes -r requirements.lock.
  3. Change setup_deps.sh to install exclusively from the locked requirements file rather than constructing a package-name list.
  4. Use a dedicated virtual environment and avoid global or privileged installation.
  5. Configure an approved package index explicitly and apply dependency-update review and automated vulnerability scanning.
  6. Separate optional HEIC support into an optional, independently pinned dependency group.
  7. Regenerate pins and hashes only through a controlled dependency-update process.

T08 · Insecure Dependencies

Warning
Location
scripts/screen.py:259
Finding

Downloaded model artifacts are accepted without cryptographic integrity verification

Content
View full analysis

Vulnerability Details

File Location: scripts/screen.py:259-293; scripts/setup_deps.sh:116-122; scripts/setup_deps.sh:140-161
Vulnerability Type: Unverified third-party model download
Risk Level: Medium

Vulnerable Code

scripts/screen.py:259-293:

python
def _get_aesthetic_model_path():
    """Get the cached path for the aesthetic model weights, downloading if needed."""
    cache_dir = Path.home() / ".cache" / "photo-filter"
    cache_dir.mkdir(parents=True, exist_ok=True)
    model_path = cache_dir / "aesthetic_sac_logos_ava1_l14_linearMSE.pth"

    if model_path.exists():
        return model_path

    print(f"📥 Downloading aesthetic model (~3MB)...")
    print(f"   建议预下载: bash {_SKILL_DIR}/scripts/setup_deps.sh")
    try:
        urllib.request.urlretrieve(_AESTHETIC_MODEL_URL, str(model_path))
        print(f"   ✓ Saved to: {model_path}")
    except Exception as e:
        print(f"❌ Failed to download aesthetic model: {e}", file=sys.stderr)
        print("   You can manually download from:", file=sys.stderr)
        print(f"   {_AESTHETIC_MODEL_URL}", file=sys.stderr)
        print(f"\n   Or run: bash {_SKILL_DIR}/scripts/setup_deps.sh", file=sys.stderr)
        sys.exit(1)

    return model_path


def load_aesthetic_model(device):
    """Load the LAION aesthetic predictor (always 768-dim input)."""
    model_path = _get_aesthetic_model_path()
    state_dict = torch.load(str(model_path), map_location=device, weights_only=True)

scripts/setup_deps.sh:116-122:

bash
HF_ENDPOINT=https://hf-mirror.com python3 -c "
import open_clip
print('正在下载 MobileCLIP2-S0 模型...')
model, _, preprocess = open_clip.create_model_and_transforms(
    'MobileCLIP2-S0', pretrained='dfndr2b'
)
print('✅ 模型下载完成!')
"

scripts/setup_deps.sh:140-161:

bash
TEMP_PATH="${AESTHETIC_PATH}.downloading"

# Support resume via curl -C (auto-resume)
if command
...[truncated 2884 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every model to an immutable repository revision or release artifact.
  2. Publish trusted SHA-256 digests with the Skill and verify each downloaded file before it is moved into the cache or loaded.
  3. Delete temporary artifacts and fail closed when size, checksum, signature, or expected format validation fails.
  4. Verify cached files on every use rather than treating file existence as proof of authenticity.
  5. Prefer the authenticated official model host by default. If a mirror is supported, require it to serve the exact artifact whose trusted digest is embedded in the Skill.
  6. Retain weights_only=True and use a safe, non-executable tensor format such as safetensors where upstream support is available.
  7. Download to a securely created temporary file in the destination directory, validate it, set restrictive permissions, and atomically rename it into place.
  8. Document the exact model revision, expected size, digest, source, and verification procedure.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a photo-screening tool, but its documented operational path includes package installation and network retrieval of an additional undeclared model component. This mismatch is dangerous in agent environments because it expands execution from local inference into setup-time code execution and external fetching without clear user awareness.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a photo-screening tool, but its documented operational path includes package installation and network retrieval of an additional undeclared model component. This mismatch is dangerous in agent environments because it expands execution from local inference into setup-time code execution and external fetching without clear user awareness.

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

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

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises and instructs use of shell execution, package installation, file access, environment-variable use, and network downloads, but does not declare any explicit tool scope or permissions boundary. In an agent setting, this weakens policy enforcement and informed consent because the skill can trigger higher-risk capabilities than its metadata signals.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The activation text says the skill triggers when a user mentions filtering photos, screening images, aesthetic scoring, removing duplicates, classifying scenes, or preparing photos for LLM. Several of these phrases are broad and there are no negative examples or tighter scope constraints beyond a photo-count threshold, which could cause unintended invocation during ordinary image-related discussions.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

The documentation explicitly suggests adding --auto-download to skip confirmation, normalizing autonomous downloading in contexts where the user may not expect network activity. For an agent skill, encouraging confirmation bypass weakens consent and oversight around external resource acquisition.

Content

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

md
- Interactive mode: prompts user for confirmation
    - Non-interactive mode: exits with manual download instructions
    - Uses HuggingFace mirror (hf-mirror.com) for China acceleration
    - Add --auto-download to skip confirmation
metadata:
  openclaw:
    homepage: https://github.com/konanok/photo-skills

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented interactive prompt is hard-coded as Chinese ("是否下载模型?[Y/n]") with no indication that the user can choose locale or that the skill is intended only for Chinese-speaking environments. This is a natural-language policy issue because it imposes a language choice without opt-in or stated regional justification.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The documented --auto-download behavior allows network retrieval of a sizable model without an interactive confirmation step. In agent or unattended contexts, this reduces user control and can lead to unapproved external downloads, with bandwidth, provenance, and supply-chain implications.

Content

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

md
| --------------------------------- | --------------------------------------- |
| **Interactive** (terminal)        | Prompts user: "是否下载模型?[Y/n]"     |
| **Non-interactive** (piped/agent) | Exits with manual download instructions |
| **--auto-download flag**          | Downloads without confirmation          |

### Manual Download

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

Providing a ready-to-copy example that uses --auto-download makes unattended external download a standard workflow for users and agents. In a security-sensitive environment, this increases the chance that network-fetching behavior occurs without review, especially when combined with undeclared additional resources.

Content

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

md
# Keep top 50
python3 scripts/screen.py ~/data/output/thumbnails --top-k 50

# Auto-download model (skip confirmation)
python3 scripts/screen.py ~/data/output/thumbnails --auto-download

# Pass specific file paths instead of a directory

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The agent integration section instructs running a shell setup script, which introduces subprocess execution and potential package-install/network side effects beyond simple photo processing. In an automated agent context, setup scripts are higher risk because they can change the environment, fetch code, or execute arbitrary commands if not tightly reviewed.

Content

No source excerpt is available for this finding.

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/screen.py (reported line 88)May include surrounding context.

python
missing = []
    for pkg, pip_name in [("torch", "torch"), ("open_clip", "open-clip-torch"), ("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
95% confidence
Finding

The script performs an undisclosed secondary network download for the aesthetic model from a separate URL, despite the skill metadata emphasizing only the MobileCLIP model download flow. Hidden or under-documented downloads expand the trust boundary, can surprise operators in restricted environments, and increase supply-chain exposure if the remote artifact is replaced or intercepted.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/screen.py (reported line 172)May include surrounding context.

python
model_name: open_clip model name (e.g., 'MobileCLIP2-S0')
        pretrained: pretrained weights tag (e.g., 'dfndr2b')
        device: torch device
        auto_download: skip confirmation if True

    Returns:
        (model, preprocess, tokenizer)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script emits key operational prompts and status messages in Chinese, including the model download confirmation flow, and scene labels are returned only in Chinese. There is no user opt-in, language selection, or documented region-specific justification, which creates a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code path for the aesthetic model automatically downloads the file when absent, without any user confirmation, which conflicts with the surrounding documentation and expectations established for the main model. This mismatch is dangerous because users may believe execution is offline or consent-gated when it is not, leading to unauthorized egress and silent retrieval of executable model artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The aesthetic model is downloaded and cached automatically without a consent gate comparable to the primary model flow, then loaded via torch.load. Even though model weights are expected input, automatic retrieval of a remote artifact broadens supply-chain risk and may violate operator expectations or environment policy around network access and artifact provenance.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/screen.py (reported line 803)May include surrounding context.

python
parser.add_argument("--top-k", type=int, default=None, help="Keep only top K photos after filtering")
    parser.add_argument("--recursive", "-r", action="store_true", default=None, help="Search subdirectories")
    parser.add_argument("--dry-run", action="store_true", help="Preview without processing")
    parser.add_argument("--auto-download", action="store_true", help="Auto-download model without confirmation")

    args = parser.parse_args()

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This shell script presents its interface in Chinese (for example, "依赖检查") and continues using Chinese-only prompts and status messages throughout the file. That imposes a specific language on all users without opt-in, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The setup script downloads and persists an additional aesthetic-scoring model from GitHub that is not disclosed in the skill metadata's model section. This creates a supply-chain and transparency risk: users and reviewers may approve the skill expecting only the declared MobileCLIP2-S0 download, while the script fetches another executable input to the ML pipeline from a different source without integrity verification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file’s natural-language comments are entirely in Chinese, which imposes a specific language on users without offering any alternative or opt-in. This matches the policy category for language or locale constraints expressed in natural language.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The dependency is specified with a lower-bound constraint only, which makes builds non-reproducible and allows installation of different versions over time. In a security-sensitive image-processing skill, this increases supply-chain risk and makes it impossible to verify whether a deployed version includes known fixes or vulnerable releases.

Content

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

text
# photo-screener dependencies
# Uses Apple MobileCLIP2-S0 via open_clip for fast inference
torch>=2.0.0
open-clip-torch>=2.24.0
pillow>=10.0.0
numpy>=1.24.0

Unverifiable Dependency: torch has 16 known advisory(ies) (CVE-2025-2953 (PyTorch susceptible to local Denial of Service); CVE-2022-45907 (PyTorch vulnerable to arbitrary code execution); CVE-2025-32434 (PyTorch: `torch.load` with `weights_only=True` leads to remote code execution) +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
89% confidence
Finding

Torch has known security advisories, but the manifest does not pin a version, so there is no way to determine whether an installation will pull a patched or vulnerable release. In an ML skill that downloads and loads models, unverifiable dependency versions make supply-chain and vulnerable-runtime exposure more concerning than in a static utility package.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

Using an unpinned open-clip-torch version means future installs may resolve to materially different code than was originally tested. Because this package participates in model loading/inference, version drift can introduce security regressions, malicious upstream compromise exposure, or unexpected behavior in production.

Content

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

text
# photo-screener dependencies
# Uses Apple MobileCLIP2-S0 via open_clip for fast inference
torch>=2.0.0
open-clip-torch>=2.24.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
94% confidence
Finding

Pillow is an image parser handling potentially untrusted user-supplied files, so leaving it unpinned increases risk that installations may pick vulnerable or incompatible releases. Image libraries have a history of memory safety and resource-consumption flaws, making reproducible and auditable version selection especially important here.

Content

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

text
# Uses Apple MobileCLIP2-S0 via open_clip for fast inference
torch>=2.0.0
open-clip-torch>=2.24.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
94% confidence
Finding

Pillow processes untrusted image content, and the requirement does not fix a specific version despite numerous known advisories. Because this skill's core function is screening user photos, inability to verify a patched Pillow version materially raises the risk of exploitable parsing bugs or denial-of-service issues.

Content

No source excerpt is available for this finding.