Back to skill

Security audit

Gemini Watermark Remover

Security checks for vulnerabilities and agentic risk

Overview

This local image tool is openly designed to remove Gemini AI watermarks, which creates content-authenticity and policy-compliance concerns despite no evidence of hidden malware.

Review this carefully before installing: it is meant to remove visible AI watermarking, which may violate service terms, licensing, or disclosure expectations if used for publication. Use only on images you are allowed to edit, preserve AI-origin disclosure through other means, and install dependencies in a pinned or isolated environment.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/remove_watermark.py:74
Finding

Missing Lower-Bound Coordinate Validation Permits Image Corruption and Denial of Service

Content
View full analysis
= height or px >= width: continue raw_alpha = alpha_map[y, x] ``` The affected coordinates are subsequently used without lower-bound validation: ```python watermarked = img_array[py, px, c] ``` ### Technical Analysis The watermark position is calculated by subtracting the configured watermark size and margins from the input image dimensions. For images smaller than the required watermark region, either `wm_x` or `wm_y` becomes negative. The validation only checks whether coordinates exceed the upper image bounds: ```python if py >= height or px >= width: continue ``` It does not verify that `px` and `py` are greater than or equal to zero. NumPy treats some negative indices as offsets from the end of an array. Consequently, valid negative indices can modify pixels on the opposite side of the image. If a negative index exceeds the array dimensions, NumPy raises an `IndexError`, terminating processing. ### Attack Path 1. An attacker supplies an image whose width or height is below the configured 80-pixel minimum implied by the 48-pixel watermark and 32-pixel margin. 2. The script calculates a negative `wm_x` or `wm_y`. 3. The processing loop passes the negative coordinates to the NumPy array because only upper bound ...[truncated 842 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Open-Ended Dependency Constraints Prevent Reproducible and Auditable Installation

Content
View full analysis
=10.0.0 numpy>=1.24.0 ``` The installation documentation also permits installation of whichever releases are current at installation time: ```bash pip install Pillow numpy ``` ### Technical Analysis Both dependencies use open-ended minimum-version constraints. Package resolution may therefore select future versions that were not part of this audit. No lock file or package hashes are provided to verify the exact artifacts installed. This does not demonstrate that Pillow or NumPy is currently malicious. However, it makes installation non-reproducible and expands supply-chain exposure because the executed dependency code can change without any modification to the project itself. ### Attack Path 1. A user follows the documented installation command or installs from `requirements.txt`. 2. The package resolver selects the latest releases satisfying the minimum-version constraints. 3. A future compromised, malicious, or incompatible package release is downloaded from the configured package index. 4. Package installation or subsequent import executes code that was not reviewed as part of this project version. 5. The resulting behavior may differ from the audited implementation and inherits the permissions of the user running the installation or script. ### Impact Assessment The direct confirmed impact is loss of installation reproducibility and inability to guarantee that deployed dependency code matches the audited environment. If an upstream release or package index were compromised, dependency code could execute with the privileges of the installing or invoking user. No evidence of an existing malicious dependency, dependency-confusion package, typosquatting, or unsafe custom package source was identified in the audited project. ]]>
Remediation
View remediation
numpy== ``` For stronger supply-chain integrity: 1. Generate a lock file containing exact transitive dependency versions. 2. Record cryptographic hashes for every downloaded distribution. 3. Install with hash enforcement, for example: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Use a trusted, explicitly configured package index. 5. Review dependency updates before modifying the lock file. 6. Add automated vulnerability and license scanning for dependencies. 7. Update `SKILL.md` and `README.md` so installation instructions use the locked, hash-verified requirements rather than unconstrained direct installation. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file’s stated purpose is to remove Gemini-generated image watermarks, directly enabling tampering with provenance markers. In this skill context, that is especially dangerous because the tool is purpose-built to defeat attribution and can be used to conceal AI origin or bypass downstream trust signals.

Content

No source excerpt is available for this finding.

Obfuscated Code

High
Category
Supply Chain
Confidence
50% confidence
Finding

Code contains obfuscation (base64, hex encoding with execution). This is often used to hide malicious functionality.

Content

Scanner excerpt · scripts/remove_watermark.py (reported line 22)May include surrounding context.

python
LOGO_VALUE = 255

# Embedded watermark templates (base64 encoded)
BG_48_BASE64 = """iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAGVElEQVR4nMVYvXIbNxD+FvKMWInXmd2dK7MTO7sj9QKWS7qy/Ab2o/gNmCp0JyZ9dHaldJcqTHfnSSF1R7kwlYmwKRYA93BHmkrseMcjgzgA++HbH2BBxhhmBiB/RYgo+hkGSFv/ZOY3b94w89u3b6HEL8JEYCYATCAi2JYiQ8xMDADGWsvMbfVagm6ZLxKGPXr0qN/vJ0mSpqn0RzuU//Wu9MoyPqxmtqmXJYwxxpiAQzBF4x8/fiyN4XDYoZLA5LfEhtg0+glMIGZY6wABMMbs4CaiR8brkYIDwGg00uuEMUTQ1MYqPBRRYZjZ+q42nxEsaYiV5VOapkmSSLvX62VZprUyM0DiQACIGLCAESIAEINAAAEOcQdD4a+2FJqmhDd/YEVkMpmEtrU2igCocNHW13swRBQYcl0enxbHpzEhKo0xSZJEgLIsC4Q5HJaJ2Qg7kKBjwMJyCDciBBcw7fjSO4tQapdi5vF43IZ+cnISdh9Y0At2RoZWFNtLsxr8N6CUTgCaHq3g+Pg4TVO1FACSaDLmgMhYC8sEQzCu3/mQjNEMSTvoDs4b+nXny5cvo4lBJpNJmKj9z81VrtNhikCgTsRRfAklmurxeKx9JZIsy548eeITKJgAQwzXJlhDTAwDgrXkxxCD2GfqgEPa4rnBOlApFUC/39fR1CmTyWQwGAQrR8TonMRNjjYpTmPSmUnC8ODgQHqSJDk7O9uNBkCv15tOp4eHh8SQgBICiCGu49YnSUJOiLGJcG2ydmdwnRcvXuwwlpYkSabTaZS1vyimc7R2Se16z58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ated 27 chars]

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · scripts/remove_watermark.py (reported line 22)May include surrounding context.

python
r/bin/env python3
"""
Gemini Watermark Remover
Remove watermarks from Gemini AI generated images.
"""

import os
import sys
import argparse
import base64
import io
from PIL import Image
import numpy as np

# Constants (matching JS implementation)
ALPHA_NOISE_FLOOR = 3 / 255
ALPHA_THRESHOLD = 0.002
MAX_ALPHA = 0.99
LOGO_VALUE = 255

# Embedded watermark templates (base64 encoded)
BG_48_BASE64 = """iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAGVElEQVR4nMVYvXIbNxD+FvKMWInXmd2dK7MTO7sj9QKWS7qy/Ab2o/gNmCp0JyZ9dHaldJcqTHfnSSF1R7kwlYmwKRYA93BHmkrseMcjgzgA++HbH2BBxhhmBiB/RYgo+hkGSFv/ZOY3b94w89u3b6HEL8JEYCYATCAi2JYiQ8xMDADGWsvMbfVagm6ZLxKGPXr0qN/vJ0mSpqn0RzuU//Wu9MoyPqxmtqmXJYwxxpiAQzBF4x8/fiyN4XDYoZLA5LfEhtg0+glMIGZY6wABMMbs4CaiR8brkYIDwGg00uuEMUTQ1MYqPBRRYZjZ+q42nxEsaYiV5VOapkmSSLvX62VZprUyM0DiQACIGLCAESIAEINAAAEOcQdD4a+2FJqmhDd/YEVkMpmEtrU2igCocNHW13swRBQYcl0enxbHpzEhKo0xSZJEgLIsC4Q5HJaJ2Qg7kKBjwMJyCDciBBcw7fjSO4tQapdi5vF43IZ+cnISdh9Y0At2RoZWFNtLsxr8N6CUTgCaHq3g+Pg4TVO1FACSaDLmgMhYC8sEQzCu

Obfuscated Code

High
Category
Supply Chain
Confidence
50% confidence
Finding

Code contains obfuscation (base64, hex encoding with execution). This is often used to hide malicious functionality.

Content

Scanner excerpt · scripts/remove_watermark.py (reported line 24)May include surrounding context.

python
# Embedded watermark templates (base64 encoded)
BG_48_BASE64 = """iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAGVElEQVR4nMVYvXIbNxD+FvKMWInXmd2dK7MTO7sj9QKWS7qy/Ab2o/gNmCp0JyZ9dHaldJcqTHfnSSF1R7kwlYmwKRYA93BHmkrseMcjgzgA++HbH2BBxhhmBiB/RYgo+hkGSFv/ZOY3b94w89u3b6HEL8JEYCYATCAi2JYiQ8xMDADGWsvMbfVagm6ZLxKGPXr0qN/vJ0mSpqn0RzuU//Wu9MoyPqxmtqmXJYwxxpiAQzBF4x8/fiyN4XDYoZLA5LfEhtg0+glMIGZY6wABMMbs4CaiR8brkYIDwGg00uuEMUTQ1MYqPBRRYZjZ+q42nxEsaYiV5VOapkmSSLvX62VZprUyM0DiQACIGLCAESIAEINAAAEOcQdD4a+2FJqmhDd/YEVkMpmEtrU2igCocNHW13swRBQYcl0enxbHpzEhKo0xSZJEgLIsC4Q5HJaJ2Qg7kKBjwMJyCDciBBcw7fjSO4tQapdi5vF43IZ+cnISdh9Y0At2RoZWFNtLsxr8N6CUTgCaHq3g+Pg4TVO1FACSaDLmgMhYC8sEQzCu3/mQjNEMSTvoDs4b+nXny5cvo4lBJpNJmKj9z81VrtNhikCgTsRRfAklmurxeKx9JZIsy548eeITKJgAQwzXJlhDTAwDgrXkxxCD2GfqgEPa4rnBOlApFUC/39fR1CmTyWQwGAQrR8TonMRNjjYpTmPSmUnC8ODgQHqSJDk7O9uNBkCv15tOp4eHh8SQgBICiCGu49YnSUJOiLGJcG2ydmdwnRcvXuwwlpYkSabTaZS1vyimc7R2Se16z58/f/jw4Z5LA8iy7NmzZ8J76CQ25F2UGsEAJjxo5194q0fn9unp6fHx8f5oRCQ1nJ+fbxtA3HAjAmCMCaGuAQWgh4eH0+k0y7LGvPiU3CVXV1fz+by+WQkCJYaImKzL6SEN6uMpjBVMg8FgOp3GfnNPQADqup79MLv59AlWn75E/vAlf20ibmWg0Pn06dPJZNLr9e6nfLu8//Ahv/gFAEdcWEsgZnYpR3uM9KRpOplMGmb6SlLX9Ww2q29WyjH8+SI+pD0GQJIkJycn/8J/I4mWjaQoijzPb25uJJsjmAwqprIsG4/HbVZ2L/1fpCiKoijKqgTRBlCWZcPhcDQafUVfuZfUdb1cLpfL5cePf9Lr16/3zLz/g9T1quNy+F2FiYjSNB0Oh8Ph8HtRtV6vi6JYLpdVVbmb8t3dnSAbjUbRNfmbSlmWeZ6XHytEUQafEo0xR0dHUdjvG2X3Sd/Fb0We56t6BX8l2mTq6BCVnqOjo7Ozs29hRGGlqqrOr40CIKqeiGg8Hn/xcri/rG/XeZ7/evnrjjGbC3V05YC/BSRJ8urVq36/3zX7Hjaq63o+n19fX/upUqe5VxFok7UBtQ+T6XQ6GAz2Vd6Ssizn8/nt7a3ay1ZAYbMN520XkKenpx0B2E2SLOo+FEWxWPwMgMnC3/adejZMYLLS42r7oH4LGodpsVgURdHQuIcURbFYLDYlVKg9sCk5wpWNiHym9pUAEQGG6EAqSxhilRQWi0VZVmrz23yI5cPV1dX5TwsmWGYrb2TW36OJGjdXhryKxEeHvjR2Fgzz+bu6XnVgaHEmXhytEK0W1aUADJPjAL6CtPZv5rsGSvUKtv7r8/zdj+v1uoOUpsxms7qunT6+g1/TvTQCxE6XR2kBqxjyZo6K66gsAXB1fZ3neQdJSvI8X61WpNaMWCFuKNrkGuGGmMm95fhpvPkn/f6lAgAuLy/LstyGpq7r9+8d4rAr443qaln/ehHt1siv3dvt2B/RDpJms5lGE62gEy9az0XGcQCK3DL4DTPr0pPZEjPAZVlusoCSoihWqzpCHy7ODRXhbUTJly9oDr4fKDaV9NZJUr
...[truncated 27 chars]

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly enables removal of visible Gemini watermarks and encourages cleaning images before publishing or sharing, but provides no warning about provenance, platform policy, copyright, or deceptive-use risks. In context, the skill’s sole purpose is defeating an attribution/provenance marker, which makes misuse for misrepresentation or policy evasion materially more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script silently modifies image content and writes a new file whose explicit purpose is watermark removal. In the context of provenance and content authenticity, removing a visible attribution marker without a warning or consent checkpoint facilitates deceptive reuse and tampering, even though it is not a memory-safety or code-execution flaw.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

SQP-3 applies to all file types and includes language/locale policy violations. The file indicates English and Chinese documentation variants, but the primary README is English-first and does not state any user language preference or opt-in mechanism; this is a mild policy concern in natural-language presentation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a lower bound only, so builds are not reproducible and may resolve to different Pillow versions over time. That increases supply-chain risk and makes it impossible to verify whether a known-vulnerable or incompatible release will be installed.

Content

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

text
Pillow>=10.0.0
numpy>=1.24.0

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
90% confidence
Finding

Pillow has multiple published advisories, and because the manifest does not pin an exact version, there is no way to determine from this file alone whether the installed version includes those fixes. In an image-processing skill, that uncertainty matters more because the package is directly exposed to potentially untrusted image input.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The numpy requirement is unpinned, which allows different environments to install different versions and weakens dependency integrity. This can expose users to vulnerable upstream releases or unexpected breaking changes without any review point.

Content

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

text
Pillow>=10.0.0
numpy>=1.24.0

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
87% confidence
Finding

numpy has known advisories, and the lack of exact version pinning prevents verification that deployments are using a safe release. Although numpy is not obviously the primary attack surface here, it remains part of the supply chain and could introduce vulnerable code paths or operational instability.

Content

No source excerpt is available for this finding.