CVE-2024-7767
Executive Summary
CVE-2024-7767 is an improper access control vulnerability in danswer-ai/danswer version v0.3.94. The flaw allows the first user created in the system to view, modify, and delete chats created by an Admin. This leads to unauthorized access to sensitive information, loss of data integrity, and potential compliance violations. The vulnerability has a CVSS score of 6.5 (Medium) and no known public exploit or patch at this time.
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 danswer-ai/danswer application, which is a Python-based open-source project. The supply chain risk is moderate as the vulnerability is in the application logic itself, not in a dependency. However, organizations using danswer should monitor for updates and verify the integrity of their deployment.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires first user account
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L) – unauthorized read of admin chats
- Integrity Impact: Low (I:L) – unauthorized modification/deletion of admin chats
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability requires an attacker to be the first user created in the system, which limits the attack surface. However, once that condition is met, exploitation is trivial and can lead to significant data exposure.
Deep Dive & Mechanics
The vulnerability stems from improper access control in the chat management functionality of danswer-ai/danswer v0.3.94. The application fails to properly enforce role-based access controls (RBAC) when handling chat operations. Specifically, the first user created in the system is granted excessive privileges, allowing them to view, modify, and delete chats belonging to an Admin user.
Root Cause: The access control logic likely checks for user roles but does not correctly differentiate between the first user and an Admin. The first user may be assigned a default role with elevated permissions, or the system may incorrectly treat the first user as having administrative privileges over all chats.
Attack Vector: An attacker who registers as the first user in a danswer instance can exploit this by:
- Authenticating as the first user.
- Sending API requests to list, modify, or delete chats that belong to an Admin.
- The server processes these requests without proper authorization checks.
Impact: Unauthorized access to sensitive conversations, potential data manipulation, and compliance violations (e.g., GDPR, HIPAA) if chat data contains personal or protected information.
Vulnerable vs. Patched Code
No patched version is available. The vulnerable code is in the chat management endpoints. Below is a hypothetical example of the vulnerable logic:
Vulnerable Code (v0.3.94):
@app.route('/api/chats/<chat_id>', methods=['GET', 'PUT', 'DELETE'])
@login_required
def manage_chat(chat_id):
chat = Chat.query.get(chat_id)
if not chat:
abort(404)
# Vulnerable: No check if current user is the owner or admin
if request.method == 'GET':
return jsonify(chat.to_dict())
elif request.method == 'PUT':
# Update chat
pass
elif request.method == 'DELETE':
db.session.delete(chat)
db.session.commit()
return '', 204
Patched Code (Hypothetical):
@app.route('/api/chats/<chat_id>', methods=['GET', 'PUT', 'DELETE'])
@login_required
def manage_chat(chat_id):
chat = Chat.query.get(chat_id)
if not chat:
abort(404)
# Patched: Check if current user is the owner or an admin
if current_user.id != chat.owner_id and not current_user.is_admin:
abort(403)
if request.method == 'GET':
return jsonify(chat.to_dict())
elif request.method == 'PUT':
# Update chat
pass
elif request.method == 'DELETE':
db.session.delete(chat)
db.session.commit()
return '', 204
Exploitation & Lab Setup
Red Team
Prerequisites:
- A running instance of danswer-ai/danswer v0.3.94.
- Ability to register as the first user.
Exploitation Steps:
- Register as the first user on the danswer instance.
- Authenticate and obtain a session token.
- Enumerate admin chat IDs (e.g., via
/api/chatsendpoint). - Send GET, PUT, or DELETE requests to
/api/chats/<admin_chat_id>with the session token.
Example cURL commands:
# List all chats (including admin's)
curl -X GET https://target.com/api/chats -H "Authorization: Bearer <token>"
# View admin chat
curl -X GET https://target.com/api/chats/123 -H "Authorization: Bearer <token>"
# Modify admin chat
curl -X PUT https://target.com/api/chats/123 -H "Authorization: Bearer <token>" -d '{"content":"malicious"}'
# Delete admin chat
curl -X DELETE https://target.com/api/chats/123 -H "Authorization: Bearer <token>"
Blue Team
Detection:
- Monitor for unusual API requests to
/api/chatsendpoints from non-admin users. - Alert on DELETE or PUT requests to chat resources by users who are not the chat owner.
- Log all access control failures (403 errors) and investigate repeated attempts.
Hunting:
- Search logs for requests where
user_iddoes not matchchat.owner_idbut the request succeeded. - Look for patterns of a single user (the first user) accessing multiple chats owned by different users.
Mitigation:
- Implement proper RBAC checks on all chat endpoints.
- Restrict the first user's privileges to only their own chats until an admin promotes them.
- Apply the principle of least privilege.
Indicators of Compromise (IOCs)
- Network: Unusual API calls to
/api/chatsendpoints with high frequency. - Logs: Successful GET/PUT/DELETE on chats where
user_id != chat.owner_id. - User Behavior: The first user account accessing chats of other users.
- File System: No specific file IOCs; this is a logic vulnerability.
Detection Engineering
YARA Rule
rule CVE_2024_7767_Improper_Access_Control {
meta:
description = "Detects improper access control in danswer-ai/danswer v0.3.94"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-7767"
strings:
$s1 = "/api/chats/" ascii wide nocase
$s2 = "GET" ascii wide nocase
$s3 = "PUT" ascii wide nocase
$s4 = "DELETE" ascii wide nocase
condition:
any of ($s*) and #s1 > 0
}
Sigma Rule
title: CVE-2024-7767 - Improper Access Control in danswer-ai/danswer
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects unauthorized access to admin chats by the first user in danswer-ai/danswer v0.3.94
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: danswer
detection:
selection:
http_method:
- 'GET'
- 'PUT'
- 'DELETE'
url_path: '/api/chats/*'
user_role: 'first_user'
condition: selection
falsepositives:
- Legitimate admin actions (but first user should not be admin)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-7767 - Improper Access Control in danswer-ai/danswer";
flow:to_server,established;
content:"/api/chats/"; http_uri;
http_method; content:"GET" or content:"PUT" or content:"DELETE";
sid:1000001;
rev:1;
reference:cve,2024-7767;
classtype:attempted-recon;
priority:2;
)
Remediation & Mitigation
Immediate Actions:
- Restrict the first user's privileges manually by modifying the database to set
is_admin=Falsefor that user. - Implement a temporary workaround by adding middleware that checks if the requesting user is the owner of the chat or an admin before allowing modifications.
Long-term Fix:
- Apply a patch from the vendor once available.
- Review and harden all access control logic in the application.
- Conduct a security audit of the RBAC implementation.
Compensating Controls:
- Use a Web Application Firewall (WAF) to block suspicious API requests.
- Enable detailed logging and monitoring for all chat operations.
- Implement rate limiting on chat endpoints.
Valters IT Signature: This report was generated by Valters IT, an elite DevSecOps and Cyber Threat Intelligence expert. For further analysis or remediation assistance, contact 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.