CVE-2022-21648 Sandbox bypass in Latte templates
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.
| Package | Affected | Fixed in |
|---|---|---|
latte/latte Packagist | From 2.10.0 | 2.10.8 |
latte/latte Packagist | From 2.10.0 | 2.10.8 |
latte/latte Packagist | From 2.8.0 | 2.8.8 |
latte/latte Packagist | From 2.8.0 | 2.8.8 |
latte/latte Packagist | From 2.9.0 | 2.9.6 |
latte/latte Packagist | From 2.9.0 | 2.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.
Other vulnerabilities in nette latte
Sources
Also known as GHSA-36m2-8rhx-f36j, UBUNTU-CVE-2022-21648.