CVE-2024-22199: Github.com/gofiber/template/django/v3 Cross-Site Scripting Vulnerability
CRITICALCVE-2024-22199 is a CRITICAL (CVSS 9.3) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Github.com/gofiber/template/django/v3 libraries in the Go ecosystem. The issue involves django template engine vulnerable to xss. Remediation is available by upgrading affected packages to version 3.1.9.
CVE-2024-22199 at a Glance
Security Impact
CVSS: 9.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N).
How to Fix CVE-2024-22199
To remediate this vulnerability, upgrade all affected Github.com/gofiber/template/django/v3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/gofiber/template/django/v3 to 3.1.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/gofiber/template/django/v3
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-22199, inspect your project dependencies for Github.com/gofiber/template/django/v3:
inspect dependencies for github.com/gofiber/template/django/v3
Analyze the terminal output to locate any version of Github.com/gofiber/template/django/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.9), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Github.com/gofiber/template/django/v3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-22199 Affected Github.com/gofiber/template/django/v3 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/gofiber/template/django/v3
|
Go |
< 3.1.9
|
3.1.9
|
References
Frequently Asked Questions
What is CVE-2024-22199?
Which Github.com/gofiber/template/django/v3 versions are affected?
What version fixes CVE-2024-22199?
Is github.com/gofiber/template/django/v3 affected?
What is the CVSS score of CVE-2024-22199?
What CWE is associated with CVE-2024-22199?
How can I check Go dependencies for CVE-2024-22199?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4mq2-gc4j-cmw6",
"modified" : "2024-01-11T19:00:53Z",
"published" : "2024-01-11T16:41:42Z",
"aliases" : [ "CVE-2024-22199" ],
"summary" : "Django Template Engine Vulnerable to XSS",
"details" : "### Impact\n\n**Vulnerability Type:** Cross-Site Scripting (XSS) \n**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.\n\n### Patches\n\nThe 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.\n\n### Workarounds\n\nFor 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:\n```django\n{% autoescape on %}\n{{ \"<script>alert('xss');</script>\" }}\n{% endautoescape %}\n```\n\n### References\n\n- Official documentation of the Django template engine for Fiber: https://docs.gofiber.io/template/django/\n- Django built-in template tags: https://docs.djangoproject.com/en/5.0/ref/templates/builtins/\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/gofiber/template/django/v3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.9"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/gofiber/template/security/advisories/GHSA-4mq2-gc4j-cmw6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22199"
}, {
"type" : "WEB",
"url" : "https://github.com/gofiber/template/commit/28cff3ac4d4c117ab25b5396954676d624b6cb46"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gofiber/template"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-20", "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-11T16:41:42Z",
"nvd_published_at" : "2024-01-11T18:15:45Z"
}
}