Vulnerabilities in pkg:pypi/searchor

PACKAGE
Advisory Identifier: GHSA-66m2-493m-crh2
Advisory Summary

CVE-2023-43364 is a CRITICAL (CVSS 9.8) searchor cli's search vulnerable to vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Searchor libraries in the PyPI ecosystem. The issue involves searchor cli's search vulnerable to arbitrary code using eval. Remediation is available by upgrading affected packages to version 2.4.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/searchor

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/searchor. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-66m2-493m-crh2 CVE-2023-43364 CRITICAL Searchor CLI's Search vulnerable to Arbitrary Code using Eval

CVE-2023-43364 at a Glance

CVE Identifier CVE-2023-43364
GHSA Identifier GHSA-66m2-493m-crh2
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Searchor
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

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: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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-43364

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

searchor fixed: 2.4.2
pip install searchor>=2.4.2
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 searchor

How to Check if You Are Affected

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

pip show searchor

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

Note: The pip show searchor 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 Searchor, 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

An issue in Arjun Sharda's Searchor before version v.2.4.2 allows an attacker to execute arbitrary code via a crafted script to the eval() function in Searchor's src/searchor/main.py file, affecting the search feature in Searchor's CLI (Command Line Interface). ### Impact Versions equal to, or below 2.4.1 are affected. ### Patches Versions above, or equal to 2.4.2 have patched the vulnerability. ### References https://github.com/nikn0laty/Exploit-for-Searchor-2.4.0-Arbitrary-CMD-Injection https://github.com/nexis-nexis/Searchor-2.4.0-POC-Exploit- https://github.com/jonnyzar/POC-Searchor-2.4.2 https://github.com/ArjunSharda/Searchor/pull/130

CVE-2023-43364 Affected Searchor Versions

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

References

Frequently Asked Questions

What is CVE-2023-43364?
CVE-2023-43364 is a security vulnerability in Searchor involving Searchor CLI's Search vulnerable to Arbitrary Code using Eval under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Searchor versions are affected?
Affected versions include releases prior to 2.4.2 across affected packages: searchor.
What version fixes CVE-2023-43364?
Upgrading to 2.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is searchor affected?
Yes, searchor is affected in releases prior to 2.4.2. Upgrade your dependency to 2.4.2 or later.
What is the CVSS score of CVE-2023-43364?
CVE-2023-43364 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-43364?
CVE-2023-43364 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-43364?
Run the dependency tree command: 'pip show searchor'. 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-66m2-493m-crh2",
  "modified" : "2024-10-09T22:52:25Z",
  "published" : "2023-09-25T18:37:51Z",
  "aliases" : [ "CVE-2023-43364" ],
  "summary" : "Searchor CLI's Search vulnerable to Arbitrary Code using Eval",
  "details" : " An issue in Arjun Sharda's Searchor before version v.2.4.2 allows an attacker to\n execute arbitrary code via a crafted script to the eval() function in Searchor's src/searchor/main.py file, affecting the search feature in Searchor's CLI (Command Line Interface).\n\n### Impact\nVersions equal to, or below 2.4.1 are affected.\n\n### Patches\nVersions above, or equal to 2.4.2 have patched the vulnerability.\n\n### References\nhttps://github.com/nikn0laty/Exploit-for-Searchor-2.4.0-Arbitrary-CMD-Injection\nhttps://github.com/nexis-nexis/Searchor-2.4.0-POC-Exploit-\nhttps://github.com/jonnyzar/POC-Searchor-2.4.2\nhttps://github.com/ArjunSharda/Searchor/pull/130",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "searchor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.4.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.4.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ArjunSharda/Searchor/security/advisories/GHSA-66m2-493m-crh2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-43364"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ArjunSharda/Searchor/pull/130"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ArjunSharda/Searchor/commit/16016506f7bf92b0f21f51841d599126d6fcd15b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ArjunSharda/Searchor"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-66m2-493m-crh2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nexis-nexis/Searchor-2.4.0-POC-Exploit-"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nikn0laty/Exploit-for-Searchor-2.4.0-Arbitrary-CMD-Injection"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/searchor/PYSEC-2023-262.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-25T18:37:51Z",
    "nvd_published_at" : "2023-12-12T18:15:22Z"
  }
}