rawandahmad698 / PyChatGPT

⚡️ Python client for the unofficial ChatGPT API with auto token regeneration, conversation tracking, proxy support and more.
MIT License
4.22k stars 448 forks source link

[BUG] [improvement] Security Concern: Exposing Email Credentials #148

Open Madhav-MKNC opened 1 year ago

Madhav-MKNC commented 1 year ago

Describe the bug I would like to bring attention to a significant security concern within the current implementation of this project. The issue revolves around the requirement of providing email credentials as a parameter during the login process.

Background: The PyChatGPT project offers a convenient method for utilizing the ChatGPT model without relying on an API. However, the current approach introduces a severe security vulnerability by asking users to supply their email and password as input parameters for the login function. This practice is inherently unsafe and can potentially expose sensitive user data.

To Reproduce I propose the following alternatives:

  1. OAuth Integration: Utilize established authentication mechanisms such as OAuth, which allows users to authenticate through trusted third-party providers (e.g., Google, Facebook, GitHub) without exposing their credentials directly.

  2. Token-based Authentication: Implement a token-based authentication system where users are issued a unique access token upon successful login. This token can then be used for subsequent API calls, reducing the risk of exposing sensitive information.

  3. API Key Approach: Consider employing an API key-based authentication method, wherein users are assigned a unique key that is securely stored and exchanged during the authentication process.

Conclusion I urge the project maintainers to prioritize user security and promptly address this issue by implementing a more secure authentication method. Protecting user data is of paramount importance, and eliminating the requirement to expose email credentials will significantly reduce the risk of unauthorized access and potential privacy breaches.

BC79 commented 8 months ago

Is this using https for communications? Also for extra safety running it in a iptables jail means these coms can't be leaked anywhere