CVE Vulnerabilities

CVE-2021-0217

Allocation of Resources Without Limits or Throttling

Published: Jan 15, 2021 | Modified: Aug 05, 2022
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
3.3 LOW
AV:A/AC:L/Au:N/C:N/I:N/A:P
RedHat/V2
RedHat/V3
Ubuntu

A vulnerability in processing of certain DHCP packets from adjacent clients on EX Series and QFX Series switches running Juniper Networks Junos OS with DHCP local/relay server configured may lead to exhaustion of DMA memory causing a Denial of Service (DoS). Over time, exploitation of this vulnerability may cause traffic to stop being forwarded, or to crashing of the fxpc process. When Packet DMA heap utilization reaches 99%, the system will become unstable. Packet DMA heap utilization can be monitored through the following command: user@junos# request pfe execute target fpc0 timeout 30 command show heap ID Base Total(b) Free(b) Used(b) % Name – ———- ———– ———– ———– — ———– 0 213301a8 536870488 387228840 149641648 27 Kernel 1 91800000 8388608 3735120 4653488 55 DMA 2 92000000 75497472 74452192 1045280 1 PKT DMA DESC 3 d330000 335544320 257091400 78452920 23 Bcm_sdk 4 96800000 184549376 2408 184546968 99 Packet DMA <— 5 903fffe0 20971504 20971504 0 0 Blob An indication of the issue occurring may be observed through the following log messages: Dec 10 08:07:00.124 2020 hostname fpc0 brcm_pkt_buf_alloc:523 (buf alloc) failed allocating packet buffer Dec 10 08:07:00.126 2020 hostname fpc0 (buf alloc) failed allocating packet buffer Dec 10 08:07:00.128 2020 hostname fpc0 brcm_pkt_buf_alloc:523 (buf alloc) failed allocating packet buffer Dec 10 08:07:00.130 2020 hostnameC fpc0 (buf alloc) failed allocating packet buffer This issue affects Juniper Networks Junos OS on EX Series and QFX Series: 17.4R3 versions prior to 17.4R3-S3; 18.1R3 versions between 18.1R3-S6 and 18.1R3-S11; 18.2R3 versions prior to 18.2R3-S6; 18.3R3 versions prior to 18.3R3-S4; 18.4R2 versions prior to 18.4R2-S5; 18.4R3 versions prior to 18.4R3-S6; 19.1 versions between 19.1R2 and 19.1R3-S3; 19.2 versions prior to 19.2R3-S1; 19.3 versions prior to 19.3R2-S5, 19.3R3; 19.4 versions prior to 19.4R2-S2, 19.4R3; 20.1 versions prior to 20.1R2; 20.2 versions prior to 20.2R1-S2, 20.2R2. Junos OS versions prior to 17.4R3 are unaffected by this vulnerability.

Weakness

The product allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor.

Affected Software

Name Vendor Start Version End Version
Junos Juniper 17.4-r3 (including) 17.4-r3 (including)
Junos Juniper 17.4-r3-s1 (including) 17.4-r3-s1 (including)
Junos Juniper 17.4-r3-s2 (including) 17.4-r3-s2 (including)
Junos Juniper 18.1-r3-s10 (including) 18.1-r3-s10 (including)
Junos Juniper 18.1-r3-s7 (including) 18.1-r3-s7 (including)
Junos Juniper 18.1-r3-s8 (including) 18.1-r3-s8 (including)
Junos Juniper 18.1-r3-s9 (including) 18.1-r3-s9 (including)
Junos Juniper 18.2-r3 (including) 18.2-r3 (including)
Junos Juniper 18.2-r3-s1 (including) 18.2-r3-s1 (including)
Junos Juniper 18.2-r3-s2 (including) 18.2-r3-s2 (including)
Junos Juniper 18.2-r3-s3 (including) 18.2-r3-s3 (including)
Junos Juniper 18.2-r3-s4 (including) 18.2-r3-s4 (including)
Junos Juniper 18.2-r3-s5 (including) 18.2-r3-s5 (including)
Junos Juniper 18.3-r3 (including) 18.3-r3 (including)
Junos Juniper 18.3-r3-s1 (including) 18.3-r3-s1 (including)
Junos Juniper 18.3-r3-s2 (including) 18.3-r3-s2 (including)
Junos Juniper 18.3-r3-s3 (including) 18.3-r3-s3 (including)
Junos Juniper 18.4-r2 (including) 18.4-r2 (including)
Junos Juniper 18.4-r2-s1 (including) 18.4-r2-s1 (including)
Junos Juniper 18.4-r2-s2 (including) 18.4-r2-s2 (including)
Junos Juniper 18.4-r2-s3 (including) 18.4-r2-s3 (including)
Junos Juniper 18.4-r2-s4 (including) 18.4-r2-s4 (including)
Junos Juniper 19.1-r2-s1 (including) 19.1-r2-s1 (including)
Junos Juniper 19.1-r3 (including) 19.1-r3 (including)
Junos Juniper 19.1-r3-s1 (including) 19.1-r3-s1 (including)
Junos Juniper 19.1-r3-s2 (including) 19.1-r3-s2 (including)
Junos Juniper 19.2 (including) 19.2 (including)
Junos Juniper 19.2-r1 (including) 19.2-r1 (including)
Junos Juniper 19.2-r1-s1 (including) 19.2-r1-s1 (including)
Junos Juniper 19.2-r1-s2 (including) 19.2-r1-s2 (including)
Junos Juniper 19.2-r1-s3 (including) 19.2-r1-s3 (including)
Junos Juniper 19.2-r1-s4 (including) 19.2-r1-s4 (including)
Junos Juniper 19.2-r2 (including) 19.2-r2 (including)
Junos Juniper 19.2-r3 (including) 19.2-r3 (including)
Junos Juniper 19.3 (including) 19.3 (including)
Junos Juniper 19.3-r1 (including) 19.3-r1 (including)
Junos Juniper 19.3-r1-s1 (including) 19.3-r1-s1 (including)
Junos Juniper 19.3-r2 (including) 19.3-r2 (including)
Junos Juniper 19.3-r2-s1 (including) 19.3-r2-s1 (including)
Junos Juniper 19.3-r2-s2 (including) 19.3-r2-s2 (including)
Junos Juniper 19.3-r2-s3 (including) 19.3-r2-s3 (including)
Junos Juniper 19.3-r2-s4 (including) 19.3-r2-s4 (including)
Junos Juniper 19.4-r1 (including) 19.4-r1 (including)
Junos Juniper 19.4-r1-s1 (including) 19.4-r1-s1 (including)
Junos Juniper 19.4-r1-s2 (including) 19.4-r1-s2 (including)
Junos Juniper 19.4-r2 (including) 19.4-r2 (including)
Junos Juniper 19.4-r2-s1 (including) 19.4-r2-s1 (including)
Junos Juniper 20.1-r1 (including) 20.1-r1 (including)
Junos Juniper 20.1-r1-s1 (including) 20.1-r1-s1 (including)
Junos Juniper 20.1-r1-s2 (including) 20.1-r1-s2 (including)
Junos Juniper 20.1-r1-s3 (including) 20.1-r1-s3 (including)
Junos Juniper 20.2-r1 (including) 20.2-r1 (including)
Junos Juniper 20.2-r1-s1 (including) 20.2-r1-s1 (including)

Extended Description

Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.

Potential Mitigations

  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”

  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

  • Mitigation of resource exhaustion attacks requires that the target system either:

  • The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question.

  • The second solution can be difficult to effectively institute – and even when properly done, it does not provide a full solution. It simply requires more resources on the part of the attacker.

  • If the program must fail, ensure that it fails gracefully (fails closed). There may be a temptation to simply let the program fail poorly in cases such as low memory conditions, but an attacker may be able to assert control before the software has fully exited. Alternately, an uncontrolled failure could cause cascading problems with other downstream components; for example, the program could send a signal to a downstream process so the process immediately knows that a problem has occurred and has a better chance of recovery.

  • Ensure that all failures in resource allocation place the system into a safe posture.

  • Use resource-limiting settings provided by the operating system or environment. For example, when managing system resources in POSIX, setrlimit() can be used to set limits for certain types of resources, and getrlimit() can determine how many resources are available. However, these functions are not available on all operating systems.

  • When the current levels get close to the maximum that is defined for the application (see CWE-770), then limit the allocation of further resources to privileged users; alternately, begin releasing resources for less-privileged users. While this mitigation may protect the system from attack, it will not necessarily stop attackers from adversely impacting other users.

  • Ensure that the application performs the appropriate error checks and error handling in case resources become unavailable (CWE-703).

References