Vulnerabilities > CVE-2019-19726 - Improper Privilege Management vulnerability in Openbsd
Attack vector
LOCAL Attack complexity
LOW Privileges required
LOW Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
OpenBSD through 6.6 allows local users to escalate to root because a check for LD_LIBRARY_PATH in setuid programs can be defeated by setting a very small RLIMIT_DATA resource limit. When executing chpass or passwd (which are setuid root), _dl_setup_env in ld.so tries to strip LD_LIBRARY_PATH from the environment, but fails when it cannot allocate memory. Thus, the attacker is able to execute their own library code as root.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Restful Privilege Elevation Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
Exploit-Db
id EDB-ID:47780 last seen 2019-12-16 modified 2019-12-16 published 2019-12-16 reporter Exploit-DB source https://www.exploit-db.com/download/47780 title OpenBSD 6.x - Dynamic Loader Privilege Escalation id EDB-ID:47803 last seen 2019-12-30 modified 2019-12-30 published 2019-12-30 reporter Exploit-DB source https://www.exploit-db.com/download/47803 title OpenBSD - Dynamic Loader chpass Privilege Escalation (Metasploit)
Metasploit
description | This module exploits a vulnerability in the OpenBSD `ld.so` dynamic loader (CVE-2019-19726). The `_dl_getenv()` function fails to reset the `LD_LIBRARY_PATH` environment variable when set with approximately `ARG_MAX` colons. This can be abused to load `libutil.so` from an untrusted path, using `LD_LIBRARY_PATH` in combination with the `chpass` set-uid executable, resulting in privileged code execution. This module has been tested successfully on: OpenBSD 6.1 (amd64); and OpenBSD 6.6 (amd64) |
id | MSF:EXPLOIT/OPENBSD/LOCAL/DYNAMIC_LOADER_CHPASS_PRIVESC |
last seen | 2020-06-12 |
modified | 2019-12-22 |
published | 2019-12-22 |
references |
|
reporter | Rapid7 |
source | https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/openbsd/local/dynamic_loader_chpass_privesc.rb |
title | OpenBSD Dynamic Loader chpass Privilege Escalation |
Packetstorm
data source https://packetstormsecurity.com/files/download/155764/dynamic_loader_chpass_privesc.rb.txt id PACKETSTORM:155764 last seen 2019-12-28 published 2019-12-27 reporter Brendan Coles source https://packetstormsecurity.com/files/155764/OpenBSD-Dynamic-Loader-chpass-Privilege-Escalation.html title OpenBSD Dynamic Loader chpass Privilege Escalation data source https://packetstormsecurity.com/files/download/155658/qualys-openbsddl.txt id PACKETSTORM:155658 last seen 2019-12-12 published 2019-12-12 reporter Qualys Security Advisory source https://packetstormsecurity.com/files/155658/Qualys-Security-Advisory-OpenBSD-Dynamic-Loader-Privilege-Escalation.html title Qualys Security Advisory - OpenBSD Dynamic Loader Privilege Escalation
References
- https://www.openbsd.org/errata66.html
- https://www.openwall.com/lists/oss-security/2019/12/11/9
- https://seclists.org/bugtraq/2019/Dec/25
- http://packetstormsecurity.com/files/155658/Qualys-Security-Advisory-OpenBSD-Dynamic-Loader-Privilege-Escalation.html
- http://seclists.org/fulldisclosure/2019/Dec/31
- http://packetstormsecurity.com/files/155764/OpenBSD-Dynamic-Loader-chpass-Privilege-Escalation.html
- http://www.openwall.com/lists/oss-security/2023/10/03/2
- http://seclists.org/fulldisclosure/2023/Oct/11
- http://packetstormsecurity.com/files/174986/glibc-ld.so-Local-Privilege-Escalation.html