CVE-2023-28859: Redis Redis-py Race Condition Due To Vulnerability

HIGH
Advisory Identifier: GHSA-8fww-64cx-x8p5
CVSS 6.5
CWE-459
Published
Advisory Summary

CVE-2023-28859 is a HIGH (CVSS 6.5) redis-py race condition due to vulnerability (CWE-459: Incomplete Cleanup) affecting Redis libraries in the PyPI ecosystem. The issue involves redis-py race condition due to incomplete fix. Remediation is available by upgrading affected packages to version 4.5.4, 4.4.4.

CVE-2023-28859 at a Glance

CVE Identifier CVE-2023-28859
GHSA Identifier GHSA-8fww-64cx-x8p5
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-459: Incomplete Cleanup
Affected Product Redis
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2023-28859

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

redis fixed: 4.5.4
pip install redis>=4.5.4
redis fixed: 4.4.4
pip install redis>=4.4.4
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 redis

How to Check if You Are Affected

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

pip show redis

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-459: Incomplete Cleanup, where the product does not properly "clean up" and remove temporary or supporting resources after they have been used. In Redis, 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

redis-py through 4.5.3 and 4.4.3 leaves a connection open after canceling an async Redis command at an inopportune time (in the case of a non-pipeline operation), and can send response data to the client of an unrelated request. NOTE: this issue exists because of an incomplete fix for CVE-2023-28858.

CVE-2023-28859 Affected Redis Versions

2 component(s)
Fixed Versions:
4.5.44.4.4
Product / Package Ecosystem Affected Versions Fixed Version
redis
PyPI
≥ 4.5.0
< 4.5.4
4.5.4
redis
PyPI
≥ 4.2.0
< 4.4.4
4.4.4

References

Frequently Asked Questions

What is CVE-2023-28859?
CVE-2023-28859 is a security vulnerability in Redis involving redis-py Race Condition due to incomplete fix under CWE-459: Incomplete Cleanup.
Which Redis versions are affected?
Affected versions include releases prior to 4.5.4, 4.4.4 across affected packages: redis.
What version fixes CVE-2023-28859?
Upgrading to 4.5.4, 4.4.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is redis affected?
Yes, redis is affected in releases prior to 4.5.4, 4.4.4. Upgrade your dependency to 4.5.4, 4.4.4 or later.
What is the CVSS score of CVE-2023-28859?
CVE-2023-28859 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2023-28859?
CVE-2023-28859 is classified under CWE-459: Incomplete Cleanup (The product does not properly "clean up" and remove temporary or supporting resources after they have been used.).
How can I check PyPI dependencies for CVE-2023-28859?
Run the dependency tree command: 'pip show redis'. 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-8fww-64cx-x8p5",
  "modified" : "2024-10-25T21:45:05Z",
  "published" : "2023-03-26T21:30:23Z",
  "aliases" : [ "CVE-2023-28859" ],
  "summary" : "redis-py Race Condition due to incomplete fix",
  "details" : "redis-py through 4.5.3 and 4.4.3 leaves a connection open after canceling an async Redis command at an inopportune time (in the case of a non-pipeline operation), and can send response data to the client of an unrelated request. NOTE: this issue exists because of an incomplete fix for CVE-2023-28858.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "redis"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.5.0"
      }, {
        "fixed" : "4.5.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "redis"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0"
      }, {
        "fixed" : "4.4.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-28859"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/issues/2665"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/pull/1899"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/pull/2641"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/pull/2666"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/pull/2671"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/commit/66a4d6b2a493dd3a20cc299ab5fef3c14baad965"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/commit/b3c89acd0ffe8303649ad8207bc911b1d6a033eb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/redis/PYSEC-2023-46.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/redis/redis-py"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/releases/tag/v4.4.4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/redis/redis-py/releases/tag/v4.5.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-459" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-27T21:31:52Z",
    "nvd_published_at" : "2023-03-26T19:15:00Z"
  }
}