Vulnerability · Published Jan 28, 2022 · Assigned by GitHub_M
CVE-2022-23598Reflected XSS vulnerability when rendering error messages in laminas-form
Medium 6.1
In plain English
A medium-severity cross-site scripting in laminas-form from laminas. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.0% (higher than 63% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
laminas-form is a package for validating and displaying simple and complex forms. When rendering validation error messages via the `formElementErrors()` view helper shipped with laminas-form, many messages will contain the submitted value. However, in laminas-form prior to version 3.1.1, the value was not being escaped for HTML contexts, which could potentially lead to a reflected cross-site scripting attack. Versions 3.1.1 and above contain a patch to mitigate the vulnerability. A workaround is available. One may manually place code at the top of a view script where one calls the `formElementErrors()` view helper. More information about this workaround is available on the GitHub Security Advisory.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Packagist | laminas/laminas-form | 3.1.1 | GHSA-jq4p-mq33-w375 |
| Packagist | laminas/laminas-form | 3.0.2 | GHSA-jq4p-mq33-w375 |
| Packagist | laminas/laminas-form | 2.17.1 | GHSA-jq4p-mq33-w375 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| laminas | laminas-form | < 3.1.1 |
Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
References
- https://github.com/laminas/laminas-form/security/advisories/GHSA-jq4p-mq33-w375 x_refsource_CONFIRM
- https://github.com/laminas/laminas-form/commit/43005a3ec4c2292d4f825273768d9b884acbca37 x_refsource_MISC
- https://getlaminas.org/security/advisory/LP-2022-01 x_refsource_MISC
- FEDORA-2022-a42e97d8e8 vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-c138fbb8e0 vendor-advisory, x_refsource_FEDORA