ZeusWPI / Haldis

Haldis is your friendly neighbourhood servant. He exists so lazy fucks like you and me don't need to keep tabs of who is ordering what from where.
Other
13 stars 15 forks source link

Hardcoded secret key #222

Open FHantke opened 1 month ago

FHantke commented 1 month ago

Hello Haldis 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.

https://github.com/ZeusWPI/Haldis/blob/73671bd8f13b0c40dd0accd6ba27683b3bde442a/app/config.example.py#L17

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

TomNaessens commented 1 month ago

Hi @FHantke,

Thank you for the warning. I'd consider this a false positive though: the action of having to copy config.example.py to config.py, together with the "change" instruction in the file should be sufficient mitigation.

Nevertheless, I've changed it to an environment variable in #223.

Tom