
Educational PoC for CVE-2026-8838, a critical RCE vulnerability in Amazon Redshift Python Driver via unsafe eval() in vector_in(). Includes technical analysis, attack vector, and mitigation guidance.
eval()
Research and demonstration project in offensive cybersecurity conducted exclusively for educational and awareness purposes.
Any use on systems without explicit authorization is illegal.
This repository must only be used in:
The vulnerability scenario presented here is intended for educational demonstration purposes only.
CVE-2026-8838 is a critical code injection vulnerability (Remote Code Execution) discovered in the official Amazon Redshift Python connector (amazon-redshift-python-driver).
The flaw stems from the unsafe use of the native Python function eval() on data received directly from the server, within the vector_in() function. A malicious server or an attacker positioned as Man-in-the-Middle (MitM) can send a specially crafted payload that will be evaluated and executed on the client side without any validation.
| Field | Value |
|---|---|
| CVE ID | CVE-2026-8838 |
| CVSS Score | 9.8 (Critical) |
| CWE | CWE-94 — Improper Control of Generation of Code |
| CVSS Vector | AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Vulnerable Component | amazon-redshift-python-driver < 2.1.14 |
| Vulnerable Function | vector_in() |
| Attack Type | Rogue server / Man-in-the-Middle |
| Authentication Required | No |
| User Interaction | No |
The vector_in() function is responsible for deserializing vector-type data received from the Redshift server. In vulnerable versions, it uses eval() directly on the raw content returned by the server:
# Vulnerable code (simplified) — versions < 2.1.14
def vector_in(data, offset, length):
raw = data[offset:offset+length].decode("utf-8")
# FLAW: eval() on server-controlled data
return eval(raw)
A malicious server can return any valid Python expression instead of a legitimate vector. Python will then evaluate it as native code.
Client (victim) Server (malicious / MitM)
| |
|---------- Redshift Connection ----------->|
| |
|<--------- Forged Response ---------------|
| "[__import__('os').system('cmd')]" |
| |
| eval() executes payload on client side |
| => RCE on client machine |
See
poc_server.pyfor the simulated server andpoc/poc_client.pyfor the demonstration client.
The PoC simulates a Redshift server returning a forged response. For demonstration purposes only, the payload used is harmless (whoami).
Execution:
# Terminal 1 — start the fake server
python poc/poc_server.py
# Terminal 2 — simulate the vulnerable client
python poc/poc_client.py
Successful exploitation allows an attacker to:
| Package | Vulnerable Version | Fixed Version |
|---|---|---|
amazon-redshift-python-driver | < 2.1.14 | ≥ 2.1.14 |
Check your installed version:
pip show amazon-redshift-python-driver
pip install --upgrade amazon-redshift-python-driver
# Verification
pip show amazon-redshift-python-driver | grep Version
# Expected: Version: 2.1.14 or higher
See the MITIGATION.md file for detailed recommendations:
Maxime288 — github.com/Maxime288
Research conducted for educational purposes as part of the study of offensive security.