Back to skill

Security audit

Amazon Sp Api

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Amazon Seller Central API helper whose sensitive credential and business-data access matches its stated purpose, with dependency and data-handling precautions users should understand.

Install only in an environment where you intend to expose Amazon seller credentials to this CLI. Use least-privilege SP-API/IAM credentials, prefer a virtual environment with pinned dependencies, and save report TSV files only to locations appropriate for sensitive seller, inventory, order, and financial data.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:38
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 38–42
Vulnerability Type: Unpinned runtime dependency installation
Risk Level: Medium

markdown
## First run — install the one Python dependency

The script uses [`httpx`](https://www.python-httpx.org/). If a command fails with `ModuleNotFoundError: No module named 'httpx'`, install it once:

```bash
python3 -c "import httpx" || python3 -m pip install httpx
text

### Technical Analysis

The documented fallback command installs `httpx` without a pinned version, lockfile, cryptographic hash verification, or explicit trusted package index. Consequently, the installed code may differ from the dependency that was present when the Skill was audited. Resolution also depends on the invoking environment's pip configuration, including custom or attacker-controlled indexes.

Although `httpx` is a legitimate package and the project contains no evidence that it intentionally selects a malicious dependency, this installation pattern creates a supply-chain exposure. A compromised package release or package index could provide attacker-controlled code. That code would subsequently run during installation or when `scripts/amazon_api.py` imports `httpx`.

### Attack Path

1. The invoking environment does not already have the `httpx` module.
2. A user or Agent follows the first-run instruction in `SKILL.md`.
3. pip resolves the unpinned `httpx` dependency through its configured package indexes.
4. A compromised release or attacker-controlled index supplies a malicious distribution.
5. Malicious package code executes during installation or upon import by `scripts/amazon_api.py`.
6. Because the Skill requires Amazon LWA and AWS credentials in environment variables, the malicious dependency could read and exfiltrate those credentials or tamper with API traffic.

### Impact Assessment

Successful exploitation would execute code with the privileges of the user running pip or the Skill. Potential scope includes
...[truncated 674 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add a reviewed dependency manifest that pins httpx and all transitive dependencies to exact versions.

  2. Generate and verify cryptographic hashes for every permitted distribution.

  3. Install dependencies using hash enforcement, for example:

    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  4. Configure pip to use an explicitly trusted HTTPS package index rather than relying on ambient user configuration.

  5. Install dependencies inside a dedicated virtual environment with minimal privileges.

  6. Use automated dependency monitoring and deliberately update pins after security review and testing.

  7. Avoid directing an Agent to perform mutable runtime installation automatically. Prefer preparing and verifying dependencies during a controlled packaging or deployment stage.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill requires high-risk capabilities: reading sensitive environment variables for Amazon and AWS credentials, making network calls to Amazon APIs, and potentially writing files (for report output or dependency installation), but it does not declare an explicit tool scope such as permissions or allowed-tools. That creates an over-privileged execution surface where an agent/runtime may allow broader tool access than intended, increasing the risk of secret exposure, unintended outbound requests, or filesystem side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script requires refresh tokens, client secrets, and AWS secret keys from environment variables, then uses them in outbound HTTP requests to obtain access tokens and call Amazon APIs. Although the docstring explains setup, it does not clearly warn users that sensitive credentials are consumed and data is sent to Amazon services.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/amazon_api.py (reported line 41)May include surrounding context.

python
TIMEOUT = 30
MAX_RETRIES = 3
LWA_TOKEN_URL = "https://api.amazon.com/auth/o2/token"
DEFAULT_MARKETPLACE = "A1F83G8C2ARO7P"  # UK

# ── Env helpers ──────────────────────────────────────────────────────────

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code fetches report documents from Amazon, parses their contents, and can save the raw TSV to a user-specified file path. While there is a brief docstring and an argument label, there is no clear user disclosure that these reports may contain sensitive seller, inventory, order, or financial data and may be written to disk.

Content

No source excerpt is available for this finding.