VYPR
Moderate severityNVD Advisory· Published Jan 3, 2024· Updated Jun 6, 2025

FPE in paddle.nanmedian

CVE-2023-38674

Description

FPE in paddle.nanmedian in PaddlePaddle before 2.6.0. This flaw can cause a runtime crash and a denial of service.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A floating-point exception in PaddlePaddle's `paddle.nanmedian` function before 2.6.0 causes a crash and denial of service when the input tensor has a zero-size dimension.

A floating-point exception (FPE) vulnerability exists in the paddle.nanmedian function of PaddlePaddle, an open-source deep learning platform. The root cause is a divide-by-zero operation that occurs when the function processes an input tensor whose last dimension size is zero [1][2]. The commit that fixes the issue adds a check to enforce that the stride (i.e., the size of the last dimension) is not zero, throwing an InvalidArgument error instead of performing the division [4]. This flaw affects versions before 2.6.0 [2].

To exploit this vulnerability, an attacker would need to supply a crafted tensor with a zero-length dimension to the paddle.nanmedian function. No special privileges or prior authentication are required beyond the ability to interact with the PaddlePaddle API [1][2]. The attack vector is local, but could be triggered indirectly if a user loads a malicious model or data that calls the vulnerable function [2].

If successfully triggered, the division by zero causes a runtime crash, leading to a denial of service (DoS) condition [2]. The impact is limited to availability; there is no evidence of data corruption or privilege escalation. The vulnerability is listed in the PyPA advisory database with a severity score of 7.5 (CVSS 3.1) [3].

A fix was merged into the PaddlePaddle GitHub repository on December 6, 2023, via commit 690ffe814dbfc5054d4e92df878687fd638fe3a5, and is included in the 2.6.0 release [4]. Users are strongly advised to upgrade to PaddlePaddle 2.6.0 or later. There is no known workaround for earlier versions beyond upgrading [2].

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
PaddlePaddlePyPI
< 2.6.02.6.0

Affected products

2

Patches

1
690ffe814dbf

fix div 0 bug (#55644)

https://github.com/PaddlePaddle/PaddlewanghuancoderJul 25, 2023via ghsa
3 files changed · +28 0
  • paddle/phi/kernels/cpu/nanmedian_kernel.cc+8 0 modified
    @@ -116,6 +116,14 @@ void ProcessMedianKernel(const Context& dev_ctx,
       auto x_dim = x.dims();
       int64_t x_rank = x_dim.size();
       int64_t stride = x_dim[x_rank - 1];
    +
    +  PADDLE_ENFORCE_NE(
    +      stride,
    +      0,
    +      phi::errors::InvalidArgument("The input Tensor x's shape[-1] should not "
    +                                   "be 0, but shape is %s now.",
    +                                   x_dim));
    +
       int64_t pre_dim = numel / stride;
       int64_t i = 0;
     
    
  • paddle/phi/kernels/gpu/matrix_rank_tol_kernel.cu+12 0 modified
    @@ -340,6 +340,18 @@ void MatrixRankTolKernel(const Context& dev_ctx,
       auto dim_out = out->dims();
       int rows = dim_x[dim_x.size() - 2];
       int cols = dim_x[dim_x.size() - 1];
    +  PADDLE_ENFORCE_NE(
    +      rows,
    +      0,
    +      phi::errors::InvalidArgument("The input Tensor x's shape[-2] should not "
    +                                   "be 0, but shape is %s now.",
    +                                   dim_x));
    +  PADDLE_ENFORCE_NE(
    +      cols,
    +      0,
    +      phi::errors::InvalidArgument("The input Tensor x's shape[-1] should not "
    +                                   "be 0, but shape is %s now.",
    +                                   dim_x));
       int k = std::min(rows, cols);
       auto numel = x.numel();
       int batches = numel / (rows * cols);
    
  • paddle/phi/kernels/gpu/nanmedian_kernel.cu+8 0 modified
    @@ -149,6 +149,14 @@ void ProcessMedianKernel(const Context& dev_ctx,
       auto x_dim = x.dims();
       int64_t x_rank = x_dim.size();
       int64_t stride = x_dim[x_rank - 1];
    +
    +  PADDLE_ENFORCE_NE(
    +      stride,
    +      0,
    +      phi::errors::InvalidArgument("The input Tensor x's shape[-1] should not "
    +                                   "be 0, but shape is %s now.",
    +                                   x_dim));
    +
       int64_t pre_dim = numel / stride;
       int64_t i = 0;
     
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.