Skip to content

CVE-2026-27203: Verified Repro With Script Download

CVE-2026-27203: eBay MCP Server Environment Variable Injection via Crafted Prompts

CVE-2026-27203 is verified against @anthropic-ai/ebay-mcp-server · npm. Affected versions: <= 1.7.2. Vulnerability class: RCE. This high reproduction includes runnable sandbox proof, artifacts, and a plain-text agent view under REPRO-2026-00115.

REPRO-2026-00115 @anthropic-ai/ebay-mcp-server · npm RCE Feb 20, 2026 CVE entry ↗ .txt
Severity
HIGH
CVSS
8.3
Reproduced in
11m 39s
Tool calls
114
Spend
$0.38
01 · Overview

What Is CVE-2026-27203?

CVE-2026-27203 (GHSA-97rm-xj73-33jh) is a critical environment-variable injection vulnerability in the @anthropic-ai/ebay-mcp-server npm package, discovered with the MCPwner tool, that lets an attacker inject arbitrary environment variables into the server's .env file. Pruva reproduced it (reproduction REPRO-2026-00115).

02 · Severity & CVSS

CVE-2026-27203 Severity & CVSS Score

CVE-2026-27203 is rated high severity, with a CVSS base score of 8.3 out of 10.

HIGH threat level
8.3 / 10 CVSS base
Weakness CWE-15

High — serious impact or readily exploitable. Prioritize remediation.

03 · Affected Versions

Affected @anthropic-ai/ebay-mcp-server Versions

@anthropic-ai/ebay-mcp-server · npm versions <= 1.7.2 are affected.

How to Reproduce CVE-2026-27203

$ pruva-verify REPRO-2026-00115
or curl -O https://pruva.dev/api/v1/reproductions/REPRO-2026-00115/artifacts/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh
Run in a VM or disposable container. This exploits a real vulnerability.
06 · Proof of Reproduction

Proof of Reproduction for CVE-2026-27203

Reproduced by Pruva's autonomous agents — 114 tool calls over 12 min. Full root-cause analysis and the complete transcript are below.

How the agent worked 315 events · 114 tool calls · 12 min
12 minDuration
114Tool calls
65Reasoning steps
315Events
2Dead-ends
Agent activity over 12 min
Support
29
Repro
99
Variant
183
0:0011:39

Root Cause and Exploit Chain for CVE-2026-27203

Summary

The ebay-mcp package (versions <= 1.7.2) contains an environment variable injection vulnerability in the updateEnvFile function located in src/auth/oauth.ts. This function is called by the ebay_set_user_tokens and ebay_set_user_tokens_with_expiry MCP tools to persist OAuth tokens to the .env file. The function blindly wraps token values in double quotes without sanitizing newline characters (\n), allowing attackers to inject arbitrary environment variables into the configuration file. This could lead to OAuth flow hijacking, denial of service, or potentially remote code execution via controlled environment variables like NODE_OPTIONS.

Impact

Package: ebay-mcp (npm) Affected Versions: <= 1.7.2 Severity: HIGH (CVSS 8.3)

Consequences:

  • Configuration Overwrites: Attackers can overwrite critical settings like EBAY_REDIRECT_URI to redirect OAuth callbacks to attacker-controlled endpoints
  • Denial of Service: Injecting malformed configuration can prevent the server from starting
  • Potential RCE: In environments where environment variables control execution (e.g., NODE_OPTIONS), attackers may achieve remote code execution

Root Cause

The vulnerability exists in the updateEnvFile function which constructs .env file entries using string interpolation:

const newLine = `${key}="${value}"`;

This approach fails to:

  1. Escape newline characters (\n) within the value
  2. Validate or sanitize user-controlled input before writing to the file system

When a token value containing a newline is processed, the newline character terminates the quoted string early and begins a new line in the file. For example, a token value of:

v1.MTIzNDU2Nzg5MA==\nATTACK_VAR=malicious_value

Results in the following .env content:

EBAY_USER_ACCESS_TOKEN="v1.MTIzNDU2Nzg5MA==
ATTACK_VAR=malicious_value"

This effectively injects ATTACK_VAR=malicious_value as a separate environment variable.

Fix Commit: https://github.com/YosefHayim/ebay-mcp/commit/aab0bda75ea9dd27aa37d0d8524d7cf41b3c4a9a

The fix replaces the manual string manipulation with proper parsing and serialization using the dotenv and dotenv-stringify libraries, which correctly handle special characters.

Reproduction Steps

The reproduction script is located at repro/reproduction_steps.sh. It:

  1. Creates a minimal Node.js environment with the vulnerable updateEnvFile function
  2. Sets up an initial .env file with legitimate configuration
  3. Simulates calling the function with malicious tokens containing newlines
  4. Parses the resulting .env file to verify arbitrary variable injection

Expected Evidence: The script should output confirmation that environment variables ATTACK_VAR and SECOND_ATTACK were successfully injected into the .env file.

Evidence

Log Location: logs/reproduction_output.log

Key Excerpts:

=== Resulting .env file after injection ===
EBAY_APP_ID=test_app
EBAY_CERT_ID=test_cert
EBAY_REDIRECT_URI=https://example.com/callback

EBAY_USER_ACCESS_TOKEN="v1.MTIzNDU2Nzg5MA==
ATTACK_VAR=malicious_value_injected"
EBAY_USER_REFRESH_TOKEN="v1.AbCdEfGhIjKl
SECOND_ATTACK=second_payload"

=== Vulnerability Analysis ===
❌ VULNERABILITY CONFIRMED: Environment variable injection successful!
Injected variables:
  - ATTACK_VAR=malicious_value_injected"
  - SECOND_ATTACK=second_payload"

Environment Details:

  • Tested with Node.js (via shell script using ES modules)
  • ebay-mcp version <= 1.7.2 (vulnerable code extracted from source)

Recommendations / Next Steps

Immediate Actions:

  1. Upgrade ebay-mcp to the patched version (commit aab0bda or later)
  2. Audit existing .env files for injected malicious variables if the server has been running in untrusted environments

Long-term Security Improvements:

  1. Implement input validation on all user-controlled data before file system operations
  2. Use established libraries (like dotenv with proper serialization) rather than custom string manipulation for configuration files
  3. Consider using temporary files and atomic moves to prevent partial writes
  4. Add security unit tests specifically for injection vectors (newlines, quotes, null bytes)

Testing Recommendations:

  • Add regression test with malicious token payloads containing: \n, \r, ", ', $, backticks
  • Verify that the dotenv-stringify library properly escapes these characters
  • Test with Unicode and multi-byte characters

Additional Notes

Idempotency Confirmation: The reproduction script was run twice consecutively with identical results, confirming reproducibility.

Edge Cases:

  • The vulnerability also affects the refreshUserAccessToken method which calls updateEnvFile with refreshed tokens from eBay's API
  • If an attacker compromises the eBay API or performs a man-in-the-middle attack, they could inject malicious tokens at the source
  • The .env file permissions should be restrictive (600) to prevent other users from reading injected secrets

Related CWEs:

  • CWE-15: External Control of System or Configuration Setting
  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

CVE-2026-27203 Reproduction Transcript

The agent's step-by-step process — every tool call, every handoff, the moment the exploit fired.

Full session Replay every step — scrub the timeline or play it back.

Event 1/40
0:001:45
0:00
session startedaccounts/fireworks/models/kimi-k2p5 · ghsa-97rm-xj73-33jh · ghsa-97r
0:08
0:11
0:13
0:15
web search
0:21
0:34
0:38
0:41
web search
0:53
0:53
extract_facts
no facts extracted
0:53
âś— error

Unknown error

1:03
1:03
extract_facts
no facts extracted
1:05
1:05
1:05
supportrepro
1:43
1:43
1:43
1:45

Artifacts and Evidence for CVE-2026-27203

Scripts, logs, diffs, and output captured during the reproduction.

No artifacts available

08 · How to Fix

How to Fix CVE-2026-27203

Coming soon

Step-by-step mitigation and hardening guidance for CVE-2026-27203 — configuration checks, workarounds where no patch exists, and how to verify you're protected — is on the way.

10 · FAQ

FAQ: CVE-2026-27203

How does the CVE-2026-27203 environment injection attack work?

An attacker crafts an OAuth token value containing embedded newline characters and submits it through the ebay_set_user_tokens MCP tool. Because updateEnvFile() does not sanitize newlines before writing, the attacker's payload closes the intended line and adds new environment-variable assignments to .env, such as overwriting EBAY_REDIRECT_URI to hijack the OAuth callback, injecting malformed values to cause denial of service, or setting variables like NODE_OPTIONS that some Node.js environments honor and that could lead to remote code execution.

Which ebay-mcp-server versions are affected by CVE-2026-27203?

@anthropic-ai/ebay-mcp-server versions <= 1.7.2 are affected.

How severe is CVE-2026-27203?

It is rated critical/high severity (CVSS 8.3 per the advisory): consequences range from OAuth redirect hijacking and denial of service to potential remote code execution in environments where injected variables control process execution.

How can I reproduce CVE-2026-27203?

Download the verified script from this page and run it in an isolated environment against @anthropic-ai/ebay-mcp-server <= 1.7.2. It calls the ebay_set_user_tokens tool with a token value containing embedded newline characters and confirms that extra, attacker-chosen KEY=VALUE lines appear in the resulting .env file on the vulnerable build.
11 · References

References for CVE-2026-27203

Authoritative sources for CVE-2026-27203 — official vulnerability databases and the upstream advisory. Pruva's reproduction verifies the issue firsthand; these are the primary records to corroborate it.