Medium, CVSS 6.1PackagistPublished
Cross-site Scripting when rendering error messages in laminas-form
CVE-2022-23598 · GHSA-jq4p-mq33-w375
- Affected
- Packagist laminas/laminas-form >= 3.1.0, < 3.1.1; >= 3.0.0, < 3.0.2; < 2.17.1
- Fixed in
- 3.0.23.1.12.17.1· Vendor fix available
- Issue
- Impact When rendering validation error messages via the formElementErrors() view helper shipped with laminas-form, many messages will contain the submitted value. However, in vulnerable versions of laminas-form, the value was not being escaped for HTML contexts, which can potentially lead to a Reflected Cross-Site Scripting (XSS) attack. Patches The following versions were issued to mitigate the vulnerability: - 2.17.1 - 3.0.2 - 3.1.1 Workarounds At the top of a view script where you call the formElementErrors() view helper, place the following code: Before calling formElementErrors() with a form, fieldset, or element, call the above closure as follows For more information If you have any questions or comments about this advisory: Open an issue Email us at security@getlaminas.org
Recommended action: Upgrade to 3.1.1, 3.0.2 or 2.17.1 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.