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 productsnot 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
-
github.com
/gettalong/kramdown/pull/708
web, exploit, third-party-advisory
-
gitlab.com
/gitlab-org/gitlab/-/commit/179329b5c3c118924fb242dc449d06b4ed6ccb66
web, patch, third-party-advisory
-
github.com
/gettalong/kramdown/compare/REL_2_3_0...REL_2_3_1
web, patch, third-party-advisory
-
github.com
/stanhu/kramdown/commit/d6a1cbcb2caa2f8a70927f176070d126b2422760
web
-
github.com
/stanhu/kramdown/commit/ff0218aefcf00cd5a389e17e075d36cd46d011e2
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/S3BBLUIDCUUR3NEE4NJLOCCAV3ALQ3O6/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/SYOLQKFL6IJCQLBXV34Z4TI4O54GESPR/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/NJCJVYHPY6LNUFM6LYZIAUIYOMVT5QGV/
vendor-advisory
-
debian.org
/security/2021/dsa-4890
vendor-advisory, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-28834
advisory
-
about.gitlab.com
/releases/2021/03/17/security-release-gitlab-13-9-4-released/#remote-code-execution-via-unsafe-user-controlled
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/NJCJVYHPY6LNUFM6LYZIAUIYOMVT5QGV
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/S3BBLUIDCUUR3NEE4NJLOCCAV3ALQ3O6
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/SYOLQKFL6IJCQLBXV34Z4TI4O54GESPR
web
Sources
- CVE List CVE-2021-28834
- GitHub Advisory GHSA-52p9-v744-mwjj
- NVD CVE-2021-28834
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.