CVE-2023-48699: Fastbots Eval Injection Vulnerability

HIGH
Advisory Identifier: GHSA-vccg-f4gp-45x9
CVSS 8.4
CWE-94 CWE-95
Published
Advisory Summary

CVE-2023-48699 is a HIGH (CVSS 8.4) eval injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Fastbots libraries in the PyPI ecosystem. The issue involves eval injection in fastbots. Remediation is available by upgrading affected packages to version 0.1.5.

CVE-2023-48699 at a Glance

CVE Identifier CVE-2023-48699
GHSA Identifier GHSA-vccg-f4gp-45x9
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Fastbots
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.4

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

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

How to Fix CVE-2023-48699

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

fastbots fixed: 0.1.5
pip install fastbots>=0.1.5
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 fastbots

How to Check if You Are Affected

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

pip show fastbots

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Fastbots, 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 An attacker could modify the locators.ini locator file with python code that without proper validation it's executed and it could lead to rce. The vulnerability is in the function def __locator__(self, locator_name: str) in page.py. The vulnerable code that load and execute directly from the file without validation it's: ```python return eval(self._bot.locator(self._page_name, locator_name)) ``` ### Patches In order to mitigate this issue it's important to upgrade to fastbots version 0.1.5 or above. ### References [Merge that fix also this issue](https://github.com/ubertidavide/fastbots/pull/3#issue-2003080806)

CVE-2023-48699 Affected Fastbots Versions

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

References

Frequently Asked Questions

What is CVE-2023-48699?
CVE-2023-48699 is a security vulnerability in Fastbots involving Eval Injection in fastbots under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Fastbots versions are affected?
Affected versions include releases prior to 0.1.5 across affected packages: fastbots.
What version fixes CVE-2023-48699?
Upgrading to 0.1.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fastbots affected?
Yes, fastbots is affected in releases prior to 0.1.5. Upgrade your dependency to 0.1.5 or later.
What is the CVSS score of CVE-2023-48699?
CVE-2023-48699 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-48699?
CVE-2023-48699 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2023-48699?
Run the dependency tree command: 'pip show fastbots'. 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-vccg-f4gp-45x9",
  "modified" : "2023-11-22T18:08:01Z",
  "published" : "2023-11-21T22:18:22Z",
  "aliases" : [ "CVE-2023-48699" ],
  "summary" : "Eval Injection in fastbots",
  "details" : "### Impact\nAn attacker could modify the locators.ini locator file with python code that without proper validation it's executed and it could lead to rce. The vulnerability is in the function def __locator__(self, locator_name: str) in page.py. The vulnerable code that load and execute directly from the file without validation it's:\n```python\n return eval(self._bot.locator(self._page_name, locator_name))\n```\n\n### Patches\nIn order to mitigate this issue it's important to upgrade to fastbots version 0.1.5 or above. \n\n### References\n[Merge that fix also this issue](https://github.com/ubertidavide/fastbots/pull/3#issue-2003080806)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "fastbots"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ubertidavide/fastbots/security/advisories/GHSA-vccg-f4gp-45x9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-48699"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ubertidavide/fastbots/pull/3#issue-2003080806"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ubertidavide/fastbots/commit/73eb03bd75365e112b39877e26ef52853f5e9f57"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ubertidavide/fastbots"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94", "CWE-95" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-21T22:18:22Z",
    "nvd_published_at" : "2023-11-21T23:15:08Z"
  }
}