Cloudanix VulnDB

CVE-2017-12852

High · 7.5

CVSS

7.5

EPSS

2.7%

Published

Aug 15, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in a common software component could allow an attacker to make applications unresponsive simply by sending a specific kind of malformed data.

Exploit Available
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Denial of service
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The vulnerability lies in the `numpy.pad` function, which lacks proper input validation. When an empty list or ndarray is passed as an argument, the function enters an infinite loop, leading to 100% CPU utilization and causing the process to become unresponsive, resulting in a denial of service.

Why it matters to the business

Applications using the vulnerable NumPy library can be targeted by a denial-of-service (DoS) attack. A successful attack would render the application or service unavailable, disrupting business operations, impacting customer-facing services, and potentially causing financial or reputational damage due to downtime.

How an attack unfolds

An unauthenticated remote attacker can exploit this vulnerability by identifying an application that uses a vulnerable version of NumPy and passes user-controllable input to the `numpy.pad` function. The attacker sends a specially crafted request containing an empty list or array as input. The application processes this malicious input, triggering the infinite loop in the `numpy.pad` function. This causes the application's process to consume all available CPU resources, effectively hanging the application and resulting in a denial of service.

How to fix it

Upgrade the NumPy library to version 1.13.3 or later. For the listed affected products, such as `opentelemetry-collector`, update to the specified fixed versions (e.g., `0.102.1-r0` or newer). If an immediate upgrade is not possible, implement input validation at the application level to ensure that empty arrays are not passed to the `numpy.pad` function.

How to confirm the fix worked

To validate the fix, verify that all instances of the NumPy library have been upgraded to a patched version (1.13.3 or newer). You can also create a test script in the application's environment that attempts to call `numpy.pad` with an empty list (e.g., `numpy.pad([], (1,1))`). On a vulnerable system, this will cause the script to hang and consume high CPU. On a patched system, it should raise a `ValueError`.

Typical attack path

  1. Attacker identifies a public-facing application using a vulnerable version of the NumPy library.
  2. Attacker discovers an input field or API endpoint that passes data to the numpy.pad function.
  3. Attacker crafts and sends a request with an empty list or array as input to the identified endpoint.
  4. The target application processes the input, triggering an infinite loop within the NumPy library.
  5. The application process consumes 100% CPU, becomes unresponsive, and causes a denial of service.

How to detect it

Detecting exploitation of this vulnerability relies on monitoring for its symptoms. Look for sustained, abnormally high CPU usage (near 100%) in processes known to use the NumPy library. Correlate these CPU spikes with application logs that may show process hangs, unresponsiveness, or frequent restarts by a process supervisor. Web server or application access logs might show unusual requests with empty parameters, but this is highly dependent on the specific application's logging configuration.

What your security team should do

  • Identify all applications and systems using vulnerable versions of NumPy (1.13.1 and older) using a software bill of materials (SBoM) or dependency scanner.
  • Prioritize patching for publicly accessible or business-critical applications that accept external input.
  • Apply the recommended updates to the NumPy library or dependent packages like opentelemetry-collector.
  • If patching is delayed, advise development teams to implement temporary input validation controls to block empty arrays from reaching the vulnerable function.

The record

The numpy.pad function in Numpy 1.13.1 and older versions is missing input validation. An empty list or ndarray will stick into an infinite loop, which can allow attackers to cause a DoS attack.

Affected packages

Ecosystem Package Introduced Fixed
PyPI numpy 0 1.13.3
Debian:10 python-numpy 0 1:1.14.3-1
SUSE:Linux Enterprise Module for HPC 12 python-numpy_1_13_3-gnu-hpc 0 1.13.3-4.6.1
SUSE:Linux Enterprise Server 12 SP5 python-numpy 0 1.8.0-5.19.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 python-numpy 0 1.8.0-5.19.1
SUSE:Linux Enterprise Software Development Kit 12 SP5 python-numpy 0 1.8.0-5.19.1
Ubuntu:16.04:LTS python-numpy 0 No fix
Ubuntu:18.04:LTS python-numpy 0 No fix
Ubuntu:20.04:LTS python-numpy 0 1:1.16.2-1ubuntu1
Ubuntu:Pro:16.04:LTS python-numpy 0 No fix
Ubuntu:Pro:18.04:LTS python-numpy 0 No fix
openSUSE:Tumbleweed python-numpy 0 1.21.2-1.1
openSUSE:Tumbleweed python-numpy 0 1.26.2-5.1
openSUSE:Tumbleweed python-numpy1 0 1.26.4-1.1

Related vulnerabilities