GHSA-4mq2-gc4j-cmw6

Suggest an improvement
Source
https://github.com/advisories/GHSA-4mq2-gc4j-cmw6
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/01/GHSA-4mq2-gc4j-cmw6/GHSA-4mq2-gc4j-cmw6.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-4mq2-gc4j-cmw6
Aliases
Related
Published
2024-01-11T16:41:42Z
Modified
2024-01-17T19:26:28.446920Z
Severity
  • 9.3 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N CVSS Calculator
Summary
Django Template Engine Vulnerable to XSS
Details

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:

{% 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/
Database specific
{
    "nvd_published_at": "2024-01-11T18:15:45Z",
    "cwe_ids": [
        "CWE-116",
        "CWE-20",
        "CWE-79"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2024-01-11T16:41:42Z"
}
References

Affected packages

Go / github.com/gofiber/template/django/v3

Package

Name
github.com/gofiber/template/django/v3
View open source insights on deps.dev
Purl
pkg:golang/github.com/gofiber/template/django/v3

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.1.9