CVE-2021-0284 - Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

Severity

75%

Complexity

39%

Confidentiality

60%

A buffer overflow vulnerability in the TCP/IP stack of Juniper Networks Junos OS allows an attacker to send specific sequences of packets to the device thereby causing a Denial of Service (DoS). By repeatedly sending these sequences of packets to the device, an attacker can sustain the Denial of Service (DoS) condition. The device will abnormally shut down as a result of these sent packets. A potential indicator of compromise will be the following message in the log files: "eventd[13955]: SYSTEM_ABNORMAL_SHUTDOWN: System abnormally shut down" This issue is only triggered by traffic destined to the device. Transit traffic will not trigger this issue. This issue affects: Juniper Networks Junos OS 12.3 versions prior to 12.3R12-S19; 15.1 versions prior to 15.1R7-S10; 17.3 versions prior to 17.3R3-S12; 18.4 versions prior to 18.4R3-S9; 19.1 versions prior to 19.1R3-S7; 19.2 versions prior to 19.2R1-S7, 19.2R3-S3; 19.3 versions prior to 19.3R3-S3; 19.4 versions prior to 19.4R3-S5; 20.1 versions prior to 20.1R3-S1; 20.2 versions prior to 20.2R3-S2; 20.3 versions prior to 20.3R3-S1; 20.4 versions prior to 20.4R2-S2, 20.4R3; 21.1 versions prior to 21.1R2; 21.2 versions prior to 21.2R2.

A buffer overflow vulnerability in the TCP/IP stack of Juniper Networks Junos OS allows an attacker to send specific sequences of packets to the device thereby causing a Denial of Service (DoS). By repeatedly sending these sequences of packets to the device, an attacker can sustain the Denial of Service (DoS) condition. The device will abnormally shut down as a result of these sent packets. A potential indicator of compromise will be the following message in the log files: "eventd[13955]: SYSTEM_ABNORMAL_SHUTDOWN: System abnormally shut down" This issue is only triggered by traffic destined to the device. Transit traffic will not trigger this issue. This issue affects: Juniper Networks Junos OS 12.3 versions prior to 12.3R12-S19; 15.1 versions prior to 15.1R7-S10; 17.3 versions prior to 17.3R3-S12; 18.4 versions prior to 18.4R2-S9, 18.4R3-S9; 19.1 versions prior to 19.1R3-S7; 19.2 versions prior to 19.2R1-S7, 19.2R3-S3; 19.3 versions prior to 19.3R2-S7, 19.3R3-S3; 19.4 versions prior to 19.4R3-S5; 20.1 versions prior to 20.1R3-S1; 20.2 versions prior to 20.2R3-S2; 20.3 versions prior to 20.3R3-S1; 20.4 versions prior to 20.4R2-S2, 20.4R3; 21.1 versions prior to 21.1R2; 21.2 versions prior to 21.2R1-S1, 21.2R2.

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

CVSS 2.0 Base Score 7.8. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:N/C:N/I:N/A:C).

Demo Examples

Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

CWE-120

The following code asks the user to enter their last name and then attempts to store the value entered in the last_name array.


               
scanf ("%s", last_name);

The problem with the code above is that it does not restrict or limit the size of the name entered by the user. If the user enters "Very_very_long_last_name" which is 24 characters long, then a buffer overflow will occur since the array can only hold 20 characters total.

Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

CWE-120

The following code attempts to create a local copy of a buffer to perform some manipulations to the data.


               
}
...

However, the programmer does not ensure that the size of the data pointed to by string will fit in the local buffer and blindly copies the data with the potentially dangerous strcpy() function. This may result in a buffer overflow condition if an attacker can influence the contents of the string parameter.

Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

CWE-120

The excerpt below calls the gets() function in C, which is inherently unsafe.


               
}
...

However, the programmer uses the function gets() which is inherently unsafe because it blindly copies all input from STDIN to the buffer without restricting how much is copied. This allows the user to provide a string that is larger than the buffer size, resulting in an overflow condition.

Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

CWE-120

In the following example, a server accepts connections from a client and processes the client request. After accepting a client connection, the program will obtain client information using the gethostbyaddr method, copy the hostname of the client that connected to a local variable and output the hostname of the client to a log file.


               
...
close(serversocket);
}
close(clientsocket);

However, the hostname of the client that connected may be longer than the allocated size for the local hostname variable. This will result in a buffer overflow when copying the client hostname to the local variable using the strcpy method.

Overview

Type

Juniper

First reported 3 years ago

2021-08-17 23:15:00

Last updated 3 years ago

2021-11-17 22:17:00

Affected Software

Juniper JUNOS 12.3

12.3

Juniper Junos 12.3 R1

12.3

Juniper JunOS 12.3 R10

12.3

Juniper JUNOS 12.3 R10-S1

12.3

Juniper JUNOS 12.3 R10-S2

12.3

Juniper Junos 12.3 R11

12.3

Juniper JunOS 12.3 R12

12.3

Juniper JUNOS 12.3 R12-S1

12.3

Juniper JUNOS 12.3 R12-S11

12.3

Juniper JUNOS 12.3 R12-S12

12.3

Juniper JUNOS 12.3 R12-s13

12.3

Juniper JUNOS 12.3 R12-S14

12.3

Juniper JUNOS 12.3 R12-S15

12.3

Juniper JUNOS 12.3 R12-S3

12.3

Juniper JUNOS 12.3 R12-S4

12.3

Juniper JUNOS 12.3 R12-S6

12.3

Juniper Junos 12.3 R12-s8

12.3

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

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.3 R3-S7

17.3

Juniper JUNOS 18.4

18.4

Juniper JunOS 18.4 R1

18.4

Juniper Junos OS 18.4 R1-S1

18.4

Juniper JUNOS 18.4R1-S2

18.4

Juniper JUNOS 18.4 R1-S5

18.4

Juniper JUNOS 18.4 R1-S6

18.4

Juniper JUNOS 18.4R2

18.4

Juniper JUNOS 18.4 R2-S1

18.4

Juniper JUNOS 18.4 R2-S2

18.4

Juniper JUNOS 18.4 R2-S3

18.4

Juniper JUNOS 18.4 R3

18.4

Juniper Junos OS 19.2

19.2

Juniper Junos OS 19.2 R1

19.2

Juniper JUNOS 19.2 R1-S1

19.2

Juniper JUNOS 19.2 R1-S2

19.2

Juniper JUNOS 19.2 R1-S3

19.2

Juniper JUNOS 19.3

19.3

Juniper JUNOS 19.3 R1

19.3

Juniper JUNOS 19.3 R1-S1

19.3

Juniper JUNOS 19.3 R2

19.3

Juniper JUNOS 19.3 R2-S1

19.3

Juniper JUNOS 19.3 R2-S2

19.3

Juniper JUNOS 19.4 R1

19.4

Juniper JUNOS 19.4 R1-S1

19.4

Juniper JUNOS 20.1 R1

20.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.