Back to skill

Security audit

Amazon Listing Image Optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill has a legitimate Amazon image-maintenance purpose, but its upload workflow can expose local files publicly and modifies live listings with limited safeguards.

Review before installing. Use only with a dedicated directory containing the exact fixed images, do not run it near credential files, prefer S3 or another presigned HTTPS hosting flow instead of the built-in public server, pin dependencies, and require explicit confirmation for any live Amazon listing updates.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/push_images.js:44
Finding

Unauthenticated Public File Server Allows Directory Traversal and Arbitrary File Disclosure

Content
View full analysis
{ const filePath = path.join(dir, req.url.replace(/^\//, '')); if (fs.existsSync(filePath)) { res.writeHead(200, { 'Content-Type': 'image/jpeg' }); fs.createReadStream(filePath).pipe(res); } else { res.writeHead(404); res.end(); } }); server.listen(port, '0.0.0.0'); return server; } ``` ### Technical Analysis The temporary image server binds to `0.0.0.0`, making it accessible through every network interface. It does not authenticate requests or restrict access to expected image filenames. The request URL is joined directly to the configured image directory: ```js path.join(dir, req.url.replace(/^\//, '')) ``` No canonicalization or containment check ensures that the resulting path remains inside `dir`. A raw request path containing parent-directory components can therefore resolve outside the intended image directory. The code also follows ordinary filesystem resolution behavior and does not reject symbolic links, directories, or non-image files. The forced `Content-Type` header does not prevent disclosure because the underlying bytes of any readable file are still returned. ### Attack Path 1. The operator runs the documented image upload workflow. 2. The server starts on a publicly reachable interface and normally remains active for 15 minutes. 3. An attacker discovers or already knows the server's public IP and port. 4. The attacker submits an HTTP request containing path traversal components, such as a raw request for `/../amazon-sp-api.json`, adjusted for the image directory's location. 5. `path.join()` resolves the path outside the image directory. 6. If the target exists and is readable by the process, `createR ...[truncated 782 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/audit.js:37
Finding

Unvalidated and Unbounded Remote Image Retrieval Enables SSRF and Memory Exhaustion

Content
View full analysis
r.arrayBuffer()); const bytes = new Uint8Array(buf); // JPEG SOF0 marker for (let i = 0; i < bytes.length - 8; i++) { if (bytes[i] === 0xFF && (bytes[i+1] === 0xC0 || bytes[i+1] === 0xC2)) { return { w: (bytes[i+7] << 8) | bytes[i+8], h: (bytes[i+5] << 8) | bytes[i+6] }; } } } catch (e) { return null; } return null; } ``` The URL is obtained from a listing attribute at `scripts/audit.js:68-75`: ```js const images = attrs[attr]; if (!images || !images.length) continue; const url = images[0]?.media_location; if (!url) continue; const dims = await getImageDimensions(url); ``` ### Technical Analysis The script performs both `HEAD` and `GET` requests against listing-provided URLs without validating: - The URL scheme. - The destination hostname. - Resolved IP addresses. - Redirect destinations. - Response status. - Response content type. - Response length. - Request duration. The entire GET response is buffered with `arrayBuffer()`. A remote server can therefore return an extremely large or indefinitely delayed response, consuming memory or holding the audit process open. If an attacker can influence a listing's image attribute, the URL may target loopback, private, or link-local services reachable from the machine running the audit. Redirects create an additional bypass because an initially acceptable URL can redirect to a restricted destination. ### Atta ...[truncated 1327 chars]
Remediation
View remediation

other

Note
Location
scripts/push_images.js:57
Finding

Runtime Workflow Discloses the Operator's Public IP to an External Service

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:28
Finding

Installation Instructions Use Unpinned Third-Party Dependencies

Content
View full analysis
Remediation
View remediation
--hash=sha256: ``` - Install Python dependencies with `pip install --require-hashes -r requirements.txt`. - Use `npm ci` rather than mutable `npm install` in reproducible environments. - Configure trusted registries explicitly. - Review transitive dependencies and run dependency vulnerability scanning. - Update pins through a controlled review and testing process. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/pad_to_square.py:24
Finding

Image Processing Can Allocate an Excessively Large Intermediate Canvas

Content
View full analysis
Remediation
View remediation
MAX_PIXELS: raise ValueError("Image exceeds pixel limit") img = source.convert("RGB") img.thumbnail((2000, 2000), Image.Resampling.LANCZOS) canvas = Image.new("RGB", (2000, 2000), (255, 255, 255)) x = (2000 - img.width) // 2 y = (2000 - img.height) // 2 canvas.paste(img, (x, y)) ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented workflow includes opening a public HTTP server on a public port to expose local files for Amazon crawling, yet this network exposure is not clearly declared in the skill metadata or bounded by safety constraints. In the context of a skill handling seller credentials and local image directories, undocumented public exposure materially increases the risk of unintended file disclosure or broader attack surface on the host.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented workflow includes opening a public HTTP server on a public port to expose local files for Amazon crawling, yet this network exposure is not clearly declared in the skill metadata or bounded by safety constraints. In the context of a skill handling seller credentials and local image directories, undocumented public exposure materially increases the risk of unintended file disclosure or broader attack surface on the host.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented workflow includes opening a public HTTP server on a public port to expose local files for Amazon crawling, yet this network exposure is not clearly declared in the skill metadata or bounded by safety constraints. In the context of a skill handling seller credentials and local image directories, undocumented public exposure materially increases the risk of unintended file disclosure or broader attack surface on the host.

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

md
### `audit.js` — Detect non-square images

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
### `audit.js` — Detect non-square images

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
### `audit.js` — Detect non-square images

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
### `audit.js` — Detect non-square images

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
### `audit.js` — Detect non-square images

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
### `push_images.js` — Upload fixed images to Amazon

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
### `push_images.js` — Upload fixed images to Amazon

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
### `push_images.js` — Upload fixed images to Amazon

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a remediation workflow that modifies listing images via SP-API, but the code in this file only reads listing/inventory data, inspects remote image dimensions, and optionally writes a local JSON report. No image transformation, upload, or listing update logic is present here, creating a clear mismatch between claimed behavior and implemented behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill requires access to environment variables, local files, and network operations but does not declare any explicit tool scope or permissions boundaries. That makes the effective capability set opaque to reviewers and execution frameworks, increasing the chance of unintended credential access, file exposure, or outbound network behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill claims broad applicability across any marketplace and seller account without clear trigger constraints, approval steps, or scope limits. Overly broad activation language can cause operators or orchestrators to run it against the wrong account or inventory, leading to unintended bulk changes in production commerce systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes pushing corrected images and patching live listing titles but does not prominently warn that these are production-modifying actions. In the context of Amazon listings, silent write operations can directly change customer-facing content and business performance, making lack of warning and confirmation a significant operational security risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill's documented capability includes patching listing titles even though the manifest frames the skill as an image optimizer. Hidden or secondary state-changing functionality is dangerous because operators may authorize the skill for image maintenance while it can also alter unrelated production listing content.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Title modification is outside the justified scope of an image optimization skill and enables unauthorized or surprising edits to live product listings. In a commerce context, this can affect search ranking, compliance, branding, and customer trust, making the extra capability more dangerous than it would be in a read-only utility.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code reads SP-API credentials from a file or environment override and constructs an authenticated client, but there is no user-facing disclosure near the credential access explaining that sensitive seller credentials will be used. Although the header states the script pushes images to Amazon listings, it does not explicitly warn that authenticated account data will be loaded and transmitted to Amazon.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script starts an unauthenticated HTTP server bound to 0.0.0.0 and serves files from a user-supplied directory over plain HTTP so Amazon can fetch them. In the context of an image optimizer, exposing local files publicly is broader than the core purpose and creates unnecessary data exposure risk, especially if the path handling allows requests for files outside the intended directory.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script silently exposes files from a local directory over a public, unauthenticated HTTP service without prominently warning the user that the content may be reachable by anyone who can access the host and port. In this skill's context, that is especially risky because users may point --dir at directories containing more than just generated listing images, and the service is intentionally kept alive for 15 minutes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

To construct crawlable URLs, the script calls https://api.ipify.org to discover the host's public IP. The manifest does not mention contacting third-party discovery services, and this capability is not inherent to auditing or padding listing images.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access, suspicious.exposed_secret_literal

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/audit.js:16

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/push_images.js:17

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/audit.js:25

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/push_images.js:26