PromtEngineer localGPT Missing Authentication and Authorization Vulnerability
Vulnerability
A critical vulnerability exists in PromtEngineer localGPT versions through commit 4d41c7d, specifically within the API endpoint's LocalGPTHandler function in backend/server.py. The vulnerability arises from a complete lack of authentication and authorization, allowing any unauthenticated user to create, read, modify, and delete sessions and messages. This oversight enables access to sensitive conversation data, including database credentials, API keys, customer information, and proprietary business details. The vulnerability impacts all API endpoints, representing a significant security flaw that exposes all stored data.
Impact
Exploitation of this vulnerability leads to unauthorized access and manipulation of all sessions and messages within localGPT. This includes a complete data breach of sensitive information such as database credentials, API keys, customer personal data, and confidential business information. Additionally, the vulnerability allows for the deletion of sessions, causing permanent data loss.
Reproduction
To reproduce this vulnerability, create a session using the API's session creation endpoint. Once the session is active, sensitive data can be discussed and stored as messages. Afterward, without any authentication, all sessions can be listed, and any session's messages can be accessed, including the sensitive information previously stored. The vulnerability can also be automated with a script that simulates the entire process, from session creation to data theft.
Remediation
To address this vulnerability, implement a robust authentication mechanism, such as JWT-based authentication, and establish authorization checks to ensure users can only access their own sessions. Additionally, update the database schema to include user ownership details and implement user registration and login functionalities. It's also crucial to fix the CORS configuration to prevent unauthorized access.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
