CVE-2018-0004 - Uncontrolled Resource Consumption

Severity

71%

Complexity

86%

Confidentiality

115%

A sustained sequence of different types of normal transit traffic can trigger a high CPU consumption denial of service condition in the Junos OS register and schedule software interrupt handler subsystem when a specific command is issued to the device. This affects one or more threads and conversely one or more running processes running on the system. Once this occurs, the high CPU event(s) affects either or both the forwarding and control plane. As a result of this condition the device can become inaccessible in either or both the control and forwarding plane and stops forwarding traffic until the device is rebooted. The issue will reoccur after reboot upon receiving further transit traffic. Score: 5.7 MEDIUM (CVSS:3.0/AV:A/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H) For network designs utilizing layer 3 forwarding agents or other ARP through layer 3 technologies, the score is slightly higher. Score: 6.5 MEDIUM (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H) If the following entry exists in the RE message logs then this may indicate the issue is present. This entry may or may not appear when this issue occurs. /kernel: Expensive timeout(9) function: Affected releases are Juniper Networks Junos OS: 12.1X46 versions prior to 12.1X46-D50; 12.3X48 versions prior to 12.3X48-D30; 12.3R versions prior to 12.3R12-S7; 14.1 versions prior to 14.1R8-S4, 14.1R9; 14.1X53 versions prior to 14.1X53-D30, 14.1X53-D34; 14.2 versions prior to 14.2R8; 15.1 versions prior to 15.1F6, 15.1R3; 15.1X49 versions prior to 15.1X49-D40; 15.1X53 versions prior to 15.1X53-D31, 15.1X53-D33, 15.1X53-D60. No other Juniper Networks products or platforms are affected by this issue.

A sustained sequence of different types of normal transit traffic can trigger a high CPU consumption denial of service condition in the Junos OS register and schedule software interrupt handler subsystem when a specific command is issued to the device. This affects one or more threads and conversely one or more running processes running on the system. Once this occurs, the high CPU event(s) affects either or both the forwarding and control plane. As a result of this condition the device can become inaccessible in either or both the control and forwarding plane and stops forwarding traffic until the device is rebooted. The issue will reoccur after reboot upon receiving further transit traffic. Score: 5.7 MEDIUM (CVSS:3.0/AV:A/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H) For network designs utilizing layer 3 forwarding agents or other ARP through layer 3 technologies, the score is slightly higher. Score: 6.5 MEDIUM (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H) If the following entry exists in the RE message logs then this may indicate the issue is present. This entry may or may not appear when this issue occurs. /kernel: Expensive timeout(9) function: Affected releases are Juniper Networks Junos OS: 12.1X46 versions prior to 12.1X46-D50; 12.3X48 versions prior to 12.3X48-D30; 12.3R versions prior to 12.3R12-S7; 14.1 versions prior to 14.1R8-S4, 14.1R9; 14.1X53 versions prior to 14.1X53-D30, 14.1X53-D34; 14.2 versions prior to 14.2R8; 15.1 versions prior to 15.1F6, 15.1R3; 15.1X49 versions prior to 15.1X49-D40; 15.1X53 versions prior to 15.1X53-D31, 15.1X53-D33, 15.1X53-D60. No other Juniper Networks products or platforms are affected by this issue.

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

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

Demo Examples

Uncontrolled Resource Consumption

CWE-400

The following example demonstrates the weakness.


               
}
}
}
...
Thread.currentThread().interrupt();// postpone response
...
new Thread(loop).start();
}
}
}
r.run();
...

There are no limits to runnables. Potentially an attacker could cause resource problems very quickly.

Uncontrolled Resource Consumption

CWE-400

This code allocates a socket and forks each time it receives a new connection.


               
}
pid = fork();

The program does not track how many connections have been made, and it does not limit the number of connections. Because forking is a relatively expensive operation, an attacker would be able to cause the system to run out of CPU, processes, or memory by making a large number of connections. Alternatively, an attacker could consume all available connections, preventing others from accessing the system remotely.

Uncontrolled Resource Consumption

CWE-400

In the following example a server socket connection is used to accept a request to store data on the local file system using a specified filename. The method openSocketConnection establishes a server socket to accept requests from a client. When a client establishes a connection to this service the getNextMessage method is first used to retrieve from the socket the name of the file to store the data, the openFileToWrite method will validate the filename and open a file to write to on the local file system. The getNextMessage is then used within a while loop to continuously read data from the socket and output the data to the file until there is no longer any data from the socket.


               
}
closeSocket(socket);
return(FAIL);
closeFile();
}
break;

This example creates a situation where data can be dumped to a file on the local file system without any limits on the size of the file. This could potentially exhaust file or disk resources and/or limit other clients' ability to access the service.

Uncontrolled Resource Consumption

CWE-400

In the following example, the processMessage method receives a two dimensional character array containing the message to be processed. The two-dimensional character array contains the length of the message in the first character array and the message body in the second character array. The getMessageLength method retrieves the integer value of the length from the first character array. After validating that the message length is greater than zero, the body character array pointer points to the start of the second character array of the two-dimensional character array and memory is allocated for the new body character array.


               
}/* process message accepts a two-dimensional character array of the form [length][body] containing the message to be processed */
}
return(SUCCESS);
return(FAIL);

This example creates a situation where the length of the body character array can be very large and will consume excessive memory, exhausting system resources. This can be avoided by restricting the length of the second character array with a maximum length check

Also, consider changing the type from 'int' to 'unsigned int', so that you are always guaranteed that the number is positive. This might not be possible if the protocol specifically requires allowing negative values, or if you cannot control the return value from getMessageLength(), but it could simplify the check to ensure the input is positive, and eliminate other errors such as signed-to-unsigned conversion errors (CWE-195) that may occur elsewhere in the code.


               
if ((length > 0) && (length < MAX_LENGTH)) {...}

Uncontrolled Resource Consumption

CWE-400

In the following example, a server object creates a server socket and accepts client connections to the socket. For every client connection to the socket a separate thread object is generated using the ClientSocketThread class that handles request made by the client through the socket.


               
}
} catch (IOException ex) {...}
serverSocket.close();
t.start();

In this example there is no limit to the number of client connections and client threads that are created. Allowing an unlimited number of client connections and threads could potentially overwhelm the system and system resources.

The server should limit the number of client connections and the client threads that are created. This can be easily done by creating a thread pool object that limits the number of threads that are generated.


               
}
} catch (IOException ex) {...}
serverSocket.close();
pool.execute(t);

Overview

Type

Juniper

First reported 7 years ago

2018-01-10 22:29:00

Last updated 5 years ago

2019-10-09 23:30:00

Affected Software

Juniper JUNOS 12.1X46

12.1x46

Juniper Junos 12.1x46 D10

12.1x46

Juniper Junos 12.1x46 D15

12.1x46

Juniper JUNOS 12.1X46-D20

12.1x46

Juniper Junos 12.1x46 D25

12.1x46

Juniper JunOS 12.1x46 D30

12.1x46

Juniper JunOS 12.1x46 D35

12.1x46

Juniper JunOS 12.1x46 D40

12.1x46

Juniper Junos 12.1X46 D45

12.1x46

Juniper JunOS 12.3x48 D10

12.3x48

Juniper JunOS 12.3x48 D15

12.3x48

Juniper Junos OS 12.3X48 D20

12.3x48

Juniper Junos 12.3X48 D25

12.3x48

Juniper Junos 12.3 R1

12.3

Juniper Junos 12.3 R11

12.3

Juniper JunOS 12.3 R12

12.3

Juniper Junos 12.3 R2

12.3

Juniper Junos 12.3 R3

12.3

Juniper Junos 12.3 R4

12.3

Juniper Junos 12.3 R5

12.3

Juniper Junos 12.3 R6

12.3

Juniper JUNOS 12.3R7

12.3

Juniper Junos 12.3 R8

12.3

Juniper JunOS 12.3 R9

12.3

Juniper JUNOS 14.1

14.1

Juniper JUNOS 14.1R1

14.1

Juniper Junos 14.1 R2

14.1

Juniper Junos 14.1 R3

14.1

Juniper JunOS 14.1 R4

14.1

Juniper Junos 14.1 R5

14.1

Juniper Junos 14.1 R6

14.1

Juniper Junos 14.1 R7

14.1

Juniper JunOS 14.1 R9

14.1

Juniper JunOS 14.1x53

14.1x53

Juniper JunOS 14.1x53 D10

14.1x53

Juniper JunOS 14.1x53 D15

14.1x53

Juniper JunOS 14.1x53 D16

14.1x53

Juniper JunOS 14.1x53 D25

14.1x53

Juniper JunOS 14.1x53 D26

14.1x53

Juniper Junos 14.1X53 D27

14.1x53

Juniper Junos 14.2 R1

14.2

Juniper Junos 14.2 R2

14.2

Juniper Junos 14.2 R3

14.2

Juniper Junos 14.2 R4

14.2

Juniper Junos 14.2 R5

14.2

Juniper Junos 14.2 R6

14.2

Juniper JunOS 14.2 R7

14.2

Juniper Junos 15.1 A1

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 R3

15.1

Juniper JunOS 15.1x49 D10

15.1x49

Juniper JunOS 15.1x49 D20

15.1x49

Juniper JunOS 15.1X49 D30

15.1x49

Juniper Junos 15.1X49 D35

15.1x49

Juniper Junos OS 15.1X53 D10

15.1x53

Juniper Junos 15.1X53 D20

15.1x53

Juniper Junos 15.1X53 D21

15.1x53

Juniper JunOS 15.1X53 D210

15.1x53

Juniper JunOS 15.1X53 D25

15.1x53

Juniper Junos 15.1X53 D30

15.1x53

Juniper Junos 15.1X53 D33

15.1x53

Juniper JunOS 15.1X53 D60

15.1x53

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.