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

Don't use an hardcoded session key #1337

Merged
merged 1 commit into from May 1, 2020
Merged

Don't use an hardcoded session key #1337

merged 1 commit into from May 1, 2020

Conversation

jvoisin
Copy link
Contributor

@jvoisin jvoisin commented Apr 29, 2020

This fixes a trivial authentication bypass,
according to https://flask.palletsprojects.com/en/1.1.x/quickstart/#sessions

@OzzieIsaacs
Copy link
Collaborator

I agree with you, the hardcoded session key isn't good. Your solution leads to an automatic logout after restart of calibre-web.
This is okay so far, except one usecase: If you configure Calibre-Web in admin section there are several configurations, which lead to a reboot of Calibre-Web to apply the new setting (admin.py, functions update_view_configuration and _configuration_update_helper). In this cases you have to login after applying each setting.
I suggest storing the session_key in the app.db on first start of Calibre-Web and using the same session key after each restart. Or to be more secure: Only in cases of an intentional restart the session key is stored in the database, the boot logic loads the session key afterwards, deletes it in the app database. For any other reboots the key isn't stored and after restart of Calibre-Web a new session key is generated.

@OzzieIsaacs OzzieIsaacs merged commit e3246fd into janeczku:master May 1, 2020
@jvoisin jvoisin deleted the key branch May 1, 2020 14:52
@jvoisin
Copy link
Contributor Author

jvoisin commented May 4, 2020

This is tracked as CVE-2020-12627.

@OzzieIsaacs
Copy link
Collaborator

@Technosoft2000: There was security problem found in Calibre-Web. I created a release with version 0.6.7 to address the issue. The problem could be avoided in older releases by generating an own session key and providing it to Calibre-Web via environment variable 'SECRET_KEY'

@Technosoft2000
Copy link

Thank you for the information @OzzieIsaacs

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

Successfully merging this pull request may close these issues.

None yet

3 participants