GHSA-9r27-994c-4xch: Discord markdown Discord-html Not Escaping HTML Code Vulnerability

HIGH
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-9r27-994c-4xch
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Discord markdown
Package Ecosystem npm
Published Date
Last Updated

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.

discord-markdown fixed: 2.3.1
npm install discord-markdown@2.3.1
Verify Direct and Transitive Dependencies

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

### Impact Any website using discord-markdown with user-generated markdown is vulnerable to having code injected into the page where the markdown is displayed. ### Patches This has been patched in version 2.3.1 ### Workarounds Escape the characters `<>&` before sending plain code blocks to discord-markdown. ### References https://github.com/brussell98/discord-markdown/issues/13

GHSA-9r27-994c-4xch Affected Discord markdown Versions

1 component(s)
Fixed Versions:
2.3.1
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?
GHSA-9r27-994c-4xch is a security vulnerability in Discord markdown involving discord-html not escaping HTML code blocks when lacking a language identifier under General Security Weakness.
Which Discord markdown versions are affected?
Affected versions include releases prior to 2.3.1 across affected packages: discord-markdown.
What version fixes GHSA-9r27-994c-4xch?
Upgrading to 2.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is discord-markdown affected?
Yes, discord-markdown is affected in releases prior to 2.3.1. Upgrade your dependency to 2.3.1 or later.
What CWE is associated with GHSA-9r27-994c-4xch?
GHSA-9r27-994c-4xch is classified under General Security Weakness.
How can I check npm dependencies for GHSA-9r27-994c-4xch?
Run the dependency tree command: 'npm ls discord-markdown'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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 `&lt;&gt;&amp;` 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
  }
}