Cross-site Scripting Vulnerability in silverstripe/framework
Summary
GHSA-468j-6jrc-2rjx: silverstripe/framework vulnerable to Cross-site Scripting In OptionsetField and CheckboxSetField. Affects silverstripe/framework across 4 version ranges.
>= 3.1.19-rc1, < 3.1.20
>= 3.2.4-rc1, < 3.2.5
>= 3.3.2-rc1, < 3.3.3
>= 3.4.0-rc1, < 3.4.1
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
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
silverstripe/framework is an open-source PHP framework used for building websites and web applications. It provides a range of features and functionalities to developers, including a variety of form fields. However, the framework is vulnerable to a cross-site scripting (XSS) attack in the OptionsetField and CheckboxSetField components.
Vulnerability Detail
The vulnerability arises from the fact that the key/value pairs assigned to OptionsetField or CheckboxSetField do not have a default casting assigned to them. This lack of casting allows for potential XSS attacks when the lists contain unescaped HTML in either the key or value. An attacker can exploit this vulnerability to inject malicious scripts or code into the application, potentially leading to unauthorized access, data theft, or other malicious activities.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 3.1.19-rc1, < 3.1.203.1.20composer require silverstripe/framework:3.1.20 -
>= 3.2.4-rc1, < 3.2.53.2.5composer require silverstripe/framework:3.2.5 -
>= 3.3.2-rc1, < 3.3.33.3.3composer require silverstripe/framework:3.3.3 -
>= 3.4.0-rc1, < 3.4.13.4.1composer require silverstripe/framework:3.4.1
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
A possible workaround for this vulnerability is to manually sanitize or escape the key/value pairs before assigning them to OptionsetField or CheckboxSetField. This can be done by using functions like htmlspecialchars or htmlentities to encode special characters. However, it is strongly advised to apply the official fix by updating the package to the fixed versions.
Conclusion
The silverstripe/framework package is vulnerable to a cross-site scripting (XSS) attack in the OptionsetField and CheckboxSetField components. This vulnerability can be exploited by injecting malicious scripts or code into the application, potentially leading to unauthorized access, data theft, or other malicious activities. To mitigate this vulnerability, developers should ensure proper sanitization or escaping of key/value pairs and update the package to the fixed versions. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for silverstripe/framework →
FAQ
silverstripe/framework is an open-source PHP framework used for building websites and web applications. It provides a range of features and functionalities to developers.
Cross-site scripting (XSS) is a type of security vulnerability where an attacker injects malicious scripts or code into a trusted website or web application. This can lead to unauthorized access, data theft, or other malicious activities.
The vulnerability in silverstripe/framework allows for potential XSS attacks in OptionsetField and CheckboxSetField components. This can enable attackers to inject malicious scripts or code into the application, potentially leading to unauthorized access, data theft, or other malicious activities.
Developers can fix this vulnerability by ensuring that all key/value pairs assigned to OptionsetField or CheckboxSetField are properly escaped or sanitized. This can be achieved by using appropriate encoding functions or HTML escaping techniques. It is also recommended to update the silverstripe/framework package to the fixed versions.
A possible workaround for this vulnerability is to manually sanitize or escape the key/value pairs before assigning them to OptionsetField or CheckboxSetField. This can be done by using functions like htmlspecialchars or htmlentities to encode special characters. However, it is strongly advised to apply the official fix by updating the package to the fixed versions.
References
Related vulnerabilities
Recent vulnerabilities recorded for silverstripe/framework.