Back to skill

Security audit

禁止WPS反复篡改图片文件默认打开方式

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent goal, but it tells users to make broad, destructive Windows changes that could break WPS or unrelated tasks/files without enough safeguards.

Review before installing or running. This is not evidence of deception or exfiltration, but the commands can permanently alter Windows registry state, scheduled tasks, and WPS installation files. Only use it if you understand the impact, have backups or a restore plan, and verify each detected task/file belongs to the WPS image-viewer component before changing it.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:26
Finding

Overbroad Scheduled-Task Matching Can Disable Unrelated Tasks

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 26-38
Vulnerability Type: Overbroad scheduled-task selection and destructive system modification
Risk Level: Medium

Vulnerable Code

powershell
$wpsTasks = Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' }
Write-Host "Found $($wpsTasks.Count) WPS scheduled tasks:"
$wpsTasks | Select-Object TaskName, State | Format-Table -AutoSize

# Disable all WPS scheduled tasks
$wpsTasks | ForEach-Object {
    try {
        Disable-ScheduledTask -TaskName $_.TaskName -ErrorAction Stop
        Write-Host "✅ Disabled: $($_.TaskName)"
    } catch {
        Write-Host "⚠️ Failed to disable: $($_.TaskName) - $($_.Exception.Message)"
    }
}

Technical Analysis

The task selection relies only on the regular expression WPS|wps appearing anywhere in a task name. It does not validate the task path, executable action, publisher, author, installation directory, or an allowlist of known WPS task identifiers.

PowerShell regular-expression matching is case-insensitive by default, making the explicit alternatives redundant and causing any task name containing the three-character sequence to match. The subsequent call to Disable-ScheduledTask omits -TaskPath, which also makes task identification insufficient where similarly named tasks exist in different scheduler folders.

The selected tasks are disabled automatically without per-task confirmation or a dry-run stage.

Attack Path

  1. A scheduled task unrelated to WPS has a task name containing wps, or such a task is created before the skill is run.
  2. The user executes the documented commands, potentially in an elevated PowerShell session as recommended elsewhere in the skill.
  3. The substring filter incorrectly classifies the unrelated task as WPS-related.
  4. Disable-ScheduledTask disables the task without validating its action, publisher, or task path.
  5. Software main ...[truncated 541 chars]
Remediation
View remediation

Remediation Suggestions

  • Maintain an allowlist of exact, documented WPS task names and task paths.
  • Inspect each task's Actions, Author, and executable path before classifying it as a WPS task.
  • Require executable paths to resolve beneath a verified WPS installation directory.
  • Pass both -TaskName and -TaskPath to Disable-ScheduledTask.
  • Present the exact tasks and actions to the user and require confirmation before making changes.
  • Provide a dry-run mode using -WhatIf where supported.
  • Export matching tasks before disabling them so that the original state can be restored.
  • Record whether each task was originally enabled and provide a rollback command that restores only tasks changed by the skill.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:113
Finding

Recursive Filename-Only Search Permanently Deletes DLL Files

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 113-116
Vulnerability Type: Unsafe recursive file deletion without component verification
Risk Level: High

Vulnerable Code

powershell
$dlls = Get-ChildItem $basePath -Recurse -Filter "photo.dll" -ErrorAction SilentlyContinue
foreach ($dll in $dlls) {
    try {
        Remove-Item -Path $dll.FullName -Force -ErrorAction Stop

The surrounding code performs this operation beneath each of the following broad roots:

powershell
$paths = @(
    "${env:ProgramFiles}\WPS",
    "${env:ProgramFiles(x86)}\WPS",
    "${env:LOCALAPPDATA}\WPS",
    "C:\WPS",
    "D:\WPS",
    "E:\WPS"
)

Technical Analysis

The skill recursively searches broad directory trees and treats every file named photo.dll as the targeted WPS image module. It does not verify:

  • The canonical component location.
  • The file's Authenticode signature or signer.
  • Product and company metadata.
  • The installed WPS version or package manifest.
  • A known hash or expected relative path.
  • Whether the file is used by another WPS component or unrelated application.

Every matching file is permanently deleted with -Force. The skill does not automatically back up the DLL, quarantine it to a reversible location, or request per-file approval. Suppressing traversal errors with -ErrorAction SilentlyContinue can also leave the user with an incomplete understanding of which directories were inspected.

This behavior does not support the unconditional statement that other WPS functions are unaffected, because deleting an installation component without dependency or integrity validation can affect other features.

Attack Path

  1. A legitimate, unrelated, or shared DLL named photo.dll exists under one of the recursively searched roots.
  2. The user runs the procedure, potentially with administrator privileges.
  3. The recursive filename filter selects ...[truncated 841 chars]
Remediation
View remediation

Remediation Suggestions

  • Restrict deletion to documented, version-specific relative paths beneath a verified WPS installation.
  • Resolve and normalize every candidate path, then confirm it remains within the intended installation root.
  • Validate Authenticode signatures, signer identity, product metadata, and expected file hashes where available.
  • Obtain component locations from WPS installation manifests or uninstall metadata instead of recursively matching filenames.
  • Display every candidate and require explicit user confirmation before modification.
  • Move files to a dedicated backup or quarantine directory rather than deleting them.
  • Preserve access-control lists and provide tested rollback instructions.
  • Prefer supported WPS configuration, repair, feature-removal, or uninstallation mechanisms over direct installation-file deletion.
  • Stop WPS processes and verify component dependencies before changing files.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:160
Finding

Recursive Filename-Only Search Force-Renames Executable Files

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 160-164
Vulnerability Type: Unsafe executable modification without identity validation
Risk Level: Medium

Vulnerable Code

powershell
$exes = Get-ChildItem $basePath -Recurse -Filter "photolaunch.exe" -ErrorAction SilentlyContinue
foreach ($exe in $exes) {
    try {
        $newName = $exe.FullName + ".bak"
        Rename-Item -Path $exe.FullName -NewName $newName -Force -ErrorAction Stop

The code applies this operation recursively beneath several broad WPS directory roots, including machine-level installation directories, user-local directories, and top-level WPS directories on multiple drives.

Technical Analysis

The procedure assumes that every executable named photolaunch.exe beneath a searched root is the intended WPS image-viewer component. It performs no validation of the executable's canonical location, Authenticode signature, publisher, product metadata, version, or hash.

The destination name is constructed by appending .bak, and Rename-Item is invoked with -Force. An existing backup may therefore be overwritten or otherwise handled unexpectedly depending on the target filesystem and PowerShell behavior. The process does not preserve a manifest recording original paths and file identities, so reliable rollback across multiple installations is not guaranteed.

Recursive filename-only discovery can modify unrelated executables or executables belonging to other WPS features. Renaming installed binaries directly can also violate application integrity assumptions and cause update, repair, or launch failures.

Attack Path

  1. An unrelated or shared executable named photolaunch.exe exists beneath one of the broad search roots.
  2. The user executes the skill with sufficient permission to modify that executable.
  3. The recursive search selects it based only on its filename.
  4. The executable is forcibly renamed to `ph ...[truncated 640 chars]
Remediation
View remediation

Remediation Suggestions

  • Use exact, documented component paths instead of recursive basename matching.
  • Verify the executable's normalized path, Authenticode signer, product metadata, and expected version before modification.
  • Confirm that the candidate belongs to the WPS image-viewer feature rather than another product component.
  • Check whether the destination backup path already exists and never overwrite it automatically.
  • Create a rollback manifest containing the original path, backup path, hash, signature, and timestamp.
  • Request explicit confirmation for every executable to be modified.
  • Prefer supported application settings, feature removal, or access-control mechanisms over renaming installed executables.
  • Provide a verification and restoration command that uses the rollback manifest rather than another broad recursive search.
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
Findings (1)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs users to disable scheduled tasks, delete registry keys under HKCU/HKLM, remove DLLs, and rename executables, which are destructive system changes. Although the goal appears to be user control over file associations rather than compromise, the skill does not present a prominent pre-execution warning about irreversibility, side effects, or the risk of damaging WPS functionality, making accidental system modification more likely.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.