CVE-2024-48050: Agentscope AgentScope Uses `eval` Vulnerability

HIGH
Advisory Identifier: GHSA-6p55-qr3j-mpgq
CVSS 9.8
CWE-94 CWE-95
Published
Advisory Summary

CVE-2024-48050 is a HIGH (CVSS 9.8) agentscope uses `eval` vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Agentscope libraries in the PyPI ecosystem. The issue involves agentscope uses `eval`. Remediation is available in the latest vendor maintenance releases.

CVE-2024-48050 at a Glance

CVE Identifier CVE-2024-48050
GHSA Identifier GHSA-6p55-qr3j-mpgq
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Agentscope
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-2024-48050

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

agentscope fixed: Latest secure release
pip install agentscope>=Latest secure release
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 agentscope

How to Check if You Are Affected

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

pip show agentscope

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

Note: The pip show agentscope 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 Agentscope, 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

In agentscope <=v0.0.4, the file `agentscope\web\workstation\workflow_utils.py` has the function `is_callable_expression`. Within this function, the line `result = eval(s)` poses a security risk as it can directly execute user-provided commands.

CVE-2024-48050 Affected Agentscope Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
agentscope
PyPI
≤ 0.1.0

References

Frequently Asked Questions

What is CVE-2024-48050?
CVE-2024-48050 is a security vulnerability in Agentscope involving AgentScope uses `eval` under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Agentscope versions are affected?
Affected versions include releases prior to current release patches across affected packages: agentscope.
What version fixes CVE-2024-48050?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is agentscope affected?
Yes, agentscope is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-48050?
CVE-2024-48050 has a CVSS v3.1 base score of 9.8 (HIGH) 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-2024-48050?
CVE-2024-48050 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-2024-48050?
Run the dependency tree command: 'pip show agentscope'. 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-6p55-qr3j-mpgq",
  "modified" : "2024-11-07T17:10:05Z",
  "published" : "2024-11-05T00:31:28Z",
  "aliases" : [ "CVE-2024-48050" ],
  "summary" : "AgentScope uses `eval`",
  "details" : "In agentscope <=v0.0.4, the file `agentscope\\web\\workstation\\workflow_utils.py` has the function `is_callable_expression`. Within this function, the line `result = eval(s)` poses a security risk as it can directly execute user-provided commands.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "agentscope"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-48050"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/AfterSnows/0ad9d233a9d2a5b7e6e5273e2e23508d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/modelscope/agentscope"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelscope/agentscope/blob/main/src/agentscope/web/workstation/workflow_utils.py#L11"
  }, {
    "type" : "WEB",
    "url" : "https://rumbling-slice-eb0.notion.site/Unauthenticated-Remote-Code-Execution-via-The-use-of-eval-in-is_callable_expression-and-sanitize_nod-cd4ea6c576da4e0b965ef596855c298d"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94", "CWE-95" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-05T16:10:09Z",
    "nvd_published_at" : "2024-11-04T23:15:04Z"
  }
}