GHSA-9r27-994c-4xch: Discord markdown Discord-html Not Escaping HTML Code Vulnerability
HIGHGHSA-9r27-994c-4xch is a HIGH discord-html not escaping html code vulnerability (General Security Weakness) affecting Discord markdown libraries in the npm ecosystem. The issue involves discord-html not escaping html code blocks when lacking a language identifier. Remediation is available by upgrading affected packages to version 2.3.1.
GHSA-9r27-994c-4xch at a Glance
How to Fix GHSA-9r27-994c-4xch
To remediate this vulnerability, upgrade all affected Discord markdown 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 discord-markdown@2.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls discord-markdown
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-9r27-994c-4xch, inspect your project dependencies using npm:
npm ls discord-markdown
Analyze the terminal output to locate any version of Discord markdown in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.1), your application is affected.
Note: The npm ls discord-markdown 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 General Security Weakness. In Discord markdown, 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
GHSA-9r27-994c-4xch Affected Discord markdown Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
discord-markdown
|
npm |
< 2.3.1
|
2.3.1
|
References
Frequently Asked Questions
What is GHSA-9r27-994c-4xch?
Which Discord markdown versions are affected?
What version fixes GHSA-9r27-994c-4xch?
Is discord-markdown affected?
What CWE is associated with GHSA-9r27-994c-4xch?
How can I check npm dependencies for GHSA-9r27-994c-4xch?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9r27-994c-4xch",
"modified" : "2020-02-21T20:20:53Z",
"published" : "2020-02-24T17:34:02Z",
"aliases" : [ ],
"summary" : "discord-html not escaping HTML code blocks when lacking a language identifier",
"details" : "### Impact\nAny website using discord-markdown with user-generated markdown is vulnerable to having code injected into the page where the markdown is displayed.\n\n### Patches\nThis has been patched in version 2.3.1\n\n### Workarounds\nEscape the characters `<>&` before sending plain code blocks to discord-markdown.\n\n### References\nhttps://github.com/brussell98/discord-markdown/issues/13",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "discord-markdown"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/brussell98/discord-markdown/security/advisories/GHSA-9r27-994c-4xch"
}, {
"type" : "WEB",
"url" : "https://github.com/brussell98/discord-markdown/issues/13"
}, {
"type" : "WEB",
"url" : "https://github.com/brussell98/discord-markdown/commit/7ce2eb66520815dcf5e97ef2bc8a2d5979da66e7"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-02-21T20:20:53Z",
"nvd_published_at" : null
}
}