Back to skill

Security audit

Listing Image Optimizer

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent Amazon image-update purpose, but its live listing writes and public file server are too risky and under-scoped to install without review.

Review before installing. Use a constrained SP-API credential, test on a small SKU set first, and avoid running push_images.js on any network-reachable machine until the temporary image hosting is replaced with controlled storage or hardened with strict path validation and access limits.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/push_images.js:42
Finding

Public Path Traversal Allows Arbitrary Local 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 HTTP request path is joined directly to the configured image directory without decoding and validating the path, checking its canonical location, restricting file extensions, or authenticating the requester. Traversal components such as `../` can therefore cause the resolved path to escape the intended image directory. The server binds to `0.0.0.0`, making it accessible through every available network interface. The documented workflow expects this port to be publicly reachable so Amazon can retrieve images. Consequently, the vulnerable handler can be exposed to arbitrary Internet clients during the 15-minute serving period. `fs.existsSync()` only verifies that the resulting path exists; it does not establish that the path is inside the authorized directory or that it is an approved image. Setting `Content-Type` to `image/jpeg` does not protect the underlying contents from disclosure. ### Attack Path 1. An operator starts `push_images.js` on a publicly reachable system. 2. The script binds its HTTP server to all interfaces on port 8899 or a user-selected port. 3. An attacker identifies the exposed service during its serving window. 4. The attacker sends a request containing traversal components, such as `/../../amazon-sp-api.json`, adjusted for the configured image-directory depth. 5. `pat ...[truncated 943 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/audit.js:37
Finding

Unrestricted Listing Image Fetch Enables Server-Side Request Forgery

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; } ``` ```javascript const url = images[0]?.media_location; if (!url) continue; const dims = await getImageDimensions(url); ``` ### Technical Analysis The script obtains `media_location` from listing attributes and passes it directly to `fetch()`. It does not restrict the URL scheme or hostname, validate the resolved IP address, control redirects, impose a timeout, or limit the response body size. A listing value controlled or modified by an attacker, compromised account, or another integration can therefore make the audit host issue requests to localhost, private networks, link-local services, or cloud metadata endpoints. Redirects can potentially bypass simplistic hostname assumptions because each redirect destination is not independently validated. The function also makes an initial `HEAD` request whose response is not used, followed by a separate `GET` request when the dimensions are not encoded in the URL. The GET response is fully buffered with `arrayBuffer()` before processing. A malicious endpoint can return a very ...[truncated 1613 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:27
Finding

Unpinned Third-Party Dependency Installation Creates Supply-Chain Risk

Content
View full analysis
Remediation
View remediation
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 (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch is security-relevant because the documentation omits an undeclared capability to open a public HTTP server exposing local image files. Hidden network exposure materially changes the attack surface and can lead operators to run the skill in environments where local assets become publicly reachable without adequate review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This mismatch is security-relevant because the documentation omits an undeclared capability to open a public HTTP server exposing local image files. Hidden network exposure materially changes the attack surface and can lead operators to run the skill in environments where local assets become publicly reachable without adequate review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

This mismatch is security-relevant because the documentation omits an undeclared capability to open a public HTTP server exposing local image files. Hidden network exposure materially changes the attack surface and can lead operators to run the skill in environments where local assets become publicly reachable without adequate review.

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 skill metadata promises automatic image padding and live SP-API updates, but this file only audits and reports image issues. That mismatch is dangerous because operators may grant SP-API credentials and rely on automated remediation that never occurs, creating a deceptive capability claim that can lead to incorrect operational decisions and over-privileged deployment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README advertises automatic padding and pushing of corrected images to live Amazon listings, but it does not warn users that the skill changes production listing content. This is risky because users may invoke the skill expecting an audit-only workflow and unintentionally overwrite marketplace assets across seller accounts or marketplaces.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares no explicit tool scope or permission boundaries despite requiring environment access, file reads, and network activity. This is dangerous because the skill reads credential material from an environment-configured path and performs network-facing operations, leaving operators without a clear least-privilege contract for what the skill is allowed to access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill automates modifications to live Amazon listings but does not foreground that consequence as a clear safety warning. This is dangerous because users may run it expecting analysis or local fixes, not realizing it can directly change production catalog data and trigger irreversible marketplace effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation states that the skill spins up a publicly accessible HTTP server to serve listing images, but it does not include a clear security warning about temporary public exposure. Publicly exposing local files increases the risk of unintended data disclosure, directory or file enumeration if implemented unsafely, and opportunistic access by third parties during the exposure window.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented title-editing capability expands the skill from image optimization into modification of unrelated live listing content. This is dangerous because it introduces a broader, higher-risk write capability than users would expect, increasing the chance of unauthorized or accidental business-critical listing changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

An unjustified title-editing function violates least surprise and least privilege for a skill presented as an image optimizer. If triggered or repurposed, it could alter customer-facing catalog content, causing reputational harm, compliance issues, or listing suppression.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module header describes detection-only behavior, while the overall skill description claims automatic correction and live publishing. In a security-sensitive integration that uses seller credentials, this inconsistency increases the chance of unsafe trust assumptions, failed change control, and accidental deployment under a false understanding of what the code does.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The implementation does not directly upload images through SP-API as the skill description implies; instead it updates listings to reference externally hosted URLs and depends on Amazon crawling them. This mismatch can mislead operators about the network exposure, data handling, and reliability characteristics of the tool, causing them to unknowingly expose internal assets or use an insecure workflow in production.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script binds an unauthenticated HTTP server to 0.0.0.0 and publishes a publicly reachable URL for local files, making corrected images accessible to anyone who can reach the host during the 15-minute exposure window. Because the request path is directly joined to the served directory without normalization or traversal checks, an attacker may also be able to request files outside the intended directory depending on path handling, increasing the risk beyond simple image exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script opens a public HTTP port and serves local files without any explicit warning that the contents will be accessible from outside the machine. In the context of a seller-account automation skill, users may run this on workstations or servers containing proprietary product assets, making accidental exposure of images or adjacent files more dangerous than in a purely local utility.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The script reads SP-API credentials from a local file or environment-selected path and uses them to make authenticated listing-update calls. While this is part of the script's purpose, the code lacks any user-facing notice that sensitive credentials will be accessed and used from the specified configuration source.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code queries api.ipify.org to determine a public IP so that externally hosted image URLs can be constructed. Contacting a third-party IP discovery service is not justified by the manifest's stated image audit/pad/push purpose and exists solely to support the undocumented public-serving behavior.

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