CVE-2018-14649
Unauthenticated attackers exploit Red Hat Ceph Storage 2 and 3's ceph-isci-cli vulnerability for remote root-level access via enabled debug shell in python-werkzeug
- CVSS 9.8
- CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')
- Authentication, Authorization, and Session Management
- Remote
It was found that ceph-isci-cli package as shipped by Red Hat Ceph Storage 2 and 3 is using python-werkzeug in debug shell mode. This is done by setting debug=True in file /usr/bin/rbd-target-api provided by ceph-isci-cli package. This allows unauthenticated attackers to access this debug shell and escalate privileges. Once an attacker has successfully connected to this debug shell they will be able to execute arbitrary commands remotely. These commands will run with the same privileges as of user executing the application which is using python-werkzeug with debug shell mode enabled. In – Red Hat Ceph Storage 2 and 3, ceph-isci-cli package runs python-werkzeug library with root level permissions.
- CVSS base score
- 9.8
- Published
- 2018-10-09
- OWASP
- A05 Security Misconfiguration
- Orthogonal defect classification
- Function
- Code defect classification
- Extraneous Functionality
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Privilege Escalation
- Accessibility scope
- Remote
- Impact
- Privilege Escalation
- Affected component
- python-werkzeug
- Fixed by upgrading
- Yes
Solution
Update ceph-isci-cli package to version 4 or higher.
Vulnerable code sample
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
def application(environ, start_response):
request = Request(environ)
# Your application logic here
response = Response("Hello, World!", status=200)
return response(environ, start_response)
if __name__ == "__main__":
# Setting debug=True allows access to the debug shell
run_simple('0.0.0.0', 5000, application, use_reloader=True, use_debugger=True)Patched code sample
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
def application(environ, start_response):
request = Request(environ)
# Your application logic here
response = Response("Hello, World!", status=200)
return response(environ, start_response)
if __name__ == "__main__":
# Set debug=False to prevent debug shell access
run_simple('0.0.0.0', 5000, application, use_reloader=False, use_debugger=False)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- rbd-target-api: disable the built-in werkzeug debugger (ceph/ceph-iscsi-cli)
rbd-target-api.py · main
Cite this entry
@misc{vaitp:cve201814649,
title = {{Unauthenticated attackers exploit Red Hat Ceph Storage 2 and 3's ceph-isci-cli vulnerability for remote root-level access via enabled debug shell in python-werkzeug}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2018},
note = {VAITP Python Vulnerability Dataset, entry CVE-2018-14649},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2018-14649/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
