VAITP Dataset

← Back to the dataset

CVE-2017-5524

Plone 4.x through 4.3.11 and 5.x through 5.0.6 have remote code execution due to a Python string format method issue

  • CVSS 4.3
  • CWE-134 Use of Externally-Controlled Format String
  • Information Leakage
  • Remote

Plone 4.x through 4.3.11 and 5.x through 5.0.6 allow remote attackers to bypass a sandbox protection mechanism and obtain sensitive information by leveraging the Python string format method.

CVSS base score
4.3
Published
2017-03-23
OWASP
A04 Insecure Design
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Information Leakage
Subcategory
Information Disclosure
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
Python
Fixed by upgrading
Yes

Solution

Update to Plone 4.3.12 or Plone 5.0.7 or higher.

Vulnerable code sample

# Vulnerable code example
def vulnerable_function(user_input):
    # Directly using user input in string formatting
    template = "User  input: {}".format(user_input)
    return template

# Example of a malicious input that could exploit the vulnerability
malicious_input = "__import__('os').popen('cat /etc/passwd').read()"
print(vulnerable_function(malicious_input))

Patched code sample

# Vulnerable code example
def vulnerable_function(user_input):
    template = "User  input: {}".format(user_input)
    return template

# Fixed code example
def safe_function(user_input):
    # Ensure user input is properly sanitized
    sanitized_input = str(user_input).replace("<", "<").replace(">", ">")
    template = "User  input: {}".format(sanitized_input)
    return template

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.

  • Added security checks for str.format. Part of PloneHotfix20170117. (plone/Products.CMFPlone)
    Products/CMFPlone/resources/browser/mixins.py, Products/CMFPlone/resources/browser/mixins.py · LessConfiguration.__call__, Products/CMFPlone/resources/browser/mixins.py · LessModifyConfiguration.__call__, Products/CMFPlone/skins/plone_templates/standard_error_message.py, Products/CMFPlone/utils.py, Products/CMFPlone/__init__.py · initialize

Cite this entry

@misc{vaitp:cve20175524,
  title        = {{Plone 4.x through 4.3.11 and 5.x through 5.0.6 have remote code execution due to a Python string format method issue}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2017},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2017-5524},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2017-5524/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.