VAITP Dataset

← Back to the dataset

CVE-2020-28735

Plone < 5.2.3 SSRF via Manager tracebacks

  • CVSS 8.8
  • CWE-918 Server-Side Request Forgery (SSRF)
  • Configuration Issues
  • Remote

Plone before 5.2.3 allows SSRF attacks via the tracebacks feature (only available to the Manager role).

CVSS base score
8.8
Published
2020-12-30
OWASP
A10 Server-Side Request Forgery (SSRF)
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Configuration Issues
Subcategory
Server-Side Request Forgery (SSRF)
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Plone
Fixed by upgrading
Yes

Solution

Update to Plone version 5.2.3 or higher.

Vulnerable code sample

from plone.dexterity.content import Container

class VulnerableTraceback(Container):
    def get_traceback(self, request):
        # Check if the user has the Manager role
        if request.authenticated_user.has_role('Manager'):
            # Directly process the URL provided in the request
            url = request.get('url', '')
            # Potentially unsafe request to external URLs
            response = self.make_request_to_url(url)
            return response
        else:
            raise PermissionError("You do not have permission to view tracebacks.")

    def make_request_to_url(self, url):
        import requests
        # This could lead to SSRF if the URL is external
        return requests.get(url).text

Patched code sample

from plone.dexterity.content import Container
from plone import api
from urllib.parse import urlparse

class SecureTraceback(Container):
    def get_traceback(self, request):
        # Ensure the user has the Manager role
        if api.user.has_permission('Manage portal', obj=self):
            # Limit the request to local URLs to prevent SSRF
            url = request.get('url', '')
            parsed_url = urlparse(url)

            if parsed_url.scheme in ['http', 'https'] and parsed_url.netloc in ['localhost', '127.0.0.1']:
                # Process the request and return the traceback
                return super().get_traceback(request)
            else:
                raise ValueError("Invalid URL: Only local URLs are allowed.")
        else:
            raise PermissionError("You do not have permission to view tracebacks.")

Cite this entry

@misc{vaitp:cve202028735,
  title        = {{Plone < 5.2.3 SSRF via Manager tracebacks}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2020},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2020-28735},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2020-28735/}}
}

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.