Skip to content

Check for a valid encoding before using a public session id#217

Open
HectorMF wants to merge 1 commit into
rails:masterfrom
HectorMF:master
Open

Check for a valid encoding before using a public session id#217
HectorMF wants to merge 1 commit into
rails:masterfrom
HectorMF:master

Conversation

@HectorMF
Copy link
Copy Markdown

@HectorMF HectorMF commented Oct 9, 2024

When penetration testing I discovered that if a public session ID contains an invalid byte sequence the following error occurs:

Error during failsafe response: invalid byte sequence in UTF-8
/gems/activerecord-session_store-2.1.0/lib/action_dispatch/session/active_record_store.rb:163:in `private_session_id?'

This causes an internal server error, when it really should just handle it as an invalid id

@ashak
Copy link
Copy Markdown

ashak commented May 21, 2026

I've just run into the same issue and ended up here.

Testing the suggested fix out locally appears to work and stops the errors.

Is there anything we can do to try to get this reviewed and merged for a new release?

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.

2 participants