Find, fix and prevent vulnerabilities in your code.
high severity
new
- Vulnerable module: gevent
- Introduced through: gevent@1.4.0
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › gevent@1.4.0Remediation: Upgrade to gevent@24.10.1.
Overview
Affected versions of this package are vulnerable to Race Condition when the fallback socketpair implementation is used on platforms that lack native support and the vulnerable function does not properly authenticate the connected sockets. An attacker must be able to predict the address and port and establish a connection before the legitimate client.
Remediation
Upgrade gevent
to version 24.10.1 or higher.
References
high severity
- Vulnerable module: flask
- Introduced through: flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3Remediation: Upgrade to flask@2.2.5.
Overview
Affected versions of this package are vulnerable to Information Exposure in the form of exposing the permanent session cookie, when all of the following conditions are met:
The application is hosted behind a caching proxy that does not strip cookies or ignore responses with cookies.
The application sets
session.permanent = True
.The application does not access or modify the session at any point during a request.
SESSION_REFRESH_EACH_REQUEST
is enabled (the default).The application does not set a
Cache-Control
header to indicate that a page is private or should not be cached.
A response containing data intended for one client may be cached and sent to other clients. If the proxy also caches Set-Cookie
headers, it may send one client's session
cookie to other clients. Under these conditions, the Vary: Cookie
header is not set when a session is refreshed (re-sent to update the expiration) without being accessed or modified.
Remediation
Upgrade flask
to version 2.2.5, 2.3.2 or higher.
References
high severity
- Vulnerable module: gevent
- Introduced through: gevent@1.4.0
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › gevent@1.4.0Remediation: Upgrade to gevent@23.9.0.
Overview
Affected versions of this package are vulnerable to Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') when the gevent.pywsgi
function is used. An attacker can craft invalid trailers in chunked requests on keep-alive connections that might appear as two requests to gevent.pywsgi
. This could potentially bypass checks if an upstream server is filtering incoming requests based on paths or header fields and simply passing trailers through without validating them.
Note: If the upstream server validated that the trailers meet the HTTP specification, this could not occur, because characters that are required in an HTTP request, like a space, are not allowed in trailers.
Remediation
Upgrade gevent
to version 23.9.0 or higher.
References
high severity
- Vulnerable module: gunicorn
- Introduced through: gunicorn@20.0.4
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › gunicorn@20.0.4Remediation: Upgrade to gunicorn@22.0.0.
Overview
gunicorn is a Python WSGI HTTP Server for UNIX
Affected versions of this package are vulnerable to HTTP Request Smuggling due to the improper validation of Transfer-Encoding
headers. An attacker can bypass security restrictions and access restricted endpoints by crafting requests with conflicting Transfer-Encoding
headers.
Notes:
This is only exploitable if users have a network path which does not filter out invalid requests;
Users are advised to block access to restricted endpoints via a firewall or other mechanism until a fix can be developed.
This issue arises from the application's incorrectly processing of requests with multiple, conflicting
Transfer-Encoding
headers, treating them as chunked regardless of the final encoding specified.
Remediation
Upgrade gunicorn
to version 22.0.0 or higher.
References
high severity
- Vulnerable module: setuptools
- Introduced through: setuptools@65.5.1, gunicorn@20.0.4 and others
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › setuptools@65.5.1Remediation: Upgrade to setuptools@70.0.0.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › gunicorn@20.0.4 › setuptools@65.5.1Remediation: Upgrade to gunicorn@20.1.0.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › pytest@3.8.1 › setuptools@65.5.1Remediation: Upgrade to pytest@4.6.0.
Overview
Affected versions of this package are vulnerable to Improper Control of Generation of Code ('Code Injection') through the package_index
module's download functions due to the unsafe usage of os.system
. An attacker can execute arbitrary commands on the system by providing malicious URLs or manipulating the URLs retrieved from package index servers.
Note
Because easy_install
and package_index
are deprecated, the exploitation surface is reduced, but it's conceivable through social engineering or minor compromise to a package index could grant remote access.
Remediation
Upgrade setuptools
to version 70.0.0 or higher.
References
high severity
- Vulnerable module: werkzeug
- Introduced through: werkzeug@2.2.3 and flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › werkzeug@2.2.3Remediation: Upgrade to werkzeug@3.0.3.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › werkzeug@2.2.3Remediation: Upgrade to flask@2.2.3.
Overview
Affected versions of this package are vulnerable to Remote Code Execution (RCE) due to insufficient hostname checks and the use of relative paths to resolve requests. When the debugger is enabled, an attacker can convince a user to enter their own PIN to interact with a domain and subdomain they control, and thereby cause malicious code to be executed.
The demonstrated attack vector requires a number of conditions that render this attack very difficult to achieve, especially if the victim application is running in the recommended configuration of not having the debugger enabled in production.
Remediation
Upgrade werkzeug
to version 3.0.3 or higher.
References
high severity
- Module: patrowlenginesutils
- Introduced through: patrowlenginesutils@1.2.1
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › patrowlenginesutils@1.2.1
AGPL-3.0 license
medium severity
new
- Vulnerable module: werkzeug
- Introduced through: werkzeug@2.2.3 and flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › werkzeug@2.2.3Remediation: Upgrade to werkzeug@3.0.6.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › werkzeug@2.2.3Remediation: Upgrade to flask@2.2.3.
Overview
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in formparser.MultiPartParser()
. An attacker can cause the parser to consume more memory than the upload size, in excess of max_form_memory_size
, by sending malicious data in a non-file field of a multipart/form-data
request.
Remediation
Upgrade werkzeug
to version 3.0.6 or higher.
References
medium severity
- Vulnerable module: zipp
- Introduced through: click@8.1.7 and flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › click@8.1.7 › importlib-metadata@6.7.0 › zipp@3.15.0
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › importlib-metadata@6.7.0 › zipp@3.15.0Remediation: Upgrade to flask@2.3.3.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › click@8.1.7 › importlib-metadata@6.7.0 › zipp@3.15.0
Overview
Affected versions of this package are vulnerable to Infinite loop where an attacker can cause the application to stop responding by initiating a loop through functions affecting the Path
module, such as joinpath
, the overloaded division operator, and iterdir
.
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
ws
package
Remediation
Upgrade zipp
to version 3.19.1 or higher.
References
medium severity
- Vulnerable module: werkzeug
- Introduced through: werkzeug@2.2.3 and flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › werkzeug@2.2.3Remediation: Upgrade to werkzeug@2.3.8.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › werkzeug@2.2.3Remediation: Upgrade to flask@2.2.3.
Overview
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in multipart data parsing. An attacker can cause a denial of service and block worker processes from handling legitimate requests by sending crafted multipart data to an endpoint that will parse it, eventually exhausting or killing all available workers.
Exploiting this vulnerability is possible if the uploaded file starts with CR
or LF
and is followed by megabytes of data without these characters.
Remediation
Upgrade werkzeug
to version 2.3.8, 3.0.1 or higher.
References
medium severity
new
- Vulnerable module: werkzeug
- Introduced through: werkzeug@2.2.3 and flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › werkzeug@2.2.3Remediation: Upgrade to werkzeug@3.0.6.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › werkzeug@2.2.3Remediation: Upgrade to flask@2.2.3.
Overview
Werkzeug is a WSGI web application library.
Affected versions of this package are vulnerable to Directory Traversal due to a bypass for os.path.isabs()
, which allows the improper handling of UNC paths beginning with /
, in the safe_join()
function. This allows an attacker to read some files on the affected server, if they are stored in an affected path.
Note: This is only exploitable on Windows systems using Python versions prior to 3.11.
Details
A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.
Directory Traversal vulnerabilities can be generally divided into two types:
- Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.
st
is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public
route.
If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.
curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa
Note %2e
is the URL encoded version of .
(dot).
- Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as
Zip-Slip
.
One way to achieve this is by using a malicious zip
archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.
The following is an example of a zip
archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/
overwriting the authorized_keys
file:
2018-04-15 22:04:29 ..... 19 19 good.txt
2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys
Remediation
Upgrade Werkzeug
to version 3.0.6 or higher.
References
medium severity
- Vulnerable module: idna
- Introduced through: idna@2.5 and requests@2.28.2
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › idna@2.5Remediation: Upgrade to idna@3.7.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › requests@2.28.2 › idna@2.5Remediation: Upgrade to requests@2.32.0.
Overview
Affected versions of this package are vulnerable to Resource Exhaustion via the idna.encode
function. An attacker can consume significant resources and potentially cause a denial-of-service by supplying specially crafted arguments to this function.
Note: This is triggered by arbitrarily large inputs that would not occur in normal usage but may be passed to the library assuming there is no preliminary input validation by the higher-level application.
Remediation
Upgrade idna
to version 3.7 or higher.
References
medium severity
- Vulnerable module: requests
- Introduced through: requests@2.28.2
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › requests@2.28.2Remediation: Upgrade to requests@2.31.0.
Overview
Affected versions of this package are vulnerable to Information Exposure by leaking Proxy-Authorization
headers to destination servers during redirects to an HTTPS origin. This is a result of how rebuild_proxies
is used to recompute and reattach the Proxy-Authorization
header to requests when redirected.
NOTE: This behavior has only been observed to affect proxied requests when credentials are supplied in the URL user information component (e.g. https://username:password@proxy:8080
), and only when redirecting to HTTPS:
HTTP → HTTPS: leak
HTTPS → HTTP: no leak
HTTPS → HTTPS: leak
HTTP → HTTP: no leak
For HTTP connections sent through the proxy, the proxy will identify the header in the request and remove it prior to forwarding to the destination server. However when sent over HTTPS, the Proxy-Authorization
header must be sent in the CONNECT
request as the proxy has no visibility into further tunneled requests. This results in Requests forwarding the header to the destination server unintentionally, allowing a malicious actor to potentially exfiltrate those credentials.
Workaround
This vulnerability can be avoided by setting allow_redirects
to False
on all calls through Requests top-level APIs, and then capturing the 3xx response codes to make a new request to the redirect destination.
Remediation
Upgrade requests
to version 2.31.0 or higher.
References
medium severity
- Vulnerable module: urllib3
- Introduced through: urllib3@1.26.5 and requests@2.28.2
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › urllib3@1.26.5Remediation: Upgrade to urllib3@1.26.19.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › requests@2.28.2 › urllib3@1.26.5Remediation: Upgrade to requests@2.32.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-Authorization
header 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-Authorization
header with urllib3'sProxyManager
.Disabling HTTP redirects using
redirects=False
when sending requests.Not using the
Proxy-Authorization
header.
Remediation
Upgrade urllib3
to version 1.26.19, 2.2.2 or higher.
References
medium severity
- Vulnerable module: urllib3
- Introduced through: urllib3@1.26.5 and requests@2.28.2
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › urllib3@1.26.5Remediation: Upgrade to urllib3@1.26.17.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › requests@2.28.2 › urllib3@1.26.5Remediation: Upgrade to requests@2.32.0.
Overview
urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.
Affected versions of this package are vulnerable to Information Exposure Through Sent Data when the Cookie
HTTP header is used. An attacker can leak information via HTTP redirects to a different origin by exploiting the fact that the Cookie
HTTP header isn't stripped on cross-origin redirects.
Note:
This is only exploitable if the user is using the Cookie
header on requests, not disabling HTTP redirects, and either not using HTTPS or for the origin server to redirect to a malicious origin.
##Workaround:
This vulnerability can be mitigated by disabling HTTP redirects using redirects=False
when sending requests and by not using the Cookie
header.
Remediation
Upgrade urllib3
to version 1.26.17, 2.0.6 or higher.
References
medium severity
- Vulnerable module: requests
- Introduced through: requests@2.28.2
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › requests@2.28.2Remediation: Upgrade to requests@2.32.2.
Overview
Affected versions of this package are vulnerable to Always-Incorrect Control Flow Implementation when making requests through a Requests Session
. An attacker can bypass certificate verification by making the first request with verify=False
, causing all subsequent requests to ignore certificate verification regardless of changes to the verify
value.
Notes:
For requests <2.32.0, avoid setting
verify=False
for the first request to a host while using a Requests Session.For requests <2.32.0, call
close()
on Session objects to clear existing connections ifverify=False
is used.This vulnerability was initially fixed in version 2.32.0, which was yanked. Therefore, the next available fixed version is 2.32.2.
Remediation
Upgrade requests
to version 2.32.2 or higher.
References
medium severity
- Vulnerable module: jinja2
- Introduced through: jinja2@3.1.2 and flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › jinja2@3.1.2Remediation: Upgrade to jinja2@3.1.3.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › jinja2@3.1.2Remediation: Upgrade to flask@2.2.3.
Overview
Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the xmlattr
filter, when using keys containing spaces in an application accepts keys as user input. An attacker can inject arbitrary HTML attributes into the rendered HTML template, bypassing the auto-escaping mechanism, which may lead to the execution of untrusted scripts in the context of the user's browser session.
Note
Accepting keys as user input is not common or a particularly intended use case of the xmlattr
filter, and an application doing so should already be verifying what keys are provided regardless of this fix.
Details
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, <
can be coded as <
; and >
can be coded as >
; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses <
and >
as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
Types of attacks
There are a few methods by which XSS can be manipulated:
Type | Origin | Description |
---|---|---|
Stored | Server | The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
Reflected | Server | The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
DOM-based | Client | The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
Mutated | The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
Affected environments
The following environments are susceptible to an XSS attack:
- Web servers
- Application servers
- Web application environments
How to prevent
This section describes the top best practices designed to specifically protect your code:
- Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
- Convert special characters such as
?
,&
,/
,<
,>
and spaces to their respective HTML or URL encoded equivalents. - Give users the option to disable client-side scripts.
- Redirect invalid requests.
- Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
- Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
- Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
Remediation
Upgrade Jinja2
to version 3.1.3 or higher.
References
medium severity
- Vulnerable module: jinja2
- Introduced through: jinja2@3.1.2 and flask@2.2.3
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › jinja2@3.1.2Remediation: Upgrade to jinja2@3.1.4.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › flask@2.2.3 › jinja2@3.1.2Remediation: Upgrade to flask@2.2.3.
Overview
Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) through the xmlattr
filter. An attacker can manipulate the output of web pages by injecting additional attributes into elements, potentially leading to unauthorized actions or information disclosure.
Note: This vulnerability derives from an improper fix of CVE-2024-22195, which only addressed spaces but not other characters.
Details
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, <
can be coded as <
; and >
can be coded as >
; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses <
and >
as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
Types of attacks
There are a few methods by which XSS can be manipulated:
Type | Origin | Description |
---|---|---|
Stored | Server | The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
Reflected | Server | The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
DOM-based | Client | The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
Mutated | The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
Affected environments
The following environments are susceptible to an XSS attack:
- Web servers
- Application servers
- Web application environments
How to prevent
This section describes the top best practices designed to specifically protect your code:
- Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
- Convert special characters such as
?
,&
,/
,<
,>
and spaces to their respective HTML or URL encoded equivalents. - Give users the option to disable client-side scripts.
- Redirect invalid requests.
- Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
- Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
- Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
Remediation
Upgrade Jinja2
to version 3.1.4 or higher.
References
medium severity
- Vulnerable module: urllib3
- Introduced through: urllib3@1.26.5 and requests@2.28.2
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › urllib3@1.26.5Remediation: Upgrade to urllib3@1.26.18.
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › requests@2.28.2 › urllib3@1.26.5Remediation: Upgrade to requests@2.32.0.
Overview
urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.
Affected versions of this package are vulnerable to Information Exposure Through Sent Data when it processes HTTP redirects with a 303 status code, due to not stripping the request body when changing the request method from POST
to GET
. An attacker can potentially expose sensitive information by compromising the origin service and redirecting requests to a malicious peer.
Note:
This is only exploitable if sensitive information is being submitted in the HTTP request body and the origin service is compromised, starting to redirect using 303 to a malicious peer or the redirected-to service becomes compromised.
Workaround
This vulnerability can be mitigated by disabling redirects for services that are not expected to respond with redirects, or disabling automatic redirects and manually handling 303 redirects by stripping the HTTP request body.
Remediation
Upgrade urllib3
to version 1.26.18, 2.0.7 or higher.
References
medium severity
- Module: certifi
- Introduced through: certifi@2024.8.30 and requests@2.28.2
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › certifi@2024.8.30
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › requests@2.28.2 › certifi@2024.8.30
MPL-2.0 license
medium severity
- Module: chardet
- Introduced through: chardet@3.0.4
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › chardet@3.0.4
LGPL-2.1 license
low severity
- Vulnerable module: gunicorn
- Introduced through: gunicorn@20.0.4
Detailed paths
-
Introduced through: Patrowl/PatrowlEngines@Patrowl/PatrowlEngines#ff378eaef199de1945d5ca0f2da9348f24da956f › gunicorn@20.0.4Remediation: Upgrade to gunicorn@21.2.0.
Overview
gunicorn is a Python WSGI HTTP Server for UNIX
Affected versions of this package are vulnerable to Improper Check for Unusual or Exceptional Conditions due to the use of time.time()
in worker timeout logic, which may be wrong. An attacker who can control the system time can force a worker to time out.
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
ws
package
Remediation
Upgrade gunicorn
to version 21.2.0 or higher.