CVE-2023-50731: Mindsdb Arbitary Write GHSL-2023-182 Vulnerability

HIGH
Advisory Identifier: GHSA-j8w6-2r9h-cxhj
CVSS 9.1
CWE-918 CWE-22
Published
Advisory Summary

CVE-2023-50731 is a HIGH (CVSS 9.1) arbitary write ghsl-2023-182 vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Mindsdb libraries in the PyPI ecosystem. The issue involves arbitary write ghsl-2023-182. Remediation is available by upgrading affected packages to version 23.11.4.1.

CVE-2023-50731 at a Glance

CVE Identifier CVE-2023-50731
GHSA Identifier GHSA-j8w6-2r9h-cxhj
Severity HIGH
CVSS v3.1 Base Score 9.1
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Mindsdb
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.1

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:N/S:U/C:N/I:H/A:H).

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

How to Fix CVE-2023-50731

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

mindsdb fixed: 23.11.4.1
pip install mindsdb>=23.11.4.1
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 mindsdb

How to Check if You Are Affected

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

pip show mindsdb

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Mindsdb, 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

### Impact Issue: Arbitrary file write in file.py (GHSL-2023-183) ### Patches Use mindsdb staging branch or v23.11.4.1

CVE-2023-50731 Affected Mindsdb Versions

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

References

Frequently Asked Questions

What is CVE-2023-50731?
CVE-2023-50731 is a security vulnerability in Mindsdb involving Arbitary write GHSL-2023-182 under CWE-918: Server-Side Request Forgery (SSRF).
Which Mindsdb versions are affected?
Affected versions include releases prior to 23.11.4.1 across affected packages: mindsdb.
What version fixes CVE-2023-50731?
Upgrading to 23.11.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mindsdb affected?
Yes, mindsdb is affected in releases prior to 23.11.4.1. Upgrade your dependency to 23.11.4.1 or later.
What is the CVSS score of CVE-2023-50731?
CVE-2023-50731 has a CVSS v3.1 base score of 9.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2023-50731?
CVE-2023-50731 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2023-50731?
Run the dependency tree command: 'pip show mindsdb'. 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-j8w6-2r9h-cxhj",
  "modified" : "2024-11-22T18:15:01Z",
  "published" : "2023-12-15T04:02:30Z",
  "aliases" : [ "CVE-2023-50731" ],
  "summary" : "GitHub Security Lab (GHSL) Vulnerability Report: Arbitary write GHSL-2023-182 ",
  "details" : "### Impact\n\nIssue: Arbitrary file write in file.py (GHSL-2023-183)\n\n### Patches\n\nUse mindsdb staging branch or v23.11.4.1",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mindsdb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "23.11.4.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 23.7.4.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mindsdb/mindsdb/security/advisories/GHSA-j8w6-2r9h-cxhj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-50731"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mindsdb/mindsdb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mindsdb/mindsdb/blob/1821da719f34c022890c9ff25810218e71c5abbc/mindsdb/api/http/namespaces/file.py#L122-L125"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mindsdb/mindsdb/blob/1821da719f34c022890c9ff25810218e71c5abbc/mindsdb/api/http/namespaces/file.py#L138"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/mindsdb/PYSEC-2023-279.yaml"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2023-182_GHSL-2023-184_mindsdb_mindsdb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-15T04:02:30Z",
    "nvd_published_at" : null
  }
}