CVE-2023-49795: Mindsdb Server-Side Request Forgery Vulnerability

MODERATE
Advisory Identifier: GHSA-34mr-6q8x-g9r6
CVSS 6.5
CWE-918
Published
Advisory Summary

CVE-2023-49795 is a MODERATE (CVSS 6.5) server-side request forgery vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Mindsdb libraries in the PyPI ecosystem. The issue involves server-side request forgery in mindsdb. Remediation is available by upgrading affected packages to version 23.11.4.1.

CVE-2023-49795 at a Glance

CVE Identifier CVE-2023-49795
GHSA Identifier GHSA-34mr-6q8x-g9r6
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Mindsdb
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:N/UI:N/S:U/C:L/I:L/A:N).

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 Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-49795

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-49795, 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 The put method in `mindsdb/mindsdb/api/http/namespaces/file.py` does not validate the user-controlled URL in the source variable and uses it to create arbitrary requests on line 115, which allows Server-side request forgery (SSRF). This issue may lead to Information Disclosure. The SSRF allows for forging arbitrary network requests from the MindsDB server. It can be used to scan nodes in internal networks for open ports that may not be accessible externally, as well as scan for existing files on the internal network. It allows for retrieving files with csv, xls, xlsx, json or parquet extensions, which will be viewable via MindsDB GUI. For any other existing files, it is a blind SSRF. ### Patches Use mindsdb staging branch or v23.11.4.1 ### References * GHSL-2023-182 [SSRF prevention cheatsheet](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html).

CVE-2023-49795 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-49795?
CVE-2023-49795 is a security vulnerability in Mindsdb involving Server-Side Request Forgery in mindsdb 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-49795?
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-49795?
CVE-2023-49795 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2023-49795?
CVE-2023-49795 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-49795?
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-34mr-6q8x-g9r6",
  "modified" : "2024-11-22T18:14:00Z",
  "published" : "2023-12-12T00:48:48Z",
  "aliases" : [ "CVE-2023-49795" ],
  "summary" : "Server-Side Request Forgery in mindsdb",
  "details" : "### Impact\n\nThe put method in `mindsdb/mindsdb/api/http/namespaces/file.py` does not validate the user-controlled URL in the source variable and uses it to create arbitrary requests on line 115, which allows Server-side request forgery (SSRF). This issue may lead to Information Disclosure. The SSRF allows for forging arbitrary network requests from the MindsDB server. It can be used to scan nodes in internal networks for open ports that may not be accessible externally, as well as scan for existing files on the internal network. It allows for retrieving files with csv, xls, xlsx, json or parquet extensions, which will be viewable via MindsDB GUI. For any other existing files, it is a blind SSRF.\n \n### Patches\n\nUse mindsdb staging branch or v23.11.4.1\n\n### References\n\n* GHSL-2023-182\n[SSRF prevention cheatsheet](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mindsdb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "23.11.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mindsdb/mindsdb/security/advisories/GHSA-34mr-6q8x-g9r6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-49795"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mindsdb/mindsdb/commit/8d13c9c28ebcf3b36509eb679378004d4648d8fe"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mindsdb/mindsdb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/mindsdb/PYSEC-2023-277.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-12T00:48:48Z",
    "nvd_published_at" : "2023-12-11T19:15:09Z"
  }
}