CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization
2699 CVEs have CWE-362 as their primary weakness. 11 of them are in the CISA KEV catalog. The highest EPSS score among them is 99.439%.
The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.
Child of CWE-662: Improper Synchronization
Mitigations
- Architecture and Design: In languages that support it, use synchronization primitives. Only wrap these around critical code to minimize the impact on performance.
- Architecture and Design: Use thread-safe capabilities such as the data access abstraction in Spring.
- Architecture and Design: Minimize the usage of shared resources in order to remove as much complexity as possible from the control flow and to reduce the likelihood of unexpected conditions occurring. Additionally, this will minimize the amount of synchronization necessary and may even help to reduce the likelihood of a denial of service where an attacker may be able to repeatedly trigger a critical section (CWE-400).
- Implementation: When using multithreading and operating on shared variables, only use thread-safe functions.
- Implementation: Use atomic operations on shared variables. Be wary of innocent-looking constructs such as x++. This may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read, followed by a computation, followed by a write.
- Implementation: Use a mutex if available, but be sure to avoid related weaknesses such as CWE-412.
- Implementation: Avoid double-checked locking (CWE-609) and other implementation errors that arise when trying to avoid the overhead of synchronization.
- Implementation: Disable interrupts or signals over critical parts of the code, but also make sure that the code does not go into a large or infinite loop.
- Implementation: Use the volatile type modifier for critical variables to avoid unexpected compiler optimization or reordering. This does not necessarily solve the synchronization problem, but it can help.
- Architecture and Design Operation: Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Observed examples
- CVE-2024-38106: OS kernel stores sensitive data in improperly locked memory, allowing local users to gain privileges by winning a race condition
- CVE-2022-29527: Go application for cloud management creates a world-writable sudoers file that allows local attackers to inject sudo rules and escalate privileges to root by winning a race condition.
- CVE-2021-1782: Chain: improper locking (CWE-667) leads to race condition (CWE-362), as exploited in the wild per CISA KEV.
- CVE-2021-0920: Chain: mobile platform race condition (CWE-362) leading to use-after-free (CWE-416), as exploited in the wild per CISA KEV.
- CVE-2020-6819: Chain: race condition (CWE-362) leads to use-after-free (CWE-416), as exploited in the wild per CISA KEV.
- CVE-2019-18827: Chain: JTAG interface is not disabled (CWE-1191) during ROM code execution, introducing a race condition (CWE-362) to extract encryption keys
- CVE-2019-1161: Chain: race condition (CWE-362) in anti-malware product allows deletion of files by creating a junction (CWE-1386) and using hard links during the time window in which a temporary file is created and deleted.
- CVE-2015-1743: TOCTOU in sandbox process allows installation of untrusted browser add-ons by replacing a file after it has been verified, but before it is executed
- CVE-2014-8273: Chain: chipset has a race condition (CWE-362) between when an interrupt handler detects an attempt to write-enable the BIOS (in violation of the lock bit), and when the handler resets the write-enable bit back to 0, allowing attackers to issue BIOS writes during the timing window [REF-1237].
- CVE-2008-5044: Race condition leading to a crash by calling a hook removal procedure while other activities are occurring at the same time.
- CVE-2008-2958: Chain: time-of-check time-of-use (TOCTOU) race condition in program allows bypass of protection mechanism that was designed to prevent symlink attacks.
- CVE-2008-1570: Chain: time-of-check time-of-use (TOCTOU) race condition in program allows bypass of protection mechanism that was designed to prevent symlink attacks.
- CVE-2008-0058: Unsynchronized caching operation enables a race condition that causes messages to be sent to a deallocated object.
- CVE-2008-0379: Race condition during initialization triggers a buffer overflow.
- CVE-2007-6599: Daemon crash by quickly performing operations and undoing them, which eventually leads to an operation that does not acquire a lock.
- CVE-2007-6180: Chain: race condition triggers NULL pointer dereference
- CVE-2007-5794: Race condition in library function could cause data to be sent to the wrong process.
- CVE-2007-3970: Race condition in file parser leads to heap corruption.
- CVE-2008-5021: Composite: race condition (CWE-362) allows attacker to modify an object while it is still being initialized, causing software to access uninitialized memory (CWE-908).
- CVE-2009-4895: Chain: race condition for an argument value, possibly resulting in NULL dereference
- CVE-2009-3547: Chain: race condition (CWE-362) might allow resource to be released before operating on it, leading to NULL dereference (CWE-476)
- CVE-2006-5051: Chain: Signal handler contains too much functionality (CWE-828), introducing a race condition (CWE-362) that leads to a double free (CWE-415).
Top released CVEs
KEV first, then the highest EPSS score, the highest CVSS score and the newest.
| CVE | Published | Severity | CVSS | EPSS | Description |
|---|---|---|---|---|---|
| CVE-2023-36884 | 2023-07-11 | HIGH | 7.5 | 99.439% | Windows Search Remote Code Execution Vulnerability |
| CVE-2016-5195 | 2016-11-10 | HIGH | 7.0 | 83.524% | Race condition in mm/gup.c in the Linux kernel 2.x through 4.x before 4.8.3 allows local users to gain privileges by leveraging incorrect handling of a… |
| CVE-2021-21166 | 2021-03-09 | HIGH | 8.8 | 24.027% | Data race in audio in Google Chrome prior to 89.0.4389.72 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page. |
| CVE-2014-0196 | 2014-05-07 | MEDIUM | 5.5 | 20.486% | The n_tty_write function in drivers/tty/n_tty.c in the Linux kernel through 3.14.3 does not properly manage tty driver access in the "LECHO & !OPOST" case… |
| CVE-2022-26904 | 2022-04-15 | HIGH | 7.0 | 16.948% | Windows User Profile Service Elevation of Privilege Vulnerability |
| CVE-2020-6820 | 2020-04-24 | HIGH | 8.1 | 7.063% | Under certain conditions, when handling a ReadableStream, a race condition can cause a use-after-free. We are aware of targeted attacks in the wild abusing… |
| CVE-2025-62215 | 2025-11-11 | HIGH | 7.0 | 4.464% | Concurrent execution using shared resource with improper synchronization ('race condition') in Windows Kernel allows an authorized attacker to elevate… |
| CVE-2020-6819 | 2020-04-24 | HIGH | 8.1 | 3.039% | Under certain conditions, when running the nsDocShell destructor, a race condition can cause a use-after-free. We are aware of targeted attacks in the wild… |
| CVE-2025-39964 | 2025-10-13 | HIGH | 7.8 | 1.607% | In the Linux kernel, the following vulnerability has been resolved: crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg Issuing two writes to the… |
| CVE-2021-0920 | 2021-12-15 | MEDIUM | 6.4 | 0.867% | In unix_scm_to_skb of af_unix.c, there is a possible use after free bug due to a race condition. This could lead to local escalation of privilege with System… |
| CVE-2021-25395 | 2021-06-11 | MEDIUM | 6.4 | 0.366% | A race condition in MFC charger driver prior to SMR MAY-2021 Release 1 allows local attackers to bypass signature check given a radio privilege is compromised. |
| CVE-2026-119790 | 2026-11-16 | MEDIUM | 6.3 | 0.404% | Next.js is a React framework for building full-stack web applications. From 16.3.0 until 16.4.5, Next.js applications using the same 'use cache' function… |
| CVE-2026-119351 | 2026-11-16 | MEDIUM | 6.3 | 0.240% | Next.js is a React framework for building full-stack web applications. From 16.2.0 until 16.4.5, Next.js applications with Cache Components enabled can reuse… |
| CVE-2026-123353 | 2026-11-16 | LOW | 3.3 | 0.196% | Docmost is open-source collaborative wiki and documentation software. Prior to 0.96.0, two concurrent role-demotion requests from a space admin or workspace… |
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-362'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-362'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).