CVE-2024-2196
📋 TL;DR
This CSRF vulnerability in aimhubio/aim allows attackers to trick authenticated users into executing unauthorized actions like deleting runs, updating data, and stealing log records and notes. It affects all users running vulnerable versions of the aim dashboard without proper CSRF/CORS protections. Attackers can exploit this via malicious scripts to cause data loss and unauthorized manipulation.
💻 Affected Systems
- aimhubio/aim
📦 What is this software?
Aim by Aimstack
⚠️ Risk & Real-World Impact
Worst Case
Complete data loss through deletion of all runs, unauthorized data modification, and exfiltration of sensitive experiment logs and notes, potentially disrupting ML workflows and research.
Likely Case
Targeted deletion or modification of specific runs and theft of experiment data through crafted CSRF attacks against authenticated users.
If Mitigated
No impact if proper CSRF tokens and CORS policies are implemented, as requests would be rejected without valid tokens.
🎯 Exploit Status
Exploitation requires the victim to be authenticated to the aim dashboard. Attackers can craft malicious HTML/JavaScript pages that trigger unauthorized requests when visited by authenticated users.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Check aim repository for latest version with CSRF/CORS fixes
Vendor Advisory: https://huntr.com/bounties/e141e3f2-afbb-405f-a891-f66628c8b68f
Restart Required: Yes
Instructions:
1. Update aim to the latest version with CSRF/CORS fixes. 2. Verify the update includes CSRF token validation and proper CORS headers. 3. Restart the aim server.
🔧 Temporary Workarounds
Implement CSRF Tokens
allAdd CSRF token validation to all state-changing endpoints in aim dashboard
Implement CSRF middleware or add token validation to API endpoints
Restrict CORS
allConfigure strict CORS policies to limit cross-origin requests
Set appropriate CORS headers to restrict origins
🧯 If You Can't Patch
- Isolate aim dashboard behind authentication proxy that adds CSRF protection
- Restrict network access to aim dashboard to trusted users only
🔍 How to Verify
Check if Vulnerable:
Test if API endpoints accept requests without CSRF tokens or proper origin validation. Use browser developer tools to inspect requests.
Check Version:
aim --version or check package.json/requirements.txt for aim version
Verify Fix Applied:
Verify that state-changing endpoints (POST, PUT, DELETE) require valid CSRF tokens and reject cross-origin requests without proper headers.
📡 Detection & Monitoring
Log Indicators:
- Multiple unauthorized DELETE/POST requests from unexpected origins
- Sudden deletion of runs without corresponding user actions
Network Indicators:
- Cross-origin requests to aim API endpoints without referrer validation
- CSRF attack patterns in web traffic
SIEM Query:
source="aim" AND (action="delete" OR action="update") AND referrer NOT IN allowed_domains