CVE-2023-27482
Remote authentication bypass in Home Assistant Supervisor (pre-2023.03.1)
- CVSS 10.0
- CWE-287 Improper Authentication
- Authentication, Authorization, and Session Management
- Remote
homeassistant is an open source home automation tool. A remotely exploitable vulnerability bypassing authentication for accessing the Supervisor API through Home Assistant has been discovered. This impacts all Home Assistant installation types that use the Supervisor 2023.01.1 or older. Installation types, like Home Assistant Container (for example Docker), or Home Assistant Core manually in a Python environment, are not affected. The issue has been mitigated and closed in Supervisor version 2023.03.1, which has been rolled out to all affected installations via the auto-update feature of the Supervisor. This rollout has been completed at the time of publication of this advisory. Home Assistant Core 2023.3.0 included mitigation for this vulnerability. Upgrading to at least that version is thus advised. In case one is not able to upgrade the Home Assistant Supervisor or the Home Assistant Core application at this time, it is advised to not expose your Home Assistant instance to the internet.
- CVSS base score
- 10.0
- Published
- 2023-03-08
- OWASP
- A07 Identification and Authentication Failures
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Insecure Authentication Mechanisms
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Fixed by upgrading
- Yes
Solution
Update Home Assistant Supervisor to version 2023.03.1 or higher.
Vulnerable code sample
from flask import Flask, request
app = Flask(__name__)
@app.route('/supervisor_api', methods=['GET', 'POST'])
def supervisor_api():
return "Supervisor API Access Granted"
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8123)Patched code sample
from flask import Flask, request, abort
app = Flask(__name__)
@app.before_request
def require_authentication():
if request.endpoint in ['supervisor_api']:
auth_token = request.headers.get('Authorization')
if not auth_token or not is_valid_token(auth_token):
abort(401)
def is_valid_token(token):
valid_tokens = ['your_valid_token_here']
return token in valid_tokens
@app.route('/supervisor_api', methods=['GET', 'POST'])
def supervisor_api():
return "Supervisor API Access Granted"
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8123)Cite this entry
@misc{vaitp:cve202327482,
title = {{Remote authentication bypass in Home Assistant Supervisor (pre-2023.03.1)}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2023},
note = {VAITP Python Vulnerability Dataset, entry CVE-2023-27482},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2023-27482/}}
}
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 ::
