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 Flask Secrets Key - "Privilege Escalation" #292

Closed
Securitybits-io opened this issue Feb 16, 2022 · 1 comment
Closed

Hardcoded Flask Secrets Key - "Privilege Escalation" #292

Securitybits-io opened this issue Feb 16, 2022 · 1 comment
Assignees
Labels
bug_Normal Normal bug, Server connects to clients but won't sync data

Comments

@Securitybits-io
Copy link

In the sourcecode there are 3 relevant places that the Flask Secrets Key are hardcoded. Flask signs all their client sessions with this secret key, usually defined in an Environment Variable. In this case though there's these three places that these are hardcoded into.

Github_Flask_Secret-key

This gives a malicious user the ability to sign their own cookies (using for example: Flask-Unsign), and internally change the UID of the current user and assume any other user, for example UID 1 which is the Admin. (Privilege Escalation)

Another interessting issue that you run into aswell is that having two Flask servers with the same secret key makes it possible for a user to reuse a UID 1 cookie from Server A, and apply that cookie to Server B logging in to the same UID 1. (Lateral movement/Authentication bypass).

@brothercorvo brothercorvo added the bug_Normal Normal bug, Server connects to clients but won't sync data label Feb 16, 2022
naman108 added a commit that referenced this issue Feb 17, 2022
@brothercorvo
Copy link
Collaborator

fixed in 1.9.8.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug_Normal Normal bug, Server connects to clients but won't sync data
Projects
None yet
Development

No branches or pull requests

4 participants