CVE-2018-8037 - Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

Severity

43%

Complexity

86%

Confidentiality

48%

If an async request was completed by the application at the same time as the container triggered the async timeout, a race condition existed that could result in a user seeing a response intended for a different user. An additional issue was present in the NIO and NIO2 connectors that did not correctly track the closure of the connection when an async request was completed by the application and timed out by the container at the same time. This could also result in a user seeing a response intended for another user. Versions Affected: Apache Tomcat 9.0.0.M9 to 9.0.9 and 8.5.5 to 8.5.31.

If an async request was completed by the application at the same time as the container triggered the async timeout, a race condition existed that could result in a user seeing a response intended for a different user. An additional issue was present in the NIO and NIO2 connectors that did not correctly track the closure of the connection when an async request was completed by the application and timed out by the container at the same time. This could also result in a user seeing a response intended for another user. Versions Affected: Apache Tomcat 9.0.0.M9 to 9.0.9 and 8.5.5 to 8.5.31.

CVSS 3.0 Base Score 5.9. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).

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

Demo Examples

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

This code could be used in an e-commerce application that supports transfers between accounts. It takes the total amount of the transfer, sends it to the new account, and deducts the amount from the original account.


               
NotifyUser("New balance: $newbalance");
FatalError("Bad Transfer Amount");
FatalError("Insufficient Funds");

A race condition could occur between the calls to GetBalanceFromDatabase() and SendNewBalanceToDatabase().

Suppose the balance is initially 100.00. An attack could be constructed as follows:


               
PROGRAM-2 sends a request to update the database, setting the balance to 99.00

At this stage, the attacker should have a balance of 19.00 (due to 81.00 worth of transfers), but the balance is 99.00, as recorded in the database.

To prevent this weakness, the programmer has several options, including using a lock to prevent multiple simultaneous requests to the web application, or using a synchronization mechanism that includes all the code between GetBalanceFromDatabase() and SendNewBalanceToDatabase().

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

The following function attempts to acquire a lock in order to perform operations on a shared resource.


               
}
pthread_mutex_unlock(mutex);/* access shared resource */

However, the code does not check the value returned by pthread_mutex_lock() for errors. If pthread_mutex_lock() cannot acquire the mutex for any reason, the function may introduce a race condition into the program and result in undefined behavior.

In order to avoid data races, correctly written programs must check the result of thread synchronization functions and appropriately handle all errors, either by attempting to recover from them or reporting it to higher levels.


               
}
return pthread_mutex_unlock(mutex);
return result;
/* access shared resource */

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

Suppose a processor's Memory Management Unit (MMU) has 5 other shadow MMUs to distribute its workload for its various cores. Each MMU has the start address and end address of "accessible" memory. Any time this accessible range changes (as per the processor's boot status), the main MMU sends an update message to all the shadow MMUs.

Suppose the interconnect fabric does not prioritize such "update" packets over other general traffic packets. This introduces a race condition. If an attacker can flood the target with enough messages so that some of those attack packets reach the target before the new access ranges gets updated, then the attacker can leverage this scenario.

Overview

First reported 6 years ago

2018-08-02 14:29:00

Last updated 6 years ago

2019-04-15 16:31:00

Affected Software

Apache Software Foundation Tomcat

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 M12

9.0.0

Apache Software Foundation Tomcat 9.0.0 M13

9.0.0

Apache Software Foundation Tomcat 9.0.0 M14

9.0.0

Apache Software Foundation Tomcat 9.0.0 M15

9.0.0

Apache Software Foundation Tomcat 9.0.0 M16

9.0.0

Apache Software Foundation Tomcat 9.0.0 M17

9.0.0

Apache Software Foundation Tomcat 9.0.0 M18

9.0.0

Apache Software Foundation Tomcat 9.0.0 M19

9.0.0

Apache Software Foundation Tomcat 9.0.0 M20

9.0.0

Apache Software Foundation Tomcat 9.0.0 M21

9.0.0

Apache Software Foundation Tomcat 9.0.0 M22

9.0.0

Apache Software Foundation Tomcat 9.0.0 M23

9.0.0

Apache Software Foundation Tomcat 9.0.0 M24

9.0.0

Apache Software Foundation Tomcat 9.0.0 M25

9.0.0

Apache Software Foundation Tomcat 9.0.0 M26

9.0.0

Apache Software Foundation Tomcat 9.0.0 M27

9.0.0

Apache Software Foundation Tomcat 9.0.0 M9

9.0.0

Debian Linux 9.0

9.0

References

[www-announce] 20180722 [SECURITY] CVE-2018-8037 Apache Tomcat - Information Disclosure

Mailing List, Vendor Advisory

[www-announce] 20180809 [UPDATE][SECURITY] CVE-2018-8037 Apache Tomcat - Information Disclosure

Mailing List, Vendor Advisory

http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html

Patch, Third Party Advisory

104894

Third Party Advisory, VDB Entry

1041376

Third Party Advisory, VDB Entry

RHSA-2018:2867

Third Party Advisory

RHSA-2018:2868

Third Party Advisory

RHSA-2019:1529

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

[tomcat-users] 20191001 Additional Information on Apache Tomcat CVE-2018-8037

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

Mailing List, Third Party Advisory

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

Mailing List, Third Party Advisory

[tomcat-users] 20191001 Re: Additional Information on Apache Tomcat CVE-2018-8037

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

[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/

Mailing List, Third Party Advisory

[tomcat-dev] 20190413 svn commit: r1857496 [3/4] - in /tomcat/site/trunk: ./ docs/ xdocs/

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

Mailing List, Third Party Advisory

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

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

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

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

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

Third Party Advisory

DSA-4281

Third Party Advisory

N/A

https://www.oracle.com/technetwork/security-advisory/cpuoct2019-5072832.html

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.