CVE-2024-9216 Overview
CVE-2024-9216 is an authentication bypass vulnerability in gaizhenbiao/ChuanhuChatGPT, present as of commit 3856d4f. The application accepts a username through an HTTP request from the client side rather than reading it from a trusted server-side source such as a session cookie. An attacker can supply another user's username to the get_model function and gain unauthorized access to that user's chat history. The flaw also permits deletion of other users' chat records, resulting in confidentiality and integrity impact. The vulnerability is classified under CWE-304: Missing Critical Step in Authentication.
Critical Impact
Any authenticated user can read and delete arbitrary users' chat histories by supplying a target username in the HTTP request.
Affected Products
- gaizhenbiao/ChuanhuChatGPT at commit 3856d4f
- ChuanhuChatGPT version 2024-12-04
- Deployments running the vulnerable get_model code path
Discovery Timeline
- 2025-03-20 - CVE-2024-9216 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-9216
Vulnerability Analysis
ChuanhuChatGPT is a web interface for large language model interactions that stores per-user chat history. The application ties chat history retrieval and deletion operations to a username value. That username is transmitted from the client as part of the HTTP request payload instead of being derived from an authenticated server-side session. The server trusts the client-supplied identifier without verifying that it matches the authenticated principal.
The vulnerability allows horizontal privilege escalation across accounts. An attacker with a valid low-privileged account can enumerate or guess other usernames and request their chat histories. The same code path supports deletion, which enables destructive operations against other users' data.
Root Cause
The root cause is a missing critical step in the authentication and authorization flow. The get_model function reads the username parameter from the incoming HTTP request rather than from a server-managed session context such as a signed cookie or authenticated token. No server-side check confirms that the requester is the owner of the referenced chat data. This maps to CWE-304, where a step required to establish the identity of the actor is skipped.
Attack Vector
Exploitation requires network access to the ChuanhuChatGPT application and a valid low-privileged account. The attacker sends a crafted HTTP request that specifies a target user's username in the parameter consumed by get_model. The server returns the target user's chat history or performs a deletion, depending on the operation invoked. No user interaction from the victim is required. See the Huntr bug bounty listing for additional context.
No public proof-of-concept exploit or exploit database entry is currently associated with this CVE. Verified code examples were not available at the time of writing, so exploitation is described in prose only.
Detection Methods for CVE-2024-9216
Indicators of Compromise
- HTTP requests to ChuanhuChatGPT endpoints containing a username parameter that does not match the authenticated session user.
- Unexpected read or delete operations on chat history records from accounts that do not own the referenced data.
- Access log entries showing a single source account interacting with chat history belonging to multiple distinct usernames within a short window.
Detection Strategies
- Instrument the application to log the authenticated session identity alongside every client-supplied username parameter and alert when the two disagree.
- Correlate web server access logs with application-layer audit logs to identify cross-account chat history access.
- Review request payloads for enumeration patterns targeting the get_model handler or related chat history endpoints.
Monitoring Recommendations
- Forward ChuanhuChatGPT application and reverse proxy logs to a centralized analytics platform for retention and query.
- Track deletion events on chat history storage with per-user baselines to flag anomalous spikes.
- Monitor for authentication anomalies, including reuse of low-privileged accounts to access many distinct user resources.
How to Mitigate CVE-2024-9216
Immediate Actions Required
- Restrict network exposure of ChuanhuChatGPT deployments to trusted users only, preferably behind an authenticated reverse proxy or VPN.
- Audit application logs for prior cross-account access to chat history and notify affected users if evidence of exposure is found.
- Disable or rate-limit the chat history retrieval and deletion endpoints until a fixed build is deployed.
Patch Information
No vendor advisory URL or fixed version has been published in the enriched CVE data. Operators should track the upstream gaizhenbiao/ChuanhuChatGPT repository for commits that supersede 3856d4f and address the get_model username handling. Refer to the Huntr bug bounty listing for the disclosure record.
Workarounds
- Modify the application to derive the username from the server-side session context (for example, a signed session cookie or authenticated token) and ignore any client-supplied username value.
- Add an authorization check in the get_model function and any chat history handler that confirms the authenticated principal owns the requested resource.
- Place the application behind a reverse proxy that enforces authentication and strips or overwrites client-supplied identity headers before forwarding requests.
# Example reverse proxy rule (nginx) to block requests where the client
# supplies a username parameter that does not match the authenticated user.
# Replace $authenticated_user with the variable populated by your auth module.
location /chat/ {
if ($arg_username != $authenticated_user) {
return 403;
}
proxy_pass http://chuanhuchatgpt_upstream;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

