CVE-2023-32303
Unauthorized access to Planet API pre-2.0.1
- CVSS 5.5
- CWE-732 Incorrect Permission Assignment for Critical Resource
- Design Defects
- Local
Planet is software that provides satellite data. The secret file stores the user's Planet API authentication information. It should only be accessible by the user, but before version 2.0.1, its permissions allowed the user's group and non-group to read the file as well. This issue was patched in version 2.0.1. As a workaround, set the secret file permissions to only user read/write by hand.
- CVSS base score
- 5.5
- Published
- 2023-05-12
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Design Defects
- Subcategory
- Poorly Designed Access Controls
- Accessibility scope
- Local
- Impact
- Unauthorized Access
- Affected component
- Planet
- Fixed by upgrading
- Yes
Solution
Update to version 2.0.1 or higher.
Vulnerable code sample
import os
# Path to the secret file
secret_file_path = '/path/to/secret_file'
# Before the fix, the permissions allow group and others to read the file
os.chmod(secret_file_path, 0o644) # rw-r--r-- (user read/write, group read, others read)Patched code sample
import os
import stat
# Path to the secret file
secret_file_path = '/path/to/secret_file'
# Fix the file permissions to only allow the user to read/write
os.chmod(secret_file_path, stat.S_IRUSR | stat.S_IWUSR)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.
- enforce restricting secret file permissions to user read/write (planetlabs/planet-client-python)
planet/auth.py,planet/auth.py · _SecretFile._write,planet/auth.py · _SecretFile.__init__
Cite this entry
@misc{vaitp:cve202332303,
title = {{Unauthorized access to Planet API pre-2.0.1}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2023},
note = {VAITP Python Vulnerability Dataset, entry CVE-2023-32303},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2023-32303/}}
}
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 ::
