CVE Vulnerabilities

CVE-2014-5340

Improper Control of Generation of Code ('Code Injection')

Published: Sep 02, 2014 | Modified: Oct 09, 2018
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
9.3 HIGH
AV:N/AC:M/Au:N/C:C/I:C/A:C
RedHat/V2
7.5 IMPORTANT
AV:N/AC:L/Au:N/C:P/I:P/A:P
RedHat/V3
Ubuntu
MEDIUM

The wato component in Check_MK before 1.2.4p4 and 1.2.5 before 1.2.5i4 uses the pickle Python module unsafely, which allows remote attackers to execute arbitrary code via a crafted serialized object, related to an automation URL.

Weakness

The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Affected Software

Name Vendor Start Version End Version
Check_mk Check_mk_project * 1.2.4 (including)
Check_mk Check_mk_project 1.2.4 (including) 1.2.4 (including)
Check_mk Check_mk_project 1.2.4-p1 (including) 1.2.4-p1 (including)
Check_mk Check_mk_project 1.2.4-p2 (including) 1.2.4-p2 (including)
Check_mk Check_mk_project 1.2.5-i1 (including) 1.2.5-i1 (including)
Check_mk Check_mk_project 1.2.5-i2 (including) 1.2.5-i2 (including)
Check_mk Check_mk_project 1.2.5-i3 (including) 1.2.5-i3 (including)
Native Client for RHEL 5 for Red Hat Storage RedHat glusterfs-0:3.7.1-11.el5 *
Native Client for RHEL 6 for Red Hat Storage RedHat glusterfs-0:3.7.1-11.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat augeas-0:1.0.0-10.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat check-mk-0:1.2.6p1-3.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat clufter-0:0.11.2-1.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat cluster-0:3.0.12.1-73.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat clustermon-0:0.16.2-31.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat corosync-0:1.4.7-2.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat ctdb2.5-0:2.5.5-7.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat fence-virt-0:0.2.3-19.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat glusterfs-0:3.7.1-11.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat gluster-nagios-addons-0:0.2.4-4.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat gluster-nagios-common-0:0.2.0-1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat gstatus-0:0.64-3.1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat libqb-0:0.17.1-1.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat libtalloc-0:2.1.1-4.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat libvirt-0:0.10.2-54.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat nagios-plugins-0:1.4.16-12.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat nagios-server-addons-0:0.2.1-4.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat nfs-ganesha-0:2.2.0-5.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat nrpe-0:2.15-4.1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat openais-0:1.1.1-7.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat openstack-swift-0:1.13.1-4.el6ost *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat pacemaker-0:1.1.12-8.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat pcs-0:0.9.139-9.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat pnp4nagios-0:0.6.22-2.1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat pynag-0:0.9.1-1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat python-blivet-1:1.0.0.2-1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat python-cpopen-0:1.3-4.el6_5 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat python-eventlet-0:0.14.0-1.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat python-greenlet-0:0.4.2-1.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat python-keystoneclient-1:0.9.0-5.el6ost *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat python-prettytable-0:0.7.2-1.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat python-pyudev-0:0.15-2.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat redhat-storage-logos-0:60.0.20-1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat redhat-storage-server-0:3.1.0.3-1.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat resource-agents-0:3.9.5-24.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat ricci-0:0.16.2-81.el6 *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat userspace-rcu-0:0.7.9-2.el6rhs *
Red Hat Gluster Storage 3.1 for RHEL 6 RedHat vdsm-0:4.16.20-1.2.el6rhs *
Check-mk Ubuntu artful *
Check-mk Ubuntu precise *
Check-mk Ubuntu trusty *
Check-mk Ubuntu utopic *
Check-mk Ubuntu vivid *
Check-mk Ubuntu wily *
Check-mk Ubuntu yakkety *
Check-mk Ubuntu zesty *

Extended Description

When a product allows a user’s input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. Such an alteration could lead to arbitrary code execution. Injection problems encompass a wide variety of issues – all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common – i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.

Potential Mitigations

  • Run your code in a “jail” or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
  • Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
  • This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
  • Be careful to avoid CWE-243 and other weaknesses related to jails.
  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().

References