Vulnerabilities in pkg:gem/rdoc

PACKAGE
Advisory Identifier: GHSA-592j-995h-p23j
Advisory Summary

CVE-2024-27281 is a LOW (CVSS 4.5) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Rdoc libraries in the RubyGems ecosystem. The issue involves rdoc rce vulnerability with .rdoc_options. Remediation is available by upgrading affected packages to version 6.3.4.1, 6.4.1.1, 6.5.1.1, 6.6.3.1.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/rdoc

3 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-592j-995h-p23j CVE-2024-27281 LOW RDoc RCE vulnerability with .rdoc_options
GHSA-ggxm-pgc9-g7fp CVE-2021-31799 HIGH Arbitrary Code Execution in Rdoc
GHSA-v2r9-c84j-v7xm CVE-2013-0256 MODERATE RDoc contains XSS vulnerability

CVE-2024-27281 at a Glance

CVE Identifier CVE-2024-27281
GHSA Identifier GHSA-592j-995h-p23j
Severity LOW
CVSS v3.1 Base Score 4.5
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Rdoc
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 4.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L).

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

How to Fix CVE-2024-27281

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

rdoc fixed: 6.3.4.1
Upgrade rdoc to 6.3.4.1
rdoc fixed: 6.4.1.1
Upgrade rdoc to 6.4.1.1
rdoc fixed: 6.5.1.1
Upgrade rdoc to 6.5.1.1
rdoc fixed: 6.6.3.1
Upgrade rdoc to 6.6.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:

inspect dependencies for rdoc

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-27281, inspect your project dependencies for Rdoc:

inspect dependencies for rdoc

Analyze the terminal output to locate any version of Rdoc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.3.4.1), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Rdoc, 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

An issue was discovered in RDoc 6.3.3 through 6.6.2, as distributed in Ruby 3.x through 3.3.0. When parsing `.rdoc_options` (used for configuration in RDoc) as a YAML file, object injection and resultant remote code execution are possible because there are no restrictions on the classes that can be restored. When loading the documentation cache, object injection and resultant remote code execution are also possible if there were a crafted cache. We recommend to update the RDoc gem to version 6.6.3.1 or later. In order to ensure compatibility with bundled version in older Ruby series, you may update as follows instead: * For Ruby 3.0 users: Update to `rdoc` 6.3.4.1 * For Ruby 3.1 users: Update to `rdoc` 6.4.1.1 * For Ruby 3.2 users: Update to `rdoc` 6.5.1.1 You can use `gem update rdoc` to update it. If you are using bundler, please add `gem "rdoc", ">= 6.6.3.1"` to your `Gemfile`. Note: 6.3.4, 6.4.1, 6.5.1 and 6.6.3 have a incorrect fix. We recommend to upgrade 6.3.4.1, 6.4.1.1, 6.5.1.1 and 6.6.3.1 instead of them.

CVE-2024-27281 Affected Rdoc Versions

4 component(s)
Fixed Versions:
6.3.4.16.4.1.16.5.1.16.6.3.1
Product / Package Ecosystem Affected Versions Fixed Version
rdoc
RubyGems
≥ 6.3.3
< 6.3.4.1
6.3.4.1
rdoc
RubyGems
≥ 6.4.0
< 6.4.1.1
6.4.1.1
rdoc
RubyGems
≥ 6.5.0
< 6.5.1.1
6.5.1.1
rdoc
RubyGems
≥ 6.6.0
< 6.6.3.1
6.6.3.1

References

NVD — CVE-2024-27281 NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-27281
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/1254b0066f312ddbf7fae7a195e66ce5b3bc6656
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/32ff6ba0bebd8ea26f569da5fd23be2937f6a644
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/48617985e9fbc2825219d55f04e3e0e98d2923be
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/811f125a4a0cc968e3eb18e16ea6c1a3b49a11bf
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/a5de13bf0f0c26f8e764e82b5bf4bf8bffc7198e
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/d22ba930f1f611dda531dba04cd3d2531bb3f8a5
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/da7a0c7553ef7250ca665a3fecdc01dbaacbb43d
Security Fix Commit FIX COMMIT
https://github.com/ruby/rdoc/commit/e4a0e71e6f1032f8b4e5e58b4ef60d702c22ce17
hackerone.com/reports/1187477 WEB
https://hackerone.com/reports/1187477
Rdoc Source Repository REPOSITORY
https://github.com/ruby/rdoc
Rdoc Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rdoc/CVE-2024-27281.yml
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2024/09/msg00000.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/27LUWREIFTP3MQAW7QE4PJM4DPAQJWXF
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XYDHPHEZI7OQXTQKTDZHGZNPIJH7ZV5N
www.ruby-lang.org/en/news/2024/03/21/... WEB
https://www.ruby-lang.org/en/news/2024/03/21/rce-rdoc-cve-2024-27281

Frequently Asked Questions

What is CVE-2024-27281?
CVE-2024-27281 is a security vulnerability in Rdoc involving RDoc RCE vulnerability with .rdoc_options under CWE-502: Deserialization of Untrusted Data.
Which Rdoc versions are affected?
Affected versions include releases prior to 6.3.4.1, 6.4.1.1, 6.5.1.1, 6.6.3.1 across affected packages: rdoc.
What version fixes CVE-2024-27281?
Upgrading to 6.3.4.1, 6.4.1.1, 6.5.1.1, 6.6.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rdoc affected?
Yes, rdoc is affected in releases prior to 6.3.4.1, 6.4.1.1, 6.5.1.1, 6.6.3.1. Upgrade your dependency to 6.3.4.1, 6.4.1.1, 6.5.1.1, 6.6.3.1 or later.
What is the CVSS score of CVE-2024-27281?
CVE-2024-27281 has a CVSS v3.1 base score of 4.5 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2024-27281?
CVE-2024-27281 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check RubyGems dependencies for CVE-2024-27281?
Run the dependency tree command: 'inspect dependencies for rdoc'. 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-592j-995h-p23j",
  "modified" : "2026-06-08T23:16:44Z",
  "published" : "2024-03-25T19:36:59Z",
  "aliases" : [ "CVE-2024-27281" ],
  "summary" : "RDoc RCE vulnerability with .rdoc_options",
  "details" : "An issue was discovered in RDoc 6.3.3 through 6.6.2, as distributed in Ruby 3.x through 3.3.0.\n\nWhen parsing `.rdoc_options` (used for configuration in RDoc) as a YAML file, object injection and resultant remote code execution are possible because there are no restrictions on the classes that can be restored.\n\nWhen loading the documentation cache, object injection and resultant remote code execution are also possible if there were a crafted cache.\n\nWe recommend to update the RDoc gem to version 6.6.3.1 or later. In order to ensure compatibility with bundled version in older Ruby series, you may update as follows instead:\n\n* For Ruby 3.0 users: Update to `rdoc` 6.3.4.1\n* For Ruby 3.1 users: Update to `rdoc` 6.4.1.1\n* For Ruby 3.2 users: Update to `rdoc` 6.5.1.1\n\nYou can use `gem update rdoc` to update it. If you are using bundler, please add `gem \"rdoc\", \">= 6.6.3.1\"` to your `Gemfile`.\n\nNote: 6.3.4, 6.4.1, 6.5.1 and 6.6.3 have a incorrect fix. We recommend to upgrade 6.3.4.1, 6.4.1.1, 6.5.1.1 and 6.6.3.1 instead of them.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rdoc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.3.3"
      }, {
        "fixed" : "6.3.4.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rdoc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.4.0"
      }, {
        "fixed" : "6.4.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rdoc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.5.0"
      }, {
        "fixed" : "6.5.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rdoc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.6.0"
      }, {
        "fixed" : "6.6.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27281"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/1254b0066f312ddbf7fae7a195e66ce5b3bc6656"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/32ff6ba0bebd8ea26f569da5fd23be2937f6a644"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/48617985e9fbc2825219d55f04e3e0e98d2923be"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/811f125a4a0cc968e3eb18e16ea6c1a3b49a11bf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/a5de13bf0f0c26f8e764e82b5bf4bf8bffc7198e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/d22ba930f1f611dda531dba04cd3d2531bb3f8a5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/da7a0c7553ef7250ca665a3fecdc01dbaacbb43d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rdoc/commit/e4a0e71e6f1032f8b4e5e58b4ef60d702c22ce17"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/1187477"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/rdoc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rdoc/CVE-2024-27281.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2024/09/msg00000.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/27LUWREIFTP3MQAW7QE4PJM4DPAQJWXF"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XYDHPHEZI7OQXTQKTDZHGZNPIJH7ZV5N"
  }, {
    "type" : "WEB",
    "url" : "https://www.ruby-lang.org/en/news/2024/03/21/rce-rdoc-cve-2024-27281"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502", "CWE-74" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-25T19:36:59Z",
    "nvd_published_at" : "2024-05-14T15:11:57Z"
  }
}