CVE-2024-30265: Voila Voilà Local File Inclusion Vulnerability

HIGH
Advisory Identifier: GHSA-2q59-h24c-w6fg
CVSS 7.5
CWE-73
Published
Advisory Summary

CVE-2024-30265 is a HIGH (CVSS 7.5) voilà local file inclusion vulnerability (CWE-73: External Control of File Name or Path) affecting Voila libraries in the PyPI ecosystem. The issue involves voilà local file inclusion. Remediation is available by upgrading affected packages to version 0.2.17, 0.3.8, 0.4.4, 0.5.6.

CVE-2024-30265 at a Glance

CVE Identifier CVE-2024-30265
GHSA Identifier GHSA-2q59-h24c-w6fg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Voila
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.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:H/I:N/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 High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-30265

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

voila fixed: 0.2.17
pip install voila>=0.2.17
voila fixed: 0.3.8
pip install voila>=0.3.8
voila fixed: 0.4.4
pip install voila>=0.4.4
voila fixed: 0.5.6
pip install voila>=0.5.6
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 voila

How to Check if You Are Affected

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

pip show voila

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Voila, 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 Any deployment of voilà dashboard allow local file inclusion, that is to say any file on a filesystem that is readable by the user that runs the voilà dashboard server can be downloaded by someone with network access to the server. Whether this still requires authentication depends on how voilà is deployed. ### Patches This is patched in 0.2.17+, 0.3.8+, 0.4.4+, 0.5.6+ ### Workarounds None. ### References CWE-73: External Control of File Name or Path ### Original report I have found a local file inclusion vulnerability in one of your subprojects, voila (https://github.com/voila-dashboards/voila). The vulnerability exists in the "/static" Route, and can be exploited by simply making a request such as this: ``` $ curl localhost:8866/static/etc/passwd ``` ...or by using a webbrowser to download the file. I dug into the source code, and I think the offending line is here: https://github.com/voila-dashboards/voila/blob/8419cc7d79c0bb1dabfbd9ec49cb957740609d4d/voila/app.py#L664 `"static_path"` gets set to `"/"`, irrespective of the actual `"--static"` cli option. Because of that, the `tornado.web.StaticFileHandler` gets initialized with `path="/"`. Then, `tornado.web.StaticFileHandler.get` calls `tornado.web.StaticFileHandler.get_absolute_path` with `root="/"` and `path="[USER SUPPLIED PATH]"`, which leads to local file inclusion. An attacker can request any file on the system they want (that the user running voila has access to). I suspect this was an oversight during development. Setting `static_path=self.static_root` (the aforementioned correct cli option) in line 664 provides the intended behavior and restricts the file access to the static directory. From what I can tell, this line has been in the repository since September 2018. This is the commit that added it: https://github.com/voila-dashboards/voila/commit/28faacc9b03b160fd8fa920ad045f4ec0667ab67 I have found multiple voila instances online that are impacted, such as: - ... [redacted] - ... [redacted] - ... [redacted] ...but many more probably exist. They're easy to identify by `[redacted]` Therefore the Issue should be fixed as soon as possible, and a security advisory should be released to inform the impacted users.

CVE-2024-30265 Affected Voila Versions

4 component(s)
Fixed Versions:
0.2.170.3.80.4.40.5.6
Product / Package Ecosystem Affected Versions Fixed Version
voila
PyPI
≥ 0.0.2
< 0.2.17
0.2.17
voila
PyPI
≥ 0.3.0a0
< 0.3.8
0.3.8
voila
PyPI
≥ 0.4.0a0
< 0.4.4
0.4.4
voila
PyPI
≥ 0.5.0a0
< 0.5.6
0.5.6

References

Frequently Asked Questions

What is CVE-2024-30265?
CVE-2024-30265 is a security vulnerability in Voila involving Voilà Local file inclusion under CWE-73: External Control of File Name or Path.
Which Voila versions are affected?
Affected versions include releases prior to 0.2.17, 0.3.8, 0.4.4, 0.5.6 across affected packages: voila.
What version fixes CVE-2024-30265?
Upgrading to 0.2.17, 0.3.8, 0.4.4, 0.5.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is voila affected?
Yes, voila is affected in releases prior to 0.2.17, 0.3.8, 0.4.4, 0.5.6. Upgrade your dependency to 0.2.17, 0.3.8, 0.4.4, 0.5.6 or later.
What is the CVSS score of CVE-2024-30265?
CVE-2024-30265 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-30265?
CVE-2024-30265 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check PyPI dependencies for CVE-2024-30265?
Run the dependency tree command: 'pip show voila'. 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-2q59-h24c-w6fg",
  "modified" : "2024-04-04T13:37:56Z",
  "published" : "2024-04-03T14:13:02Z",
  "aliases" : [ "CVE-2024-30265" ],
  "summary" : "Voilà Local file inclusion",
  "details" : "### Impact\n\nAny deployment of voilà dashboard allow local file inclusion, that is to say any file on a filesystem that is readable by the user that runs the voilà dashboard server can be downloaded by someone with network access to the server. \n\nWhether this still requires authentication depends on how voilà is deployed.\n\n### Patches\n\nThis is patched in 0.2.17+, 0.3.8+, 0.4.4+, 0.5.6+\n\n### Workarounds\n\nNone.\n\n\n### References\n\nCWE-73: External Control of File Name or Path\n\n\n### Original report\n\nI have found a local file inclusion vulnerability in one of your subprojects, voila (https://github.com/voila-dashboards/voila).\n\nThe vulnerability exists in the \"/static\" Route, and can be exploited by simply making a request such as this:\n\n```\n$ curl localhost:8866/static/etc/passwd\n```\n\n...or by using a webbrowser to download the file.\n\nI dug into the source code, and I think the offending line is here: https://github.com/voila-dashboards/voila/blob/8419cc7d79c0bb1dabfbd9ec49cb957740609d4d/voila/app.py#L664\n`\"static_path\"` gets set to `\"/\"`, irrespective of the actual `\"--static\"` cli option. Because of that, the `tornado.web.StaticFileHandler` gets initialized with `path=\"/\"`. Then, `tornado.web.StaticFileHandler.get` calls `tornado.web.StaticFileHandler.get_absolute_path` with `root=\"/\"` and `path=\"[USER SUPPLIED PATH]\"`, which leads to local file inclusion. An attacker can request any file on the system they want (that the user running voila has access to).\n\nI suspect this was an oversight during development. Setting `static_path=self.static_root` (the aforementioned correct cli option) in line 664 provides the intended behavior and restricts the file access to the static directory.\nFrom what I can tell, this line has been in the repository since September 2018. This is the commit that added it: https://github.com/voila-dashboards/voila/commit/28faacc9b03b160fd8fa920ad045f4ec0667ab67\n\nI have found multiple voila instances online that are impacted, such as:\n- ... [redacted]\n- ... [redacted]\n- ... [redacted]\n\n...but many more probably exist. They're easy to identify by `[redacted]` Therefore the Issue should be fixed as soon as possible, and a security advisory should be released to inform the impacted users.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "voila"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.2"
      }, {
        "fixed" : "0.2.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "voila"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.0a0"
      }, {
        "fixed" : "0.3.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "voila"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.4.0a0"
      }, {
        "fixed" : "0.4.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "voila"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.5.0a0"
      }, {
        "fixed" : "0.5.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/voila-dashboards/voila/security/advisories/GHSA-2q59-h24c-w6fg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-30265"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/voila-dashboards/voila/commit/00d6362c237b6b4d466873535554d6076ead0c52"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/voila-dashboards/voila/commit/28faacc9b03b160fd8fa920ad045f4ec0667ab67"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/voila-dashboards/voila/commit/5542e4ae36bb5d184deaa48f95e76be477756af2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/voila-dashboards/voila/commit/98b6a40fec27723572314fdbba99bdc147d904c8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/voila-dashboards/voila/commit/c045be6988539d07cceeb9f82fc660a49485d504"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/voila-dashboards/voila"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-73" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-03T14:13:02Z",
    "nvd_published_at" : "2024-04-03T23:15:13Z"
  }
}