Vulnerabilities in pkg:gem/kramdown

PACKAGE
Advisory Identifier: GHSA-mqm2-cgpr-p4m6
Advisory Summary

CVE-2020-14001 is a CRITICAL (CVSS 9.8) unintended read access vulnerability (CWE-862: Missing Authorization) affecting Kramdown libraries in the RubyGems ecosystem. The issue involves unintended read access in kramdown gem. Remediation is available by upgrading affected packages to version 2.3.0.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/kramdown

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/kramdown. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-mqm2-cgpr-p4m6 CVE-2020-14001 CRITICAL Unintended read access in kramdown gem
GHSA-52p9-v744-mwjj CVE-2021-28834 HIGH Remote code execution in Kramdown

CVE-2020-14001 at a Glance

CVE Identifier CVE-2020-14001
GHSA Identifier GHSA-mqm2-cgpr-p4m6
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-862: Missing Authorization
Affected Product Kramdown
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-14001

To remediate this vulnerability, upgrade all affected Kramdown dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

kramdown fixed: 2.3.0
Upgrade kramdown to 2.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for kramdown

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-14001, inspect your project dependencies for Kramdown:

inspect dependencies for kramdown

Analyze the terminal output to locate any version of Kramdown in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.0), 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-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Kramdown, 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

The kramdown gem before 2.3.0 for Ruby processes the template option inside Kramdown documents by default, which allows unintended read access (such as template="/etc/passwd") or unintended embedded Ruby code execution (such as a string that begins with template="string://<%= `). NOTE: kramdown is used in Jekyll, GitLab Pages, GitHub Pages, and Thredded Forum.

CVE-2020-14001 Affected Kramdown Versions

1 component(s)
Fixed Versions:
2.3.0
Product / Package Ecosystem Affected Versions Fixed Version
kramdown
RubyGems
< 2.3.0
2.3.0

References

NVD — CVE-2020-14001 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-14001
Security Fix Commit FIX COMMIT
https://github.com/gettalong/kramdown/commit/1b8fd33c3120bfc6e5164b449e2c2fc9c9306fde
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-mqm2-cgpr-p4m6
Kramdown Source Repository REPOSITORY
https://github.com/gettalong/kramdown
Kramdown Source Repository REPOSITORY
https://github.com/gettalong/kramdown/compare/REL_2_2_1...REL_2_3_0
Kramdown Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/kramdown/CVE-2020-14001.yml
Kramdown Security Information SECURITY
https://kramdown.gettalong.org
Kramdown Security Information SECURITY
https://kramdown.gettalong.org/news.html
lists.apache.org/thread.html/r96df78... WEB
https://lists.apache.org/thread.html/r96df7899fbb456fe2705882f710a0c8e8614b573fbffd8d12e3f54d2@%3Cnotifications.fluo.apache.org%3E
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2020/08/msg00014.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ENMMGKHRQIZ3QKGOMBBBGB6B4LB5I7NQ
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KBLTGBYU7NKOUOHDKVCU4GFZMGA6BP4L
rubygems.org/gems/kramdown WEB
https://rubygems.org/gems/kramdown
Kramdown Security Information SECURITY
https://security.netapp.com/advisory/ntap-20200731-0004
usn.ubuntu.com/4562-1 WEB
https://usn.ubuntu.com/4562-1
Kramdown Security Information SECURITY
https://www.debian.org/security/2020/dsa-4743

Frequently Asked Questions

What is CVE-2020-14001?
CVE-2020-14001 is a security vulnerability in Kramdown involving Unintended read access in kramdown gem under CWE-862: Missing Authorization.
Which Kramdown versions are affected?
Affected versions include releases prior to 2.3.0 across affected packages: kramdown.
What version fixes CVE-2020-14001?
Upgrading to 2.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kramdown affected?
Yes, kramdown is affected in releases prior to 2.3.0. Upgrade your dependency to 2.3.0 or later.
What is the CVSS score of CVE-2020-14001?
CVE-2020-14001 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-14001?
CVE-2020-14001 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check RubyGems dependencies for CVE-2020-14001?
Run the dependency tree command: 'inspect dependencies for kramdown'. 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-mqm2-cgpr-p4m6",
  "modified" : "2022-04-29T20:26:19Z",
  "published" : "2020-08-07T22:27:41Z",
  "aliases" : [ "CVE-2020-14001" ],
  "summary" : "Unintended read access in kramdown gem",
  "details" : "The kramdown gem before 2.3.0 for Ruby processes the template option inside Kramdown documents by default, which allows unintended read access (such as template=\"/etc/passwd\") or unintended embedded Ruby code execution (such as a string that begins with template=\"string://<%= `). NOTE: kramdown is used in Jekyll, GitLab Pages, GitHub Pages, and Thredded Forum.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "kramdown"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-14001"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gettalong/kramdown/commit/1b8fd33c3120bfc6e5164b449e2c2fc9c9306fde"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-mqm2-cgpr-p4m6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gettalong/kramdown"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gettalong/kramdown/compare/REL_2_2_1...REL_2_3_0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/kramdown/CVE-2020-14001.yml"
  }, {
    "type" : "WEB",
    "url" : "https://kramdown.gettalong.org"
  }, {
    "type" : "WEB",
    "url" : "https://kramdown.gettalong.org/news.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r96df7899fbb456fe2705882f710a0c8e8614b573fbffd8d12e3f54d2@%3Cnotifications.fluo.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/08/msg00014.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ENMMGKHRQIZ3QKGOMBBBGB6B4LB5I7NQ"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KBLTGBYU7NKOUOHDKVCU4GFZMGA6BP4L"
  }, {
    "type" : "WEB",
    "url" : "https://rubygems.org/gems/kramdown"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20200731-0004"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4562-1"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2020/dsa-4743"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-07T22:27:22Z",
    "nvd_published_at" : "2020-07-17T16:15:00Z"
  }
}