CVE-2016-6816 - Improper Input Validation

Severity

68%

Complexity

86%

Confidentiality

106%

The code in Apache Tomcat 9.0.0.M1 to 9.0.0.M11, 8.5.0 to 8.5.6, 8.0.0.RC1 to 8.0.38, 7.0.0 to 7.0.72, and 6.0.0 to 6.0.47 that parsed the HTTP request line permitted invalid characters. This could be exploited, in conjunction with a proxy that also permitted the invalid characters but with a different interpretation, to inject data into the HTTP response. By manipulating the HTTP response the attacker could poison a web-cache, perform an XSS attack and/or obtain sensitive information from requests other then their own.

The code in Apache Tomcat 9.0.0.M1 to 9.0.0.M11, 8.5.0 to 8.5.6, 8.0.0.RC1 to 8.0.38, 7.0.0 to 7.0.72, and 6.0.0 to 6.0.47 that parsed the HTTP request line permitted invalid characters. This could be exploited, in conjunction with a proxy that also permitted the invalid characters but with a different interpretation, to inject data into the HTTP response. By manipulating the HTTP response the attacker could poison a web-cache, perform an XSS attack and/or obtain sensitive information from requests other then their own.

CVSS 3.0 Base Score 7.1. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L).

CVSS 2.0 Base Score 6.8. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:P/I:P/A:P).

Demo Examples

Improper Input Validation

CWE-20

This example demonstrates a shopping interaction in which the user is free to specify the quantity of items to be purchased and a total is calculated.


               
...

The user has no control over the price variable, however the code does not prevent a negative value from being specified for quantity. If an attacker were to provide a negative value, then the user would have their account credited instead of debited.

Improper Input Validation

CWE-20

This example asks the user for a height and width of an m X n game board with a maximum dimension of 100 squares.


               
.../* board dimensions */
die("No integer passed: Die evil hacker!\n");
die("No integer passed: Die evil hacker!\n");
die("Value too large: Die evil hacker!\n");

While this code checks to make sure the user cannot specify large, positive integers and consume too much memory, it does not check for negative values supplied by the user. As a result, an attacker can perform a resource consumption (CWE-400) attack against this program by specifying two, large negative values that will not overflow, resulting in a very large memory allocation (CWE-789) and possibly a system crash. Alternatively, an attacker can provide very large negative values which will cause an integer overflow (CWE-190) and unexpected behavior will follow depending on how the values are treated in the remainder of the program.

Improper Input Validation

CWE-20

The following example shows a PHP application in which the programmer attempts to display a user's birthday and homepage.


               
echo "Birthday: $birthday<br>Homepage: <a href=$homepage>click here</a>"

The programmer intended for $birthday to be in a date format and $homepage to be a valid URL. However, since the values are derived from an HTTP request, if an attacker can trick a victim into clicking a crafted URL with <script> tags providing the values for birthday and / or homepage, then the script will run on the client's browser when the web server echoes the content. Notice that even if the programmer were to defend the $birthday variable by restricting input to integers and dashes, it would still be possible for an attacker to provide a string of the form:


               
2009-01-09--

If this data were used in a SQL statement, it would treat the remainder of the statement as a comment. The comment could disable other security-related logic in the statement. In this case, encoding combined with input validation would be a more useful protection mechanism.

Furthermore, an XSS (CWE-79) attack or SQL injection (CWE-89) are just a few of the potential consequences when input validation is not used. Depending on the context of the code, CRLF Injection (CWE-93), Argument Injection (CWE-88), or Command Injection (CWE-77) may also be possible.

Improper Input Validation

CWE-20

This function attempts to extract a pair of numbers from a user-supplied string.


               
}
die("Did not specify integer value. Die evil hacker!\n");
/* proceed assuming n and m are initialized correctly */

This code attempts to extract two integer values out of a formatted, user-supplied input. However, if an attacker were to provide an input of the form:


               
123:

then only the m variable will be initialized. Subsequent use of n may result in the use of an uninitialized variable (CWE-457).

Improper Input Validation

CWE-20

The following example takes a user-supplied value to allocate an array of objects and then operates on the array.


               
}
list[0] = new Widget();
die("Negative value supplied for list size, die evil hacker!");

This example attempts to build a list from a user-specified value, and even checks to ensure a non-negative value is supplied. If, however, a 0 value is provided, the code will build an array of size 0 and then try to store a new Widget in the first location, causing an exception to be thrown.

Improper Input Validation

CWE-20

This application has registered to handle a URL when sent an intent:


               
}......
}
}
int length = URL.length();
...

The application assumes the URL will always be included in the intent. When the URL is not present, the call to getStringExtra() will return null, thus causing a null pointer exception when length() is called.

Overview

Type

Apache

First reported 7 years ago

2017-03-20 18:59:00

Last updated 5 years ago

2019-04-15 16:30:00

Affected Software

Apache Software Foundation Tomcat 6.0.0

6.0.0

Apache Software Foundation Tomcat 6.0.1

6.0.1

Apache Software Foundation Tomcat 6.0.2

6.0.2

Apache Software Foundation Tomcat 6.0.3

6.0.3

Apache Software Foundation Tomcat 6.0.4

6.0.4

Apache Software Foundation Tomcat 6.0.5

6.0.5

Apache Software Foundation Tomcat 6.0.6

6.0.6

Apache Software Foundation Tomcat 6.0.7

6.0.7

Apache Software Foundation Tomcat 6.0.8

6.0.8

Apache Software Foundation Tomcat 6.0.9

6.0.9

Apache Software Foundation Tomcat 6.0.10

6.0.10

Apache Software Foundation Tomcat 6.0.11

6.0.11

Apache Software Foundation Tomcat 6.0.12

6.0.12

Apache Software Foundation Tomcat 6.0.13

6.0.13

Apache Software Foundation Tomcat 6.0.14

6.0.14

Apache Software Foundation Tomcat 6.0.15

6.0.15

Apache Software Foundation Tomcat 6.0.16

6.0.16

Apache Software Foundation Tomcat 6.0.17

6.0.17

Apache Software Foundation Tomcat 6.0.18

6.0.18

Apache Software Foundation Tomcat 6.0.19

6.0.19

Apache Software Foundation Tomcat 6.0.20

6.0.20

Apache Software Foundation Tomcat 6.0.21

6.0.21

Apache Software Foundation Tomcat 6.0.22

6.0.22

Apache Software Foundation Tomcat 6.0.23

6.0.23

Apache Software Foundation Tomcat 6.0.24

6.0.24

Apache Software Foundation Tomcat 6.0.25

6.0.25

Apache Software Foundation Tomcat 6.0.26

6.0.26

Apache Software Foundation Tomcat 6.0.27

6.0.27

Apache Software Foundation Tomcat 6.0.28

6.0.28

Apache Software Foundation Tomcat 6.0.29

6.0.29

Apache Software Foundation Tomcat 6.0.30

6.0.30

Apache Software Foundation Tomcat 6.0.31

6.0.31

Apache Software Foundation Tomcat 6.0.32

6.0.32

Apache Software Foundation Tomcat 6.0.33

6.0.33

Apache Software Foundation Tomcat 6.0.34

6.0.34

Apache Software Foundation Tomcat 6.0.35

6.0.35

Apache Software Foundation Tomcat 6.0.36

6.0.36

Apache Software Foundation Tomcat 6.0.37

6.0.37

Apache Software Foundation Tomcat 6.0.38

6.0.38

Apache Software Foundation Tomcat 6.0.40

6.0.40

Apache Software Foundation Tomcat 6.0.41

6.0.41

Apache Software Foundation Tomcat 6.0.42

6.0.42

Apache Software Foundation Tomcat 6.0.43

6.0.43

Apache Tomcat 6.0.44

6.0.44

Apache Software Foundation Tomcat 6.0.45

6.0.45

Apache Software Foundation Tomcat 6.0.46

6.0.46

Apache Software Foundation Tomcat 6.0.47

6.0.47

Apache Software Foundation Tomcat 7.0.0

7.0.0

Apache Software Foundation Tomcat 7.0.1

7.0.1

Apache Software Foundation Tomcat 7.0.2

7.0.2

Apache Software Foundation Tomcat 7.0.3

7.0.3

Apache Software Foundation Tomcat 7.0.4

7.0.4

Apache Software Foundation Tomcat 7.0.5

7.0.5

Apache Software Foundation Tomcat 7.0.6

7.0.6

Apache Software Foundation Tomcat 7.0.7

7.0.7

Apache Software Foundation Tomcat 7.0.8

7.0.8

Apache Software Foundation Tomcat 7.0.9

7.0.9

Apache Software Foundation Tomcat 7.0.10

7.0.10

Apache Software Foundation Tomcat 7.0.11

7.0.11

Apache Software Foundation Tomcat 7.0.12

7.0.12

Apache Software Foundation Tomcat 7.0.13

7.0.13

Apache Software Foundation Tomcat 7.0.14

7.0.14

Apache Software Foundation Tomcat 7.0.15

7.0.15

Apache Software Foundation Tomcat 7.0.16

7.0.16

Apache Software Foundation Tomcat 7.0.17

7.0.17

Apache Software Foundation Tomcat 7.0.18

7.0.18

Apache Software Foundation Tomcat 7.0.19

7.0.19

Apache Software Foundation Tomcat 7.0.20

7.0.20

Apache Software Foundation Tomcat 7.0.21

7.0.21

Apache Software Foundation Tomcat 7.0.22

7.0.22

Apache Software Foundation Tomcat 7.0.23

7.0.23

Apache Software Foundation Tomcat 7.0.24

7.0.24

Apache Software Foundation Tomcat 7.0.25

7.0.25

Apache Software Foundation Tomcat 7.0.26

7.0.26

Apache Software Foundation Tomcat 7.0.27

7.0.27

Apache Software Foundation Tomcat 7.0.28

7.0.28

Apache Software Foundation Tomcat 7.0.29

7.0.29

Apache Software Foundation Tomcat 7.0.30

7.0.30

Apache Software Foundation Tomcat 7.0.31

7.0.31

Apache Software Foundation Tomcat 7.0.32

7.0.32

Apache Software Foundation Tomcat 7.0.33

7.0.33

Apache Software Foundation Tomcat 7.0.34

7.0.34

Apache Software Foundation Tomcat 7.0.35

7.0.35

Apache Software Foundation Tomcat 7.0.36

7.0.36

Apache Software Foundation Tomcat 7.0.37

7.0.37

Apache Software Foundation Tomcat 7.0.38

7.0.38

Apache Software Foundation Tomcat 7.0.39

7.0.39

Apache Software Foundation Tomcat 7.0.40

7.0.40

Apache Software Foundation Tomcat 7.0.41

7.0.41

Apache Software Foundation Tomcat 7.0.42

7.0.42

Apache Software Foundation Tomcat 7.0.43

7.0.43

Apache Software Foundation Tomcat 7.0.44

7.0.44

Apache Software Foundation Tomcat 7.0.45

7.0.45

Apache Software Foundation Tomcat 7.0.46

7.0.46

Apache Software Foundation Tomcat 7.0.47

7.0.47

Apache Software Foundation Tomcat 7.0.48

7.0.48

Apache Software Foundation Tomcat 7.0.49

7.0.49

Apache Software Foundation Tomcat 7.0.50

7.0.50

Apache Software Foundation Tomcat 7.0.51

7.0.51

Apache Software Foundation Tomcat 7.0.52

7.0.52

Apache Software Foundation Tomcat 7.0.53

7.0.53

Apache Software Foundation Tomcat 7.0.54

7.0.54

Apache Software Foundation Tomcat 7.0.55

7.0.55

Apache Software Foundation Tomcat 7.0.56

7.0.56

Apache Software Foundation Tomcat 7.0.57

7.0.57

Apache Software Foundation Tomcat 7.0.58

7.0.58

Apache Tomcat 7.0.59

7.0.59

Apache Software Foundation Tomcat 7.0.60

7.0.60

Apache Tomcat 7.0.61

7.0.61

Apache Tomcat 7.0.62

7.0.62

Apache Tomcat 7.0.63

7.0.63

Apache Tomcat 7.0.64

7.0.64

Apache Software Foundation Tomcat 7.0.65

7.0.65

Apache Software Foundation Tomcat 7.0.66

7.0.66

Apache Software Foundation Tomcat 7.0.67

7.0.67

Apache Software Foundation Tomcat 7.0.68

7.0.68

Apache Software Foundation Tomcat 7.0.69

7.0.69

Apache Software Foundation Tomcat 7.0.70

7.0.70

Apache Software Foundation Tomcat 7.0.71

7.0.71

Apache Software Foundation Tomcat 7.0.72

7.0.72

Apache Software Foundation Tomcat 8.0.1

8.0.1

Apache Software Foundation Tomcat 8.0.2

8.0.2

Apache Software Foundation Tomcat 8.0.3

8.0.3

Apache Software Foundation Tomcat 8.0.4

8.0.4

Apache Software Foundation Tomcat 8.0.5

8.0.5

Apache Software Foundation Tomcat 8.0.6

8.0.6

Apache Software Foundation Tomcat 8.0.7

8.0.7

Apache Software Foundation Tomcat 8.0.8

8.0.8

Apache Software Foundation Tomcat 8.0.9

8.0.9

Apache Software Foundation Tomcat 8.0.10

8.0.10

Apache Software Foundation Tomcat 8.0.11

8.0.11

Apache Software Foundation Tomcat 8.0.12

8.0.12

Apache Software Foundation Tomcat 8.0.13

8.0.13

Apache Software Foundation Tomcat 8.0.14

8.0.14

Apache Software Foundation Tomcat 8.0.15

8.0.15

Apache Software Foundation Tomcat 8.0.16

8.0.16

Apache Tomcat 8.0.17

8.0.17

Apache Tomcat 8.0.18

8.0.18

Apache Software Foundation Tomcat 8.0.19

8.0.19

Apache Tomcat 8.0.20

8.0.20

Apache Tomcat 8.0.21

8.0.21

Apache Tomcat 8.0.22

8.0.22

Apache Tomcat 8.0.23

8.0.23

Apache Tomcat 8.0.24

8.0.24

Apache Software Foundation Tomcat 8.0.25

8.0.25

Apache Tomcat 8.0.26

8.0.26

Apache Software Foundation Tomcat 8.0.27

8.0.27

Apache Software Foundation Tomcat 8.0.28

8.0.28

Apache Software Foundation Tomcat 8.0.29

8.0.29

Apache Software Foundation Tomcat 8.0.30

8.0.30

Apache Software Foundation Tomcat 8.0.31

8.0.31

Apache Software Foundation Tomcat 8.0.32

8.0.32

Apache Software Foundation Tomcat 8.0.33

8.0.33

Apache Software Foundation Tomcat 8.0.34

8.0.34

Apache Software Foundation Tomcat 8.0.35

8.0.35

Apache Software Foundation Tomcat 8.0.36

8.0.36

Apache Software Foundation Tomcat 8.0.37

8.0.37

Apache Software Foundation Tomcat 8.0.38

8.0.38

Apache Software Foundation Tomcat 8.5.0

8.5.0

Apache Software Foundation Tomcat 8.5.1

8.5.1

Apache Software Foundation Tomcat 8.5.2

8.5.2

Apache Software Foundation Tomcat 8.5.3

8.5.3

Apache Software Foundation Tomcat 8.5.4

8.5.4

Apache Software Foundation Tomcat 8.5.5

8.5.5

Apache Software Foundation Tomcat 8.5.6

8.5.6

Apache Software Foundation Tomcat 9.0.0 M1

9.0.0

Apache Software Foundation Tomcat 9.0.0 M10

9.0.0

Apache Software Foundation Tomcat 9.0.0 M11

9.0.0

Apache Software Foundation Tomcat 9.0.0 M2

9.0.0

Apache Software Foundation Tomcat 9.0.0 M3

9.0.0

Apache Software Foundation Tomcat 9.0.0 M4

9.0.0

Apache Software Foundation Tomcat 9.0.0 M5

9.0.0

Apache Software Foundation Tomcat 9.0.0 M6

9.0.0

Apache Software Foundation Tomcat 9.0.0 M7

9.0.0

Apache Software Foundation Tomcat 9.0.0 M8

9.0.0

Apache Software Foundation Tomcat 9.0.0 M9

9.0.0

References

RHSA-2017:0244

RHSA-2017:0245

RHSA-2017:0246

RHSA-2017:0247

RHSA-2017:0250

RHSA-2017:0457

RHSA-2017:0527

DSA-3738

http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html

94461

Third Party Advisory, VDB Entry

1037332

RHSA-2017:0455

RHSA-2017:0456

RHSA-2017:0935

[tomcat-dev] 20190319 svn commit: r1855831 [25/30] - in /tomcat/site/trunk: ./ docs/ xdocs/

[tomcat-dev] 20190413 svn commit: r1857494 [15/20] - in /tomcat/site/trunk: ./ docs/ xdocs/

[tomcat-dev] 20190325 svn commit: r1856174 [22/29] - in /tomcat/site/trunk: docs/ xdocs/ xdocs/stylesheets/

[tomcat-dev] 20190325 svn commit: r1856174 [21/29] - in /tomcat/site/trunk: docs/ xdocs/ xdocs/stylesheets/

[tomcat-dev] 20190415 svn commit: r1857582 [17/22] - in /tomcat/site/trunk: docs/ xdocs/stylesheets/

[tomcat-dev] 20190415 svn commit: r1857582 [19/22] - in /tomcat/site/trunk: docs/ xdocs/stylesheets/

[tomcat-dev] 20190413 svn commit: r1857494 [16/20] - in /tomcat/site/trunk: ./ docs/ xdocs/

[tomcat-dev] 20190413 svn commit: r1857494 [17/20] - in /tomcat/site/trunk: ./ docs/ xdocs/

[tomcat-dev] 20190325 svn commit: r1856174 [24/29] - in /tomcat/site/trunk: docs/ xdocs/ xdocs/stylesheets/

[tomcat-dev] 20190415 svn commit: r1857582 [16/22] - in /tomcat/site/trunk: docs/ xdocs/stylesheets/

[tomcat-dev] 20190319 svn commit: r1855831 [23/30] - in /tomcat/site/trunk: ./ docs/ xdocs/

[tomcat-dev] 20200203 svn commit: r1873527 [23/30] - /tomcat/site/trunk/docs/

[tomcat-dev] 20200213 svn commit: r1873980 [26/34] - /tomcat/site/trunk/docs/

[tomcat-dev] 20200213 svn commit: r1873980 [27/34] - /tomcat/site/trunk/docs/

https://security.netapp.com/advisory/ntap-20180607-0001/

https://tomcat.apache.org/security-6.html#Fixed_in_Apache_Tomcat_6.0.48

Release Notes, Vendor Advisory

https://tomcat.apache.org/security-7.html#Fixed_in_Apache_Tomcat_7.0.73

Release Notes, Vendor Advisory

https://tomcat.apache.org/security-8.html#Fixed_in_Apache_Tomcat_8.0.39

Release Notes, Vendor Advisory

https://tomcat.apache.org/security-8.html#Fixed_in_Apache_Tomcat_8.5.8

Release Notes, Vendor Advisory

https://tomcat.apache.org/security-9.html#Fixed_in_Apache_Tomcat_9.0.0.M13

Release Notes, Vendor Advisory

41783

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.