CVE-2024-22199 Django Template Engine Vulnerable to XSS

Critical 9.3 Published Updated

Attackers can execute malicious scripts in users' browsers via XSS in the Go Fiber template engine when autoescape is disabled.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-22199?

CVE-2024-22199 is a critical cross-site scripting vulnerability in gofiber template, published on 11 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

This package provides universal methods to use multiple template engines with the Fiber web framework using the Views interface. This vulnerability specifically impacts web applications that render user-supplied data through this template engine, potentially leading to the execution of malicious scripts in users' browsers when visiting affected web pages. The vulnerability has been addressed, the template engine now defaults to having autoescape set to `true`, effectively mitigating the risk of XSS attacks.

Weakness: CWE-79, CWE-20, CWE-116

Which versions are affected by CVE-2024-22199?

3 open source packages ship an affected version, including github.com/gofiber/template/django/v3. It affects 1 product.

PackageAffectedFixed in
github.com/gofiber/template/django/v3 GoAll versions3.1.9
github.com/gofiber/template/django/v3 GoAll versions3.1.9
github.com/gofiber/template/django/v3 GoAll versions3.1.9

Products include Gofiber Django.

How do I fix CVE-2024-22199?

Upgrade github.com/gofiber/template/django/v3 to 3.1.9 or later.

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-2024-22199 being exploited?

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

Sources

Also known as GHSA-4mq2-gc4j-cmw6, GO-2024-2461.

Is CVE-2024-22199 in your software?

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

Check your SBOMs for free