Avoid logging `Session cookie encryptor error: ...` by default?

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
ruby
Domain
backend

Research direction

Start in lib/rack/session/cookie.rb around lines 223-224 and compare the $VERBOSE handling in lib/rack/session/abstract/id.rb around line 397. The issue leaves open whether errors should be silent by default or controlled by an opt-in setting. Done means the chosen logging behavior is implemented for the listed encryptor error variants.

Written by the indexing model from the issue text.

Description

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

https://github.com/rack/rack-session/blob/d2f080c243cac167fc5176c5cf869e23fe7f6ec6/lib/rack/session/cookie.rb#L223-L224

Maybe behind $VERBOSE as done here?

https://github.com/rack/rack-session/blob/d2f080c243cac167fc5176c5cf869e23fe7f6ec6/lib/rack/session/abstract/id.rb#L397

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.

Dominant language
Ruby
Stars
52
Forks
22
Avg merge
2d 22h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rack/rack-session

All issues in rack/rack-session

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.