CVE-2022-28108: Selenium Package CSRF Vulnerability in Selenium Server (Grid) Prior to Version 4
Summary
CVE-2022-28108: Selenium Server (Grid) before 4 allows CSRF because it permits non-JSON content types such as application/x-www-form-urlencoded, multipart/form-data, and text/plain. Affects selenium versions < 4.0.0. Fixed in 4.0.0. How to fix ↓
Also tracked for
The same CVE-2022-28108 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Selenium is a widely used open-source framework that allows developers to automate web applications for testing purposes. It supports various programming languages, including Python, and provides tools for controlling web browsers programmatically. The Selenium Server (Grid) component enables the distribution of tests across multiple machines, enhancing testing efficiency. However, prior to version 4, it was found to be vulnerable to Cross-Site Request Forgery (CSRF) attacks due to its acceptance of non-JSON content types, which could be exploited by malicious actors.
Vulnerability Detail
The vulnerability arises from the Selenium Server (Grid) allowing non-JSON content types such as application/x-www-form-urlencoded, multipart/form-data, and text/plain. This permissiveness can lead to CSRF attacks, where an attacker tricks a user into executing unwanted actions on a web application in which they are authenticated. The ramifications include unauthorized actions being performed on behalf of the user, potentially compromising sensitive data and application integrity. The vulnerability is classified with a CVSS score of 8.8, indicating a high severity level.
How To Fix
Latest published version: 4.51.0 as of 23 Oct 2026
pip install --upgrade "selenium==4.51.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
4.0.0
This is the first release that contains the fix.
pip install --upgrade "selenium==4.0.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can implement CSRF protection mechanisms in your application to mitigate the risk. This may include validating the origin of requests and ensuring that state-changing requests require a valid CSRF token.
Conclusion
In summary, CVE-2022-28108 represents a significant CSRF vulnerability in the Selenium Server (Grid) prior to version 4. It is crucial for users to update their Selenium packages to version 4.0.0 or later to mitigate the risk of exploitation. Additionally, implementing CSRF protection mechanisms can further enhance security.
See every vulnerability recorded for selenium →
FAQ
CVE-2022-28108 is a vulnerability in the Selenium Server (Grid) that allows CSRF attacks due to the acceptance of non-JSON content types.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
The potential impacts include unauthorized actions being performed on behalf of authenticated users, which can compromise sensitive data and application integrity.
Yes, the vulnerability has been patched in Selenium version 4.0.0 and later. Updating to this version will resolve the issue.
The CVSS score of this vulnerability is 8.8, indicating a high severity level.
Related vulnerabilities
Recent vulnerabilities recorded for selenium.