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

Avoid logging Session cookie encryptor error: ... by default? #29

Open
dentarg opened this issue Jan 10, 2024 · 0 comments
Open

Avoid logging Session cookie encryptor error: ... by default? #29

dentarg opened this issue Jan 10, 2024 · 0 comments

Comments

@dentarg
Copy link
Contributor

dentarg commented Jan 10, 2024

Does it makes sense to be able to silence this logging or make it opt-in?

rescue Rack::Session::Encryptor::Error => error
request.env[Rack::RACK_ERRORS].puts "Session cookie encryptor error: #{error.message}"

Maybe behind $VERBOSE as done here?

req.get_header(RACK_ERRORS).puts("Deferring cookie for #{session_id}") if $VERBOSE

Looks like it can log the following variants of Session cookie encryptor error: <message>

  • wrong version
  • Message is invalid
  • invalid message
  • HMAC is invalid

I'm not sure they're useful to always have enabled (in production) as any user can trigger at least Session cookie encryptor error: Message is invalid by sending bogus data in the Cookie header.

@dentarg dentarg changed the title Avoid logging Session cookie encryptor error: Message is invalid by default? Avoid logging Session cookie encryptor error: ... by default? Jan 15, 2024
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

1 participant