Record summary

CVE-2024-4320 has a selected CVSS score of 9.8 (critical); EIP currently links 1 repository PoC and 1 lab environment.

Description

A remote code execution (RCE) vulnerability exists in the '/install_extension' endpoint of the parisneo/lollms-webui application, specifically within the `@router.post("/install_extension")` route handler. The vulnerability arises due to improper handling of the `name` parameter in the `ExtensionBuilder().build_extension()` method, which allows for local file inclusion (LFI) leading to arbitrary code execution. An attacker can exploit this vulnerability by crafting a malicious `name` parameter that causes the server to load and execute a `__init__.py` file from an arbitrary location, such as the upload directory for discussions. This vulnerability affects the latest version of parisneo/lollms-webui and can lead to remote code execution without requiring user interaction, especially when the application is exposed to an external endpoint or operated in headless mode.

Description source: CVE List

Exploitation context

Available material

Repository PoCs
1
Lab environments
1

CISA SSVC decision

ExploitationPoC
AutomatableYes
Technical impactTotal

CISA Coordinator · SSVC 2.0.3 · Evaluated Jun 7, 2024 · Source: CVE List

Affected products and versions

2
ProductSourceVersion rangeStatus

Default status: affected

CVE ListBefore *affected
CVE ListThrough latestaffected

Proofs of concept

1

Repository PoCs

GitHubbolkv/CVE-2024-4320Repository PoCby bolkvStars: 0Not analyzed4 files

6.7 KiB

GitHub

PoC details

Docker lab environments

1
GitHub

Repository root

bolkv/CVE-2024-4320Created
Vuln labCVE-2024-4320Dockerfile

1 Dockerfile

Analysisdeepseek-v4-pro:cloud ·

Environment assessment

A single-container environment built from python:3.9-slim that runs a FastAPI application (poc.py) on port 9600. The application includes endpoints for file upload, extension installation, and file retrieval, and is accompanied by a Nuclei template (cve-2024-4320.yaml) that describes a path traversal vulnerability leading to remote code execution.

Dockerfile:1-18poc.py:1-150cve-2024-4320.yaml:1-51

Lab assessment

Vulnerability lab

The packet includes a proof-of-concept application (poc.py) with a vulnerable endpoint (/install_extension) that concatenates user input into a file path and loads a Python module, and a Nuclei template (cve-2024-4320.yaml) that describes and tests a path traversal vulnerability in that endpoint. The repository name and template description explicitly reference CVE-2024-4320. This is consistent with a vulnerability reproduction or demonstration environment.

cve-2024-4320.yaml:1-51poc.py:1-150
Lab shapeDockerfile
ServicesUnknown
Compose manifests0
Dockerfiles1
Evidence & reasoningComponents · CVE assessment · exercise context · review boundaries
Components

Services and files described by the evidence

FastAPI application (poc.py)

vulnerable target applicationproof-of-concept server

A FastAPI server exposing endpoints /mount_extension, /install_extension, /uploadfile/, and /uploads/{filename}. The /install_extension endpoint constructs a file path by concatenating a base directory with user-supplied data.name, then uses importlib.machinery.SourceFileLoader to load and execute a Python module from that path. The /uploadfile/ endpoint saves uploaded files to /path/to/uploads. The /uploads/{filename} endpoint serves uploaded files. The application is the target of the described path traversal vulnerability.

poc.py:1-150

Nuclei template (cve-2024-4320.yaml)

vulnerability scanner templateexploit demonstration

A Nuclei template that sends a multipart file upload to /uploadfile/ containing a Python file, then sends a JSON POST to /install_extension with a path traversal payload in the name field pointing to the uploaded file, and finally requests the uploaded file via GET /uploads/. It expects a 200 status and the random string from the uploaded file content, demonstrating remote code execution via path traversal.

cve-2024-4320.yaml:1-51

Dockerfile

containerization definition

Defines a container based on python:3.9-slim, copies the current directory into /app, installs Python dependencies from requirements.txt, exposes port 9600, and runs the FastAPI application with uvicorn.

Dockerfile:1-18

requirements.txt

dependency manifest

Lists Python packages fastapi, uvicorn, pydantic, and python-multipart required by the application.

requirements.txt:1-4
CVE assessment

How the supplied evidence relates each vulnerability

CVE-2024-4320

Supported by supplied evidence

The Nuclei template explicitly describes CVE-2024-4320 as a path traversal vulnerability in the /install_extension endpoint that allows arbitrary Python file execution. The poc.py code implements exactly that endpoint with direct concatenation of user input into a file path and dynamic module loading via SourceFileLoader, matching the described vulnerability.

cve-2024-4320.yaml:6-12poc.py:85-108
Exercise context

Requirements and sequence described by the evidence

Prerequisites

  • The container must be built and run, exposing port 9600.Dockerfile:1-18
  • The /path/to/uploads directory must be writable by the application to receive uploaded files.poc.py:111-121
  • The attacker must be able to reach the HTTP endpoints /uploadfile/, /install_extension, and /uploads/.poc.py:111-121poc.py:85-108poc.py:123-130

Evidence-described exercise path

  1. Upload a malicious Python file (e.g., containing print("{{randstr}}")) to /uploadfile/.cve-2024-4320.yaml:16-24
  2. Send a POST request to /install_extension with a JSON body containing a path traversal payload in the 'name' field that points to the uploaded file (e.g., ../../../../../../../../../../../path/to/uploads/{{randstr}}.py).cve-2024-4320.yaml:26-32
  3. Verify execution by requesting the uploaded file via GET /uploads/{{randstr}}.py and checking for the expected output (the random string) in the response.cve-2024-4320.yaml:34-36cve-2024-4320.yaml:38-48
Safety-review evidence

Behaviors behind the stored safety assessment

No harmful behavior observed

All visible behavior is confined to the containerized application. The Dockerfile does not use privileged mode, mount the Docker socket, or map host directories. The application listens on 0.0.0.0:9600, which is typical for a lab service. The exploit path targets the application's own file upload and extension loading logic to achieve code execution within the container, which is the expected demonstration of the vulnerability. No hidden persistence, credential theft, host escape, or external connectivity is observed.

Dockerfile:1-18poc.py:1-150cve-2024-4320.yaml:1-51
Review boundaries

What the analysis did not establish

  • No docker-compose file is present; port mapping and volume mounts are not defined, so the actual runtime exposure and filesystem isolation depend on how the container is launched.
  • The application uses hardcoded paths (/path/to/extensions_zoo_path, /path/to/uploads) that may not exist or be writable without additional volume configuration.
  • The Nuclei template is a static YAML file; its execution behavior depends on the Nuclei engine and is not inspected here.
Model interpretation

This review is limited to the supplied lab evidence packet. It does not assert that the environment runs, reproduces a vulnerability, or is safe to execute. Contract: eip-docker-lab-analysis-v1.

References

2