Vulnerabilities > CVE-2018-12326 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Redislabs Redis

047910
CVSS 4.6 - MEDIUM
Attack vector
LOCAL
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
local
low complexity
redislabs
CWE-119
nessus
exploit available

Summary

Buffer overflow in redis-cli of Redis before 4.0.10 and 5.x before 5.0 RC3 allows an attacker to achieve code execution and escalate to higher privileges via a crafted command line. NOTE: It is unclear whether there are any common situations in which redis-cli is used with, for example, a -h (aka hostname) argument from an untrusted source.

Vulnerable Configurations

Part Description Count
Application
Redislabs
199

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Exploit-Db

descriptionRedis-cli < 5.0 - Buffer Overflow (PoC). CVE-2018-12326. Local exploit for Linux platform
fileexploits/linux/local/44904.py
idEDB-ID:44904
last seen2018-06-18
modified2018-06-18
platformlinux
port
published2018-06-18
reporterExploit-DB
sourcehttps://www.exploit-db.com/download/44904/
titleRedis-cli < 5.0 - Buffer Overflow (PoC)
typelocal

Nessus

NASL familyMisc.
NASL idREDIS_4_0_10.NASL
descriptionThe version of Redis installed on the remote host is affected by multiple vulnerabilities and therefore requires a security update.
last seen2020-06-01
modified2020-06-02
plugin id117484
published2018-09-14
reporterThis script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/117484
titlePivotal Software Redis LUA < 3.2.12 / 4.0.x < 4.0.10 / 5.0 < 5.0rc2 Multiple Vulnerabilities
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(117484);
  script_version("1.3");
  script_cvs_date("Date: 2019/11/01");

  script_cve_id("CVE-2018-11218", "CVE-2018-12326");

  script_name(english:"Pivotal Software Redis LUA < 3.2.12 / 4.0.x < 4.0.10 / 5.0 < 5.0rc2 Multiple Vulnerabilities");
  script_summary(english:"Checks version of Pivotal Software Redis.");

  script_set_attribute(attribute:"synopsis", value:
"Redis requires a security update.");
  script_set_attribute(attribute:"description", value:
"The version of Redis installed on the remote host is affected by
multiple vulnerabilities and therefore requires a security update.");
  script_set_attribute(attribute:"see_also", value:"http://antirez.com/news/119");
  script_set_attribute(attribute:"solution", value:
"Update to Redis 3.2.12, 4.0.10 or 5.0-rc2 or higher.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2018-11218");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2018/06/14");
  script_set_attribute(attribute:"patch_publication_date", value:"2018/06/14");
  script_set_attribute(attribute:"plugin_publication_date", value:"2018/09/14");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:pivotal_software:redis");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Misc.");

  script_copyright(english:"This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("redis_detect.nbin");
  script_require_ports("Services/redis_server", 6379);

  exit(0);
}

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

appname = "Redis Server";
port = get_service(svc:"redis_server", default:6379, exit_on_fail:TRUE);
version = get_kb_item_or_exit("redis/" + port + "/Version");

fix = NULL;
if (version =~ "^[1-3]\.") fix = "3.2.12";
else if (version =~ "^4\.0") fix = "4.0.10";
else if (version =~ "^4\.9") fix = "4.9.102";

if (!isnull(fix) && ver_compare(ver:version, fix:fix) == -1)
{
  report =
    '\n  Port              : ' + port +
    '\n  Installed version : ' + version +
    '\n  Fixed version     : ' + fix +
    '\n';

  security_report_v4(port:port, severity:SECURITY_HOLE, extra:report);
}
else
{
  audit(AUDIT_INST_VER_NOT_VULN, appname, version);
}

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/148225/rediscli-overflow.txt
idPACKETSTORM:148225
last seen2018-06-19
published2018-06-18
reporterFakhri Zulkifli
sourcehttps://packetstormsecurity.com/files/148225/Redis-cli-Buffer-Overflow.html
titleRedis-cli Buffer Overflow

Redhat

advisories
  • rhsa
    idRHSA-2019:0052
  • rhsa
    idRHSA-2019:0094
  • rhsa
    idRHSA-2019:1860
rpms
  • redis-0:3.0.6-4.el7ost
  • redis-debuginfo-0:3.0.6-4.el7ost
  • redis-0:3.2.8-3.el7ost
  • redis-debuginfo-0:3.2.8-3.el7ost
  • rh-redis32-redis-0:3.2.13-1.el6
  • rh-redis32-redis-0:3.2.13-1.el7
  • rh-redis32-redis-debuginfo-0:3.2.13-1.el6
  • rh-redis32-redis-debuginfo-0:3.2.13-1.el7