CVE-2024-22199: Django Template Engine Vulnerable to XSS

Published Jan 11, 2024
·
Updated

Impact

Vulnerability Type: Cross-Site Scripting (XSS) Affected Users: All users of the Django template engine for Fiber prior to the patch. 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.

Patches

The vulnerability has been addressed. The template engine now defaults to having autoescape set to true, effectively mitigating the risk of XSS attacks. Users are advised to upgrade to the latest version of the Django template engine for Fiber, where this security update is implemented. Ensure that the version of the template engine being used is the latest, post-patch version.

Workarounds

For users unable to upgrade immediately to the patched version, a workaround involves manually implementing autoescaping within individual Django templates. This method includes adding specific tags in the template to control autoescape behavior: django {% autoescape on %} {{ "<script>alert('xss');</script>" }} {% endautoescape %}

References

- Official documentation of the Django template engine for Fiber: https://docs.gofiber.io/template/django/ - Django built-in template tags: https://docs.djangoproject.com/en/5.0/ref/templates/builtins/

Other sources

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.

NVD

Affected Software

2 affected componentsFixes available
go/github.com/gofiber/template/django/v3<3.1.9
3.1.9
gofiber Django Go<3.1.9

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/gofiber/template/django/v3 to a version that resolves this vulnerability.

    Fixed in 3.1.9
  2. Configuration

    Ensure autoescaping is enabled in Django templates. If upgrading is not immediately possible, manually implement autoescaping by adding `{% autoescape on %}` / `{% endautoescape %}` blocks around sections rendering user-supplied data (example provided: `{% autoescape on %} ... {% endautoescape %}`), and avoid rendering unescaped user input.

    Fiber Django template engine autoescape = true

Event History

Jan 11, 2024
Advisory Published
via GitHub·04:41 PM
CVE Published
via MITRE·05:39 PM
Data Sourced
via MITRE·05:39 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-22199?

The severity of CVE-2024-22199 is classified as high due to its potential for Cross-Site Scripting (XSS) attacks.

2

How do I fix CVE-2024-22199?

To fix CVE-2024-22199, upgrade the affected Django template engine to version 3.1.9 or later.

3

Who is affected by CVE-2024-22199?

All users of the Django template engine for Fiber prior to version 3.1.9 are affected by CVE-2024-22199.

4

What type of vulnerability is CVE-2024-22199?

CVE-2024-22199 is classified as a Cross-Site Scripting (XSS) vulnerability.

5

What software is affected by CVE-2024-22199?

CVE-2024-22199 affects the Gofiber Django package versions prior to 3.1.9.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203