VAITP Dataset

← Back to the dataset

CVE-2014-1830

Sensitive Information Exposure in Python Requests

  • CVSS 5.0
  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • Information Leakage
  • Remote

Requests (aka python-requests) before 2.3.0 allows remote servers to obtain sensitive information by reading the Proxy-Authorization header in a redirected request.

CVSS base score
5.0
Published
2014-10-15
OWASP
A05 Security Misconfiguration
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Information Leakage
Subcategory
Insecure Handling of Sensitive Data
Accessibility scope
Remote
Impact
Information Disclosure
Fixed by upgrading
Yes

Solution

Upgrade python-requests to version 2.3.0 or higher.

Vulnerable code sample

import SimpleHTTPServer
import SocketServer

PORT = 8000

Handler = SimpleHTTPServer.SimpleHTTPRequestHandler

httpd = SocketServer.TCPServer(("", PORT), Handler)

print("serving at port", PORT)
httpd.serve_forever()

Patched code sample

import http.server
import os
import socketserver

PORT = 8000

class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
    def translate_path(self, path):
        path = super().translate_path(path)
        root = os.path.abspath(self.directory)
        if not os.path.abspath(path).startswith(root):
            raise Exception("Unauthorized access to {}".format(path))
        return path

Handler = HTTPRequestHandler

with socketserver.TCPServer(("", PORT), Handler) as httpd:
    print("serving at port", PORT)
    httpd.serve_forever()

Cite this entry

@misc{vaitp:cve20141830,
  title        = {{Sensitive Information Exposure in Python Requests}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2014},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2014-1830},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2014-1830/}}
}
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 ::