CVE-2019-0221 Cross-site scripting in Apache Tomcat

Medium 6.1 Published Updated

Cross-site scripting vulnerability in Apache Tomcat SSI printenv command allows attackers to execute arbitrary scripts if SSI is enabled.

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-2019-0221?

CVE-2019-0221 is a medium-severity cross-site scripting vulnerability in Apache Tomcat, published on 28 May 2019. 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

The SSI printenv command in Apache Tomcat 9.0.0.M1 to 9.0.0.17, 8.5.0 to 8.5.39 and 7.0.0 to 7.0.93 echoes user provided data without escaping and is, therefore, vulnerable to XSS. SSI is disabled by default. The printenv command is intended for debugging and is unlikely to be present in a production website.

Weakness: CWE-79

Which versions are affected by CVE-2019-0221?

18 open source packages ship an affected version, including org.apache.tomcat.embed:tomcat-embed-core, org.apache.tomcat:tomcat and org.apache.tomcat:tomcat-catalina. It affects 1 product.

PackageAffectedFixed in
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 7.0.07.0.94
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 7.0.07.0.94
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 8.5.08.5.40
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 8.5.08.5.40
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 9.0.09.0.17
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 9.0.09.0.17
12 more packages
org.apache.tomcat:tomcat MavenFrom 7.0.07.0.94
org.apache.tomcat:tomcat MavenFrom 7.0.07.0.94
org.apache.tomcat:tomcat MavenFrom 8.5.08.5.40
org.apache.tomcat:tomcat MavenFrom 8.5.08.5.40
org.apache.tomcat:tomcat MavenFrom 9.0.09.0.17
org.apache.tomcat:tomcat MavenFrom 9.0.09.0.17
org.apache.tomcat:tomcat-catalina MavenFrom 7.0.07.0.94
org.apache.tomcat:tomcat-catalina MavenFrom 7.0.07.0.94
org.apache.tomcat:tomcat-catalina MavenFrom 8.5.08.5.40
org.apache.tomcat:tomcat-catalina MavenFrom 8.5.08.5.40
org.apache.tomcat:tomcat-catalina MavenFrom 9.0.09.0.17
org.apache.tomcat:tomcat-catalina MavenFrom 9.0.09.0.17

Products include Apache Tomcat.

How do I fix CVE-2019-0221?

Upgrade org.apache.tomcat.embed:tomcat-embed-core to a fixed version for your release line: 7.0.94, 8.5.40 or 9.0.17.

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-2019-0221 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2019-0221 exists.

Public exploit code: 1 Exploit-DB entry and 1 Nuclei template.

All Apache Tomcat vulnerabilities

Sources

Also known as CLSA-2022-1670606563, DEBIAN-CVE-2019-0221, DLA-1810-1, GHSA-jjpq-gp5q-8q6w, UBUNTU-CVE-2019-0221.

Is CVE-2019-0221 in your software?

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

Check your SBOMs for free