CVE-2021-23447: Teddy Cross-Site Scripting Vulnerability
MODERATECVE-2021-23447 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Teddy libraries in the npm ecosystem. The issue involves cross-site scripting in teddy. Remediation is available by upgrading affected packages to version 0.5.9.
CVE-2021-23447 at a Glance
Security Impact
CVSS: 5.4
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:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2021-23447
To remediate this vulnerability, upgrade all affected Teddy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install teddy@0.5.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls teddy
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-23447, inspect your project dependencies using npm:
npm ls teddy
Analyze the terminal output to locate any version of Teddy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.9), your application is affected.
Note: The npm ls teddy command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Teddy, 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-2021-23447 Affected Teddy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
teddy
|
npm |
< 0.5.9
|
0.5.9
|
References
Frequently Asked Questions
What is CVE-2021-23447?
Which Teddy versions are affected?
What version fixes CVE-2021-23447?
Is teddy affected?
What is the CVSS score of CVE-2021-23447?
What CWE is associated with CVE-2021-23447?
How can I check npm dependencies for CVE-2021-23447?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5f38-9jw2-6r6h",
"modified" : "2022-05-04T03:42:48Z",
"published" : "2021-10-12T16:22:04Z",
"aliases" : [ "CVE-2021-23447" ],
"summary" : "Cross-site Scripting in teddy",
"details" : "Teddy is a readable and easy to learn templating language. This affects the package teddy before 0.5.9. A type confusion vulnerability can be used to bypass input sanitization when the model content is an array (instead of a string).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "teddy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.9"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23447"
}, {
"type" : "WEB",
"url" : "https://github.com/rooseveltframework/teddy/pull/518"
}, {
"type" : "WEB",
"url" : "https://github.com/rooseveltframework/teddy/commit/64c556717b4879bf8d4c30067cf6e70d899a3dc0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rooseveltframework/teddy"
}, {
"type" : "WEB",
"url" : "https://github.com/rooseveltframework/teddy/releases/tag/0.5.9"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-TEDDY-1579557"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-843" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-10-08T21:52:26Z",
"nvd_published_at" : "2021-10-07T17:15:00Z"
}
}