CVE-2024-2217 (published 2024-04-10T17:15Z)

gaizhenbiao/chuanhuchatgpt is vulnerable to improper access control, allowing unauthorized access to the `config.json` file. This vulnerability is present in both authenticated and unauthenticated versions of the application, enabling attackers to obtain sensitive information such as API keys (`openai_api_key`, `google_palm_api_key`, `xmchat_api_key`, etc.), configuration details, and user credentials. The issue stems from the application's handling of HTTP requests for the `config.json` file, which does not properly restrict access based on user authentication.


Weakness information:
cwe_id: CWE-284
cwe_name: Improper Access Control
description: The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.
extended_description: 
            Access control involves the use of several protection mechanisms such as:
            
               Authentication (proving the identity of an actor)
               Authorization (ensuring that a given actor can access a resource), and
               Accountability (tracking of activities that were performed)
            
            When any mechanism is not applied or otherwise fails, attackers can compromise the security of the product by gaining privileges, reading sensitive information, executing commands, evading detection, etc.
            There are two distinct behaviors that can introduce access control weaknesses:
               
                  Specification: incorrect privileges, permissions, ownership, etc. are explicitly specified for either the user or the resource (for example, setting a password file to be world-writable, or giving administrator capabilities to a guest user). This action could be performed by the program or the administrator.
                  Enforcement: the mechanism contains errors that prevent it from properly enforcing the specified access control requirements (e.g., allowing the user to specify their own privileges, or allowing a syntactically-incorrect ACL to produce insecure settings). This problem occurs within the program itself, in that it does not actually enforce the intended security policy that the administrator specifies.
               
         
		 

Fix information:
repo_url: https://github.com/gaizhenbiao/chuanhuchatgpt
commit_details: repo_url: https://github.com/gaizhenbiao/chuanhuchatgpt
author: Tuchuanhuhuhu
author_date: 2024-03-10 13:47:15+08:00
msg: bugfix: added blocked paths to protect sensitive files
repository: repo_url: https://github.com/gaizhenbiao/chuanhuchatgpt
repo_name: GaiZhenbiao/ChuanhuChatGPT
description: GUI for ChatGPT API and many LLMs. Supports agents, file-based QA, GPT finetuning and query with web search. All with a neat UI.
repo_language: Python
owner: gaizhenbiao
file_changes: filename: ChuanhuChatbot.py
change_type: ModificationType.MODIFY
diff: @@ -822,6 +822,7 @@ if __name__ == "__main__":
     setup_wizard()
     demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
         allowed_paths=["history", "web_assets"],
+        blocked_paths=["config.json", "files", "models", "lora", "modules"],
         server_name=server_name,
         server_port=server_port,
         share=share,

programming_language: Python