CVE-2021-0244 - Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

Severity

74%

Complexity

27%

Confidentiality

66%

A signal handler race condition exists in the Layer 2 Address Learning Daemon (L2ALD) of Juniper Networks Junos OS due to the absence of a specific protection mechanism to avoid a race condition which may allow an attacker to bypass the storm-control feature on devices. This issue is a corner case and only occurs during specific actions taken by an administrator of a device under certain specifics actions which triggers the event. The event occurs less frequently on devices which are not configured with Virtual Chassis configurations, and more frequently on devices configured in Virtual Chassis configurations. This issue is not specific to any particular Junos OS platform. An Indicator of Compromise (IoC) may be seen by reviewing log files for the following error message seen by executing the following show statement: show log messages | grep storm Result to look for: /kernel: GENCFG: op 58 (Storm Control Blob) failed; err 1 (Unknown) This issue affects: Juniper Networks Junos OS: 14.1X53 versions prior to 14.1X53-D49 on EX Series; 15.1 versions prior to 15.1R7-S6; 15.1X49 versions prior to 15.1X49-D191, 15.1X49-D200 on SRX Series; 16.1 versions prior to 16.1R7-S7; 16.2 versions prior to 16.2R2-S11, 16.2R3; 17.1 versions prior to 17.1R2-S11, 17.1R3; 17.2 versions prior to 17.2R2-S8, 17.2R3-S3; 17.3 versions prior to 17.3R2-S5, 17.3R3-S7; 17.4 versions prior to 17.4R2-S9, 17.4R3; 18.1 versions prior to 18.1R3-S5; 18.2 versions prior to 18.2R2-S6, 18.2R3; 18.3 versions prior to 18.3R1-S7, 18.3R2-S3, 18.3R3; 18.4 versions prior to 18.4R1-S5, 18.4R2; 19.1 versions prior to 19.1R1-S4, 19.1R2.

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

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

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

Type

Juniper

First reported 3 years ago

2021-04-22 20:15:00

Last updated 3 years ago

2021-04-28 01:02:00

Affected Software

Juniper Junos OS 15.1

15.1

Juniper Junos 15.1 A1

15.1

Juniper JUNOS 15.1 F

15.1

Juniper JunOS 15.1 F1

15.1

Juniper JunOS 15.1 F2

15.1

Juniper JunOS 15.1 F2-s1

15.1

Juniper Junos 15.1 F2-S2

15.1

Juniper Junos 15.1 F2-S3

15.1

Juniper Junos 15.1 F2-S4

15.1

Juniper Junos 15.1 F3

15.1

Juniper Junos 15.1 F4

15.1

Juniper Junos 15.1 F5

15.1

Juniper Junos 15.1 F5-S7

15.1

Juniper JUNOS 15.1 F6

15.1

Juniper JUNOS 15.1 F6-s1

15.1

Juniper Junos OS 15.1 F6-s12

15.1

Juniper JUNOS 15.1 F6-s2

15.1

Juniper JUNOS 15.1 F6-S3

15.1

Juniper Junos 15.1 F6-S4

15.1

Juniper Junos 15.1 F6-S7

15.1

Juniper JunOS 15.1 F7

15.1

Juniper Junos 15.1 R1

15.1

Juniper JunOS 15.1 R2

15.1

Juniper Junos 15.1 R3

15.1

Juniper JunOS 15.1 R4

15.1

Juniper Junos 15.1 R4-S7

15.1

Juniper Junos 15.1 R4-S8

15.1

Juniper Junos 15.1 R4-S9

15.1

Juniper JunOS 15.1 R5

15.1

Juniper Junos 15.1 R5-S1

15.1

Juniper Junos 15.1 R5-S5

15.1

Juniper JUNOS 15.1 R5-S6

15.1

Juniper JunOS 15.1 R6

15.1

Juniper Junos 15.1 R6-S1

15.1

Juniper JUNOS 15.1 R6-S2

15.1

Juniper Junos 15.1 R6-S6

15.1

Juniper Junos OS 15.1 R7

15.1

Juniper JUNOS 15.1 R7-S1

15.1

Juniper JUNOS 15.1 R7-S2

15.1

Juniper JUNOS 15.1 R7-S3

15.1

Juniper Junos OS 15.1 R7-s4

15.1

Juniper Junos OS 15.1 R7-s5

15.1

Juniper JUNOS 16.1

16.1

Juniper JunOS 16.1 R1

16.1

Juniper JunOS 16.1 R2

16.1

Juniper JunOS 16.1 R3

16.1

Juniper Junos 16.1 R3-S10

16.1

Juniper Junos OS 16.1 R3-S11

16.1

Juniper JunOS 16.1 R4

16.1

Juniper JUNOS 16.1 R4-S12

16.1

Juniper JUNOS 16.1 R4-S2

16.1

Juniper Junos 16.1 R4-S3

16.1

Juniper Junos 16.1 R4-S4

16.1

Juniper JUNOS 16.1 R4-S6

16.1

Juniper Junos 16.1 R5

16.1

Juniper Junos 16.1 R5-S4

16.1

Juniper Junos 16.1 R6-S1

16.1

Juniper Junos 16.1 R6-s6

16.1

Juniper Junos 16.1 R7

16.1

Juniper JUNOS 16.1 R7-S2

16.1

Juniper JUNOS 16.1 R7-S3

16.1

Juniper JUNOS 16.1R7-S4

16.1

Juniper JUNOS 16.1R7-S5

16.1

Juniper JUNOS 16.1 R7-S6

16.1

Juniper JUNOS 16.2

16.2

Juniper JunOS 16.2 R1

16.2

Juniper JunOS 16.2 R2

16.2

Juniper Junos 16.2 R2-S1

16.2

Juniper JUNOS 16.2 R2-S10

16.2

Juniper JUNOS 16.2 R2-S2

16.2

Juniper Junos 16.2 R2-S5

16.2

Juniper JUNOS 16.2 R2-S6

16.2

Juniper JUNOS 16.2 R2-S7

16.2

Juniper JUNOS 16.2R2-S8

16.2

Juniper JUNOS 16.2 R2-S9

16.2

Juniper JUNOS 17.1

17.1

Juniper JunOS 17.1 R1

17.1

Juniper Junos 17.1 R2

17.1

Juniper Junos 17.1 R2-S1

17.1

Juniper JUNOS 17.1 R2-S10

17.1

Juniper JUNOS 17.1 R2-S2

17.1

Juniper JUNOS 17.1 R2-S3

17.1

Juniper JUNOS 17.1 R2-S4

17.1

Juniper JUNOS 17.1 R2-S5

17.1

Juniper JUNOS 17.1 R2-S6

17.1

Juniper Junos 17.1 R2-S7

17.1

Juniper Junos OS 17.1 R2-S8

17.1

Juniper JunOS 17.1 R2-s9

17.1

Juniper JUNOS 17.2

17.2

Juniper Junos 17.2 R1

17.2

Juniper JUNOS 17.2 R1-s1

17.2

Juniper JUNOS 17.2 R1-S2

17.2

Juniper JUNOS 17.2 R1-s3

17.2

Juniper JUNOS 17.2 R1-S4

17.2

Juniper JUNOS 17.2 R1-s5

17.2

Juniper Junos 17.2 R1-S7

17.2

Juniper JUNOS 17.2 R1-S8

17.2

Juniper Junos 17.2 R2

17.2

Juniper JUNOS 17.2 R2-S11

17.2

Juniper JUNOS 17.2 R2-S6

17.2

Juniper JUNOS 17.2 R2-S7

17.2

Juniper JUNOS 17.2R3-S1

17.2

Juniper JUNOS 17.2 R3-S2

17.2

Juniper JUNOS 17.3

17.3

Juniper JUNOS 17.3 R1-S1

17.3

Juniper Junos 17.3 R2

17.3

Juniper JUNOS 17.3 R2-S1

17.3

Juniper JUNOS 17.3R2-S2

17.3

Juniper Junos OS 17.3 R2-S3

17.3

Juniper JUNOS 17.3 R2-S4

17.3

Juniper JUNOS 17.3 R3-S1

17.3

Juniper JUNOS 17.3 R3-S2

17.3

Juniper JUNOS 17.3 R3-S3

17.3

Juniper JUNOS 17.3R3-S4

17.3

Juniper JUNOS 17.4

17.4

Juniper Junos 17.4 R1

17.4

Juniper JUNOS 17.4 R1-S1

17.4

Juniper JUNOS 17.4 R1-S2

17.4

Juniper JUNOS 17.4R1-S4

17.4

Juniper JunOS 17.4 R1-s5

17.4

Juniper JUNOS 17.4 R1-S6

17.4

Juniper JUNOS 17.4R1-S7

17.4

Juniper Junos 17.4 R2

17.4

Juniper JUNOS 17.4 R2-S1

17.4

Juniper Junos 17.4 R2-S2

17.4

Juniper JUNOS 17.4 R2-S3

17.4

Juniper JUNOS 17.4R2-S4

17.4

Juniper JUNOS 17.4 R2-S5

17.4

Juniper JUNOS 17.4 R2-S6

17.4

Juniper JUNOS 17.4 R2-S7

17.4

Juniper JUNOS 17.4 R2-S8

17.4

Juniper JUNOS 18.1

18.1

Juniper JUNOS 18.1R2

18.1

Juniper JUNOS R2-S1

18.1

Juniper JUNOS R2-S2

18.1

Juniper JUNOS 18.1 R2-S4

18.1

Juniper JUNOS 18.1 R3

18.1

Juniper JunOS 18.1 R3-s1

18.1

Juniper JUNOS 18.1 R3-S2

18.1

Juniper JUNOS 18.1 R3-S3

18.1

Juniper JUNOS 18.1R3-S4

18.1

Juniper JUNOS 18.2

18.2

Juniper JunOS 18.2 R1-S3

18.2

Juniper JUNOS 18.2 R1-S5

18.2

Juniper JUNOS 18.2 R2-S1

18.2

Juniper JUNOS 18.2R2-S2

18.2

Juniper JUNOS 18.2R2-S3

18.2

Juniper JUNOS18.2 R2-S4

18.2

Juniper JUNOS 18.2 R2-S5

18.2

Juniper JUNOS 18.3

18.3

Juniper JUNOS 18.3 R1

18.3

Juniper JUNOS 18.3 R1-S1

18.3

Juniper JUNOS 18.3 R1-S2

18.3

Juniper JUNOS 18.3R1-S3

18.3

Juniper JUNOS 18.3 R1-S5

18.3

Juniper JUNOS 18.3 R1-S6

18.3

Juniper JUNOS 18.3 R2

18.3

Juniper JUNOS 18.3 R2-S1

18.3

Juniper JUNOS 18.3 R2-S2

18.3

Juniper Junos OS 19.1

19.1

Juniper Junos OS 19.1 R1

19.1

Juniper Junos OS 19.1 R1-s1

19.1

Juniper JUNOS 19.1 R1-S2

19.1

Juniper JUNOS 19.1 R1-S3

19.1

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.