CVE-2022-21648 Sandbox bypass in Latte templates

High 8.2 Published Updated

A sandbox bypass in the Latte PHP template engine allows attackers to inject malicious scripts, leading to cross-site scripting attacks.

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-21648?

CVE-2022-21648 is a high-severity cross-site scripting vulnerability in nette latte, published on 4 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

Latte is an open source template engine for PHP. Versions since 2.8.0 Latte has included a template sandbox and in affected versions it has been found that a sandbox escape exists allowing for injection into web pages generated from Latte. This may lead to XSS attacks. The issue is fixed in the versions 2.8.8, 2.9.6 and 2.10.8. Users unable to upgrade should not accept template input from untrusted sources.

Weakness: CWE-79

Which versions are affected by CVE-2022-21648?

6 open source packages ship an affected version, including latte/latte. It affects 1 product.

PackageAffectedFixed in
latte/latte PackagistFrom 2.10.02.10.8
latte/latte PackagistFrom 2.10.02.10.8
latte/latte PackagistFrom 2.8.02.8.8
latte/latte PackagistFrom 2.8.02.8.8
latte/latte PackagistFrom 2.9.02.9.6
latte/latte PackagistFrom 2.9.02.9.6

Products include Nette Latte.

How do I fix CVE-2022-21648?

Upgrade latte/latte to a fixed version for your release line: 2.10.8, 2.8.8 or 2.9.6.

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-21648 being exploited?

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

Sources

Also known as GHSA-36m2-8rhx-f36j, UBUNTU-CVE-2022-21648.

Is CVE-2022-21648 in your software?

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

Check your SBOMs for free