CVE-2012-5578
Insecure permissions in Python keyring
- CVSS 6.2
- CWE-276: Incorrect Default Permissions
- Design Defects
- Local
Python keyring has insecure permissions on new databases allowing world-readable files to be created
- CVSS base score
- 6.2
- Published
- 2019-11-25
- OWASP
- A05 Security Misconfiguration
- Orthogonal defect classification
- Assignment
- Code defect classification
- Incorrect Assignment
- Category
- Design Defects
- Subcategory
- Security Misconfigurations
- Accessibility scope
- Local
- Impact
- Information Disclosure
- Fixed by upgrading
- Yes
Solution
Ensure that the permissions on Python keyring databases are set correctly to prevent world-readable files. Update Python keyring to the latest secure version.
Vulnerable code sample
from lxml import etree
def parse_xml(xml_data):
parser = etree.XMLParser()
tree = etree.fromstring(xml_data, parser)
print(tree.tag)
xml_data = """
<!DOCTYPE root [
<!ENTITY read SYSTEM "file:///etc/passwd">
]>
<root>&read;</root>
"""
parse_xml(xml_data)Patched code sample
from lxml import etree
def parse_xml(xml_data):
parser = etree.XMLParser(no_network=True, resolve_entities=False)
tree = etree.fromstring(xml_data, parser)
print(tree.tag)
xml_data = """
<!DOCTYPE root [
<!ENTITY read SYSTEM "file:///etc/passwd">
]>
<root>&read;</root>
"""
parse_xml(xml_data)Cite this entry
@misc{vaitp:cve20125578,
title = {{Insecure permissions in Python keyring}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2019},
note = {VAITP Python Vulnerability Dataset, entry CVE-2012-5578},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2012-5578/}}
}
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 ::
