CVE-2024-8954
Executive Summary
CVE-2024-8954 is a critical authentication bypass vulnerability in composiohq/composio version 0.5.10. The API fails to validate the x-api-key header value, allowing an attacker to bypass authentication by providing any arbitrary string in the header. This grants unauthorized access to the server with full privileges, leading to potential data breaches, system compromise, and lateral movement. The CVSS score is 9.8 (Critical), and no patch is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the composio Python package (PyPI). Organizations using composio in their supply chain must immediately assess exposure. The lack of authentication validation means any component or service relying on composio for API security is completely compromised. Attackers can inject malicious API calls, exfiltrate data, or pivot to internal systems.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – Exploit does not cross trust boundaries.
- Confidentiality (C): High (H) – Full data access.
- Integrity (I): High (H) – Full data modification.
- Availability (A): High (H) – Full system disruption.
Threat Level: Critical. Immediate action required.
Deep Dive & Mechanics
The vulnerability resides in the authentication middleware of composio version 0.5.10. The API endpoint checks for the presence of the x-api-key header but does not validate its value against a stored key. The code likely performs a simple existence check (e.g., if request.headers.get('x-api-key')) rather than a comparison (e.g., if request.headers.get('x-api-key') == stored_key). This allows an attacker to send any random string (e.g., abc123) and gain full access.
The attack flow:
- Attacker identifies a composio API endpoint.
- Attacker sends a request with any arbitrary
x-api-keyheader value. - Server accepts the request and processes it with full privileges.
- Attacker can then perform any API action, including data retrieval, modification, or deletion.
Vulnerable vs. Patched Code
Vulnerable Code (composio 0.5.10):
# middleware.py
def authenticate(request):
api_key = request.headers.get('x-api-key')
if api_key:
# No validation of api_key value
return True
return False
Patched Code (hypothetical fix):
# middleware.py
VALID_API_KEYS = {"key1", "key2"} # Stored securely
def authenticate(request):
api_key = request.headers.get('x-api-key')
if api_key and api_key in VALID_API_KEYS:
return True
return False
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy composio 0.5.10 in a Docker container.
- Expose the API on port 8000.
- Use the following exploit script:
import requests
target = "http://localhost:8000/api/v1/resource"
headers = {"x-api-key": "any_random_value"}
response = requests.get(target, headers=headers)
print(response.text)
Exploitation Steps:
- Run the script to bypass authentication.
- Use the same technique to access any endpoint (POST, PUT, DELETE).
- Extract sensitive data or modify configurations.
Blue Team
Detection:
- Monitor for requests with
x-api-keyheader containing unusual or random values. - Look for repeated failed authentication attempts (though this bypasses them).
- Check logs for API calls from unexpected IPs or with unusual payloads.
Mitigation:
- Immediately isolate composio instances.
- Implement a reverse proxy (e.g., Nginx) with proper API key validation.
- Use Web Application Firewall (WAF) rules to block requests with invalid
x-api-keypatterns.
Indicators of Compromise (IOCs)
- Network: HTTP requests with
x-api-keyheader containing random strings (e.g.,abc123,test,1). - Logs: Successful API calls without corresponding valid API key records.
- Files: Unauthorized modifications to composio configuration files.
- Processes: Unexpected composio processes or child processes.
Detection Engineering
YARA Rule
rule CVE_2024_8954_Composio_Auth_Bypass {
meta:
description = "Detects composio authentication bypass attempts"
author = "Valters IT"
date = "2024-10-01"
reference = "CVE-2024-8954"
strings:
$header = "x-api-key"
$random_key = /x-api-key:\s*[a-zA-Z0-9]{1,10}/
condition:
$header and $random_key
}
Sigma Rule
title: Composio Authentication Bypass via x-api-key
id: cve-2024-8954
status: experimental
description: Detects requests with arbitrary x-api-key header values
logsource:
category: webserver
product: composio
detection:
selection:
http.request.headers.x-api-key|re: '^[a-zA-Z0-9]{1,10}$'
condition: selection
falsepositives:
- Legitimate short API keys (unlikely)
level: critical
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-8954 Composio Auth Bypass"; flow:to_server; http.header_names; content:"x-api-key"; http.header_value; pcre:"/^[a-zA-Z0-9]{1,10}$/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable composio API endpoints until a patch is applied.
- Implement a reverse proxy with API key validation (e.g., Nginx with
if ($http_x_api_key != "valid_key") { return 403; }). - Use a WAF to block requests with suspicious
x-api-keyvalues.
Long-term Fix:
- Upgrade to a patched version when available.
- Implement proper authentication middleware with key comparison.
- Conduct a security audit of all API endpoints.
Valters IT – Securing your digital frontier.