CVE Vulnerabilities

CVE-2013-0912

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

Published: Mar 11, 2013 | Modified: Sep 19, 2017
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
7.5 HIGH
AV:N/AC:L/Au:N/C:P/I:P/A:P
RedHat/V2
RedHat/V3
Ubuntu

WebKit in Google Chrome before 25.0.1364.160 allows remote attackers to execute arbitrary code via vectors that leverage type confusion.

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
Chrome Google 25.0.1364.22 25.0.1364.22
Chrome Google 25.0.1364.50 25.0.1364.50
Chrome Google 25.0.1364.88 25.0.1364.88
Chrome Google 25.0.1364.40 25.0.1364.40
Chrome Google 25.0.1364.87 25.0.1364.87
Chrome Google 25.0.1364.86 25.0.1364.86
Chrome Google 25.0.1364.3 25.0.1364.3
Chrome Google 25.0.1364.18 25.0.1364.18
Chrome Google 25.0.1364.70 25.0.1364.70
Chrome Google 25.0.1364.80 25.0.1364.80
Chrome Google 25.0.1364.92 25.0.1364.92
Chrome Google 25.0.1364.31 25.0.1364.31
Chrome Google 25.0.1364.85 25.0.1364.85
Chrome Google 25.0.1364.44 25.0.1364.44
Chrome Google 25.0.1364.0 25.0.1364.0
Chrome Google 25.0.1364.93 25.0.1364.93
Chrome Google 25.0.1364.34 25.0.1364.34
Chrome Google 25.0.1364.28 25.0.1364.28
Chrome Google 25.0.1364.35 25.0.1364.35
Chrome Google 25.0.1364.61 25.0.1364.61
Chrome Google 25.0.1364.89 25.0.1364.89
Chrome Google 25.0.1364.123 25.0.1364.123
Chrome Google 25.0.1364.121 25.0.1364.121
Chrome Google 25.0.1364.21 25.0.1364.21
Chrome Google 25.0.1364.48 25.0.1364.48
Chrome Google 25.0.1364.118 25.0.1364.118
Chrome Google 25.0.1364.36 25.0.1364.36
Chrome Google 25.0.1364.156 25.0.1364.156
Chrome Google 25.0.1364.42 25.0.1364.42
Chrome Google 25.0.1364.9 25.0.1364.9
Chrome Google 25.0.1364.74 25.0.1364.74
Chrome Google 25.0.1364.39 25.0.1364.39
Chrome Google 25.0.1364.16 25.0.1364.16
Chrome Google 25.0.1364.114 25.0.1364.114
Chrome Google 25.0.1364.54 25.0.1364.54
Chrome Google 25.0.1364.62 25.0.1364.62
Chrome Google 25.0.1364.67 25.0.1364.67
Chrome Google 25.0.1364.98 25.0.1364.98
Chrome Google 25.0.1364.115 25.0.1364.115
Chrome Google 25.0.1364.41 25.0.1364.41
Chrome Google 25.0.1364.124 25.0.1364.124
Chrome Google 25.0.1364.45 25.0.1364.45
Chrome Google 25.0.1364.19 25.0.1364.19
Chrome Google 25.0.1364.13 25.0.1364.13
Chrome Google 25.0.1364.66 25.0.1364.66
Chrome Google 25.0.1364.1 25.0.1364.1
Chrome Google 25.0.1364.15 25.0.1364.15
Chrome Google 25.0.1364.56 25.0.1364.56
Chrome Google 25.0.1364.30 25.0.1364.30
Chrome Google 25.0.1364.52 25.0.1364.52
Chrome Google 25.0.1364.77 25.0.1364.77
Chrome Google 25.0.1364.110 25.0.1364.110
Chrome Google 25.0.1364.73 25.0.1364.73
Chrome Google 25.0.1364.14 25.0.1364.14
Chrome Google 25.0.1364.25 25.0.1364.25
Chrome Google 25.0.1364.113 25.0.1364.113
Chrome Google 25.0.1364.43 25.0.1364.43
Chrome Google 25.0.1364.155 25.0.1364.155
Chrome Google 25.0.1364.57 25.0.1364.57
Chrome Google 25.0.1364.5 25.0.1364.5
Chrome Google 25.0.1364.12 25.0.1364.12
Chrome Google 25.0.1364.76 25.0.1364.76
Chrome Google 25.0.1364.116 25.0.1364.116
Chrome Google 25.0.1364.112 25.0.1364.112
Chrome Google 25.0.1364.24 25.0.1364.24
Chrome Google 25.0.1364.10 25.0.1364.10
Chrome Google 25.0.1364.55 25.0.1364.55
Chrome Google 25.0.1364.126 25.0.1364.126
Chrome Google 25.0.1364.95 25.0.1364.95
Chrome Google 25.0.1364.47 25.0.1364.47
Chrome Google 25.0.1364.51 25.0.1364.51
Chrome Google 25.0.1364.11 25.0.1364.11
Chrome Google 25.0.1364.154 25.0.1364.154
Chrome Google 25.0.1364.120 25.0.1364.120
Chrome Google 25.0.1364.27 25.0.1364.27
Chrome Google 25.0.1364.68 25.0.1364.68
Chrome Google 25.0.1364.8 25.0.1364.8
Chrome Google 25.0.1364.99 25.0.1364.99
Chrome Google 25.0.1364.58 25.0.1364.58
Chrome Google 25.0.1364.79 25.0.1364.79
Chrome Google 25.0.1364.84 25.0.1364.84
Chrome Google 25.0.1364.37 25.0.1364.37
Chrome Google 25.0.1364.119 25.0.1364.119
Chrome Google 25.0.1364.38 25.0.1364.38
Chrome Google 25.0.1364.72 25.0.1364.72
Chrome Google 25.0.1364.63 25.0.1364.63
Chrome Google 25.0.1364.78 25.0.1364.78
Chrome Google 25.0.1364.82 25.0.1364.82
Chrome Google 25.0.1364.117 25.0.1364.117
Chrome Google 25.0.1364.33 25.0.1364.33
Chrome Google 25.0.1364.91 25.0.1364.91
Chrome Google 25.0.1364.46 25.0.1364.46
Chrome Google 25.0.1364.32 25.0.1364.32
Chrome Google 25.0.1364.122 25.0.1364.122
Chrome Google 25.0.1364.29 25.0.1364.29
Chrome Google 25.0.1364.152 25.0.1364.152
Chrome Google 25.0.1364.49 25.0.1364.49
Chrome Google 25.0.1364.53 25.0.1364.53
Chrome Google 25.0.1364.65 25.0.1364.65
Chrome Google 25.0.1364.75 25.0.1364.75
Chrome Google 25.0.1364.90 25.0.1364.90
Chrome Google 25.0.1364.2 25.0.1364.2
Chrome Google 25.0.1364.159 25.0.1364.159
Chrome Google 25.0.1364.23 25.0.1364.23
Chrome Google 25.0.1364.125 25.0.1364.125
Chrome Google 25.0.1364.81 25.0.1364.81
Chrome Google 25.0.1364.17 25.0.1364.17
Chrome Google 25.0.1364.26 25.0.1364.26
Chrome Google 25.0.1364.108 25.0.1364.108
Chrome Google 25.0.1364.20 25.0.1364.20
Chrome Google 25.0.1364.7 25.0.1364.7

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