CVE-2023-52304: PaddlePaddle PaddlePaddle Stack Overflow Vulnerability

HIGH
Advisory Identifier: GHSA-4rrv-8gcp-24v8
CVSS 8.2
CWE-120 CWE-787
Published
Advisory Summary

CVE-2023-52304 is a HIGH (CVSS 8.2) paddlepaddle stack overflow vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting PaddlePaddle libraries in the PyPI ecosystem. The issue involves paddlepaddle stack overflow in paddle.searchsorted. Remediation is available by upgrading affected packages to version 2.6.0.

CVE-2023-52304 at a Glance

CVE Identifier CVE-2023-52304
GHSA Identifier GHSA-4rrv-8gcp-24v8
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product PaddlePaddle
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2023-52304

To remediate this vulnerability, upgrade all affected PaddlePaddle dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

PaddlePaddle fixed: 2.6.0
pip install PaddlePaddle>=2.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show PaddlePaddle

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-52304, inspect your installed packages using pip:

pip show PaddlePaddle

Analyze the terminal output to locate any version of PaddlePaddle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.0), your application is affected.

Note: The pip show PaddlePaddle command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. In PaddlePaddle, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Stack overflow in paddle.searchsorted in PaddlePaddle before 2.6.0. This flaw can lead to a denial of service, or even more damage.

CVE-2023-52304 Affected PaddlePaddle Versions

1 component(s)
Fixed Versions:
2.6.0
Product / Package Ecosystem Affected Versions Fixed Version
PaddlePaddle
PyPI
< 2.6.0
2.6.0

References

Frequently Asked Questions

What is CVE-2023-52304?
CVE-2023-52304 is a security vulnerability in PaddlePaddle involving PaddlePaddle stack overflow in paddle.searchsorted under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which PaddlePaddle versions are affected?
Affected versions include releases prior to 2.6.0 across affected packages: PaddlePaddle.
What version fixes CVE-2023-52304?
Upgrading to 2.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is PaddlePaddle affected?
Yes, PaddlePaddle is affected in releases prior to 2.6.0. Upgrade your dependency to 2.6.0 or later.
What is the CVSS score of CVE-2023-52304?
CVE-2023-52304 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:L.
What CWE is associated with CVE-2023-52304?
CVE-2023-52304 is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.).
How can I check PyPI dependencies for CVE-2023-52304?
Run the dependency tree command: 'pip show PaddlePaddle'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4rrv-8gcp-24v8",
  "modified" : "2024-11-22T18:17:19Z",
  "published" : "2024-01-03T09:30:33Z",
  "aliases" : [ "CVE-2023-52304" ],
  "summary" : "PaddlePaddle stack overflow in paddle.searchsorted",
  "details" : "Stack overflow in paddle.searchsorted in PaddlePaddle before 2.6.0. This flaw can lead to a denial of service, or even more damage.\n\n\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "PaddlePaddle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-52304"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PaddlePaddle/Paddle/commit/19da5c0c4d8c5e4dfef2a92e24141c3f51884dcc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/PaddlePaddle/Paddle"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PaddlePaddle/Paddle/blob/develop/security/advisory/pdsa-2023-013.md"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/paddlepaddle/PYSEC-2024-136.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-120", "CWE-787" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-03T19:40:54Z",
    "nvd_published_at" : "2024-01-03T09:15:09Z"
  }
}