CVE-2021-25322
Local attacker escalates privileges via symbolic link vulnerability in python-HyperKitty on openSUSE Leap 15.2 and Factory
- CVSS 7.8
- CWE-61
- Authentication, Authorization, and Session Management
- Local
A UNIX Symbolic Link (Symlink) Following vulnerability in python-HyperKitty of openSUSE Leap 15.2, Factory allows local attackers to escalate privileges from the user hyperkitty or hyperkitty-admin to root. This issue affects: openSUSE Leap 15.2 python-HyperKitty version 1.3.2-lp152.2.3.1 and prior versions. openSUSE Factory python-HyperKitty versions prior to 1.3.4-5.1.
- CWE
- CWE-61
- CVSS base score
- 7.8
- Published
- 2021-06-10
- OWASP
- A05 Security Misconfiguration
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Privilege Escalation
- Accessibility scope
- Local
- Impact
- Privilege Escalation
- Fixed by upgrading
- Yes
Solution
Update python-HyperKitty to version 1.3.4-5.1 or higher.
Vulnerable code sample
import os
def open_symlink(symlink_path):
with open(symlink_path, 'r') as f:
return f.read()
content = open_symlink('/path/to/symlink')
print(content)Patched code sample
import os
def open_symlink(symlink_path):
real_path = os.path.realpath(symlink_path)
directory = '/directory/'
if not real_path.startswith(os.path.abspath(directory)):
raise ValueError("Unsafe symlink target: {}".format(real_path))
with open(real_path, 'r') as f:
return f.read()
try:
content = open_symlink('/path/to/symlink')
print(content)
except ValueError as e:
print(e)Cite this entry
@misc{vaitp:cve202125322,
title = {{Local attacker escalates privileges via symbolic link vulnerability in python-HyperKitty on openSUSE Leap 15.2 and Factory}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2021},
note = {VAITP Python Vulnerability Dataset, entry CVE-2021-25322},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2021-25322/}}
}
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 ::
