The version of Ruby installed on the remote host is prior to 3.0.7, 3.1.5, 3.2.4, or 3.3.1. It is, therefore, affected by a vulnerability as referenced in the rce-rdoc-cve-2024-27281 advisory.
Note that Nessus has not tested for this issue but has instead relied only on the application’s self-reported version number.
#%NASL_MIN_LEVEL 80900
##
# (C) Tenable, Inc.
##
include('compat.inc');
if (description)
{
script_id(200138);
script_version("1.2");
script_set_attribute(attribute:"plugin_modification_date", value:"2024/06/07");
script_cve_id("CVE-2024-27281");
script_xref(name:"IAVA", value:"2024-A-0328");
script_name(english:"Ruby < 3.0.7 / 3.1.x < 3.1.5 / 3.2.x < 3.2.4 / 3.3.x < 3.3.1 RCE");
script_set_attribute(attribute:"synopsis", value:
"The remote host is missing a security update.");
script_set_attribute(attribute:"description", value:
"The version of Ruby installed on the remote host is prior to 3.0.7, 3.1.5, 3.2.4, or 3.3.1. It is, therefore, affected
by a vulnerability as referenced in the rce-rdoc-cve-2024-27281 advisory.
- 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.) The main fixed version is 6.6.3.1. For Ruby 3.0 users, a fixed
version is rdoc 6.3.4.1. For Ruby 3.1 users, a fixed version is rdoc 6.4.1.1. For Ruby 3.2 users, a fixed
version is rdoc 6.5.1.1. (CVE-2024-27281)
Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version
number.");
script_set_attribute(attribute:"see_also", value:"https://www.ruby-lang.org/en/news/2024/03/21/rce-rdoc-cve-2024-27281/");
script_set_attribute(attribute:"see_also", value:"https://www.ruby-lang.org/en/news/2024/04/23/ruby-3-3-1-released/");
script_set_attribute(attribute:"solution", value:
"Upgrade to Ruby version 3.0.7 / 3.1.5 / 3.2.4 / 3.3.1 or later.");
script_set_attribute(attribute:"agent", value:"all");
script_set_cvss_base_vector("CVSS2#AV:L/AC:H/Au:N/C:P/I:P/A:P");
script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L");
script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
script_set_attribute(attribute:"cvss_score_source", value:"CVE-2024-27281");
script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
script_set_attribute(attribute:"exploit_available", value:"false");
script_set_attribute(attribute:"vuln_publication_date", value:"2024/04/25");
script_set_attribute(attribute:"patch_publication_date", value:"2024/04/23");
script_set_attribute(attribute:"plugin_publication_date", value:"2024/06/06");
script_set_attribute(attribute:"plugin_type", value:"local");
script_set_attribute(attribute:"cpe", value:"cpe:/a:ruby-lang:ruby");
script_set_attribute(attribute:"stig_severity", value:"II");
script_set_attribute(attribute:"thorough_tests", value:"true");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"Misc.");
script_copyright(english:"This script is Copyright (C) 2024 and is owned by Tenable, Inc. or an Affiliate thereof.");
script_dependencies("ruby_win_installed.nbin", "ruby_macos_installed.nbin");
script_require_keys("installed_sw/Ruby");
exit(0);
}
include('vcf.inc');
var app_info = vcf::get_app_info(app:'Ruby');
var constraints = [
{ 'fixed_version' : '3.0.7' },
{ 'min_version' : '3.1', 'fixed_version' : '3.1.5' },
{ 'min_version' : '3.2', 'fixed_version' : '3.2.4' },
{ 'min_version' : '3.3', 'fixed_version' : '3.3.1' }
];
vcf::check_version_and_report(
app_info:app_info,
constraints:constraints,
severity:SECURITY_NOTE
);