Skip to content
Fencer Vulns
critical 9.8

CVE-2021-28834 json

Remote code execution in Kramdown

published 2021-03-19 5 y ago modified 2026-06-17 4 mo ago also GHSA-52p9-v744-mwjj , EUVD-2021-0603

cvss
9.8
version 3.1, NVD
cisa kev
Not listed
not in CISA's catalog
epss
2.7%
EPSS 2.7% chance of exploitation in 30 days, percentile 86%
public exploits
0
none known

Summary

Kramdown before 2.3.1 does not restrict Rouge formatters to the Rouge::Formatters namespace, and thus arbitrary classes can be instantiated.

Patch / fix

  • rubygems kramdown 2.3.1
  • kramdown_project kramdown 2.3.1
  • ruby-kramdown Debian 14, Debian 13, Debian 12 2.3.0-5

debian advisories DEBIAN-CVE-2021-28834

  • ruby-kramdown Ubuntu 20.04 LTS 1.17.0-4ubuntu0.2

ubuntu advisories UBUNTU-CVE-2021-28834

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • rubygem-kramdown openSUSE Tumbleweed 2.4.0-1.17
  • rubygem-kramdown openSUSE Tumbleweed 2.4.0-1.15
  • rubygem-kramdown openSUSE Tumbleweed 2.4.0-1.12
  • rubygem-kramdown openSUSE Tumbleweed 2.4.0-1.1
  • ruby3.2-rubygem-kramdown openSUSE Tumbleweed 2.4.0-1.8

opensuse advisories openSUSE-SU-2026:10352-1openSUSE-SU-2025:15119-1openSUSE-SU-2024:14170-1openSUSE-SU-2024:12038-1openSUSE-SU-2024:13161-1

  • ruby-kramdown Arch Linux 2.3.1-1

arch linux advisories AVG-1709

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-28834 updated cvss 9.8

rubygem-kramdown: allows arbitrary classes to be instantiated

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present “Developers using rubygem-kramdown: Do not pass user or external input into custom Rouge formatter selection logic. All other users/system administrators: There is no known mitigation at this time.”

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

2.70% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/gettalong/kramdown/pull/708 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
NVD 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 2.0 6.8 AV:N/AC:M/Au:N/C:P/I:P/A:P
GitHub 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
rubygems kramdown
>=1.16.0, <2.3.1
2.3.1

Classification

Weakness
  • CWE-94 Improper Control of Generation of Code

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.