Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded secret key #184

Open
FHantke opened this issue May 20, 2024 · 2 comments
Open

Hardcoded secret key #184

FHantke opened this issue May 20, 2024 · 2 comments

Comments

@FHantke
Copy link

FHantke commented May 20, 2024

Hello ActiveDriverDB developers,

We are a cybersecurity research group from the CISPA Helmholtz Center for Information Security and Ca’ Foscari University of Venice. We recently conducted an analysis of the session management used in your web application as part of our research. We have discovered a security vulnerability that we believe requires your attention.

Vulnerability Description:

After our analysis, we have identified that your application is using a hard-coded secret key that is leaked through GitHub. If operators who install your web application do not change this secret key, they are vulnerable to cookie forgeries. The cookie forgery attack allows an attacker, knowing the key used to sign a cookie, to forge new arbitrary cookies to impersonate and take over other accounts.

SECRET_KEY = 'replace_this'

Recommendation for Mitigation:

To address this vulnerability and enhance the security posture of your web application, we highly recommend setting the secret key from an environment variable. If the environment file is not shared on GitHub then this would force operators of your application to create their own key upon installation, forcing them to set their own secure secret key.

We hope this notification helps improve your security. Should you have further questions or comments on this feel free to answer this thread or reach out to florian.hantke@cispa.de.

Kind regards,
Florian Hantke

@krassowski
Copy link
Member

Thank you. This file is not a part of the application. It is an example, as the name suggests.

@FHantke
Copy link
Author

FHantke commented May 20, 2024

Thank you for the answer. Although this is only an example file, I'd still suggest to change the example to use environment variables instead of a hardcoded key as the example demonstrate best practices, right? More often than not, people just copy paste example files for their own setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants