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

Medium 6.1 Published Updated

Attackers can execute arbitrary scripts in victim browsers via reflected XSS in laminas-form error message rendering.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-23598?

CVE-2022-23598 is a medium-severity cross-site scripting vulnerability in Fedoraproject Fedora, published on 28 Jan 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

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.

Weakness: CWE-79

Which versions are affected by CVE-2022-23598?

6 open source packages ship an affected version, including laminas/laminas-form. It affects 2 products.

PackageAffectedFixed in
laminas/laminas-form PackagistAll versions2.17.1
laminas/laminas-form PackagistAll versions2.17.1
laminas/laminas-form PackagistFrom 3.0.03.0.2
laminas/laminas-form PackagistFrom 3.0.03.0.2
laminas/laminas-form PackagistFrom 3.1.03.1.1
laminas/laminas-form PackagistFrom 3.1.03.1.1

Products include Fedoraproject Fedora, Getlaminas Laminas-Form.

How do I fix CVE-2022-23598?

Upgrade laminas/laminas-form to a fixed version for your release line: 2.17.1, 3.0.2 or 3.1.1.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2022-23598 being exploited?

There is no known exploitation of CVE-2022-23598 in the wild and no public exploit code.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as GHSA-jq4p-mq33-w375.

Is CVE-2022-23598 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free