When used as a session store, I noticed that redis-rails saves the session id in unencrypted format in the cookie. Shouldn't session id be treated as secure information and not be exposed in a cookie unencrypted to thwart session-hijacking attempts?
Is it secure to use redis-rails as session store?
1.3k views Asked by RajeshT At
1
There are 1 answers
Related Questions in RUBY-ON-RAILS
- How to display legend box in tooltip text for amCharts 5 in Rails application?
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- rails minitest not picking up fixture properly, instance variable not percolating
- Duplicate GET requests - Rails & Heroku
- How to stub out current_user in JWT model for Rspec?
- NameError in Home#index
- Verifying Google Identity OAuth2 token with Ruby
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- why is mission_control-jobs erroring with load path error?
- Rescuing validation errors from a polymorphic association
- New error on random number assigned to local variable , Rails
- How to fix error in model with gem lockbox
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- controller test_methods generating two errors intermittently
Related Questions in SESSION-COOKIES
- Create new cookie with host only set to false in chrome extension
- Laravel login loop
- How to make a bot for kick that scans the chatlogs and send a message in my name
- Will Flask programs still work after Google drops 3rd party cookies from Chrome?
- HTTP 431 error on Azure App Service with AAD access for some users
- nextAuth.js returning status 200 but session is not being created
- php cookies are not working the same on mobile browsers and on pc browsers
- 'Session cookie exceeds allowed 4096 bytes.'-getting this Next Auth error after upgrading nextJs 14.1.4 from 14.1.0
- Expiration of a session with discord oauth2
- Laravel 8 session token lost after redirect to external URL
- SM Session Authentication issue from Site Minder getting HTML Login Page
- After Jakarta migration, GAE app throws "Request failed: Unexpected Error: java.io.IOException: written 54 > 0 content-length" until I clear cookies
- flush/delete cookie not working after each request
- How to set cookies at client side from the server response using express.js?
- Do not share cookies between domain, only to api
Related Questions in REDIS-RAILS
- ROR SESSION STORE: Session store with :redis_store not getting cookie with session_id in it in response
- Why doesn't Redis work with my Rails application?
- Keeping Existing Sessions When Upgrading to Rails 5.2 (with Redis Session Store)
- Rails.cache.fetch returns nil
- How to set maxmemory for RedisCloud addon on heroku ( rails app )?
- with redis-rails, how to delete all but sessions cache?
- How to set the configuration for middleware for ActionDispatch::Session::RedisStore and Devise
- Is it secure to use redis-rails as session store?
- Issues with redis-rails and connection_pool
- How do I implement connection pooling for Redis-As-Rails-Cache (using Redis as rails cache) Rails 4.1?
- Websocket-rails and redis-rb do not restore Pub/Sub Channel on failover
- Redis search for keys with a value
- Vagrant+Ansible+Redis - Get 127.0.0.1:6379 (Errno::ECONNREFUSED) when using different servers
- Rails, Redis and Sentinel
- Hiredis fails when deploying with capistrano
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
No.
The session identifier cookie is the only (decent) way to link a client to a session. The client must have some sort of claim which they can pass along with the request so that we can identify them.
This applies whether you are using CookieStore, Redis, ActiveRecord or memcached.
Encrypting the session identifier with a fixed salt or no salt would do absolutely nothing but waste time since the attacker has access to the cookie anyways in a man-in-the-middle or XSS attack.
If you used a salt you would have to link that to the user as well. Now you have two problems instead of one.
While you could use a bunch of novel approaches like salting with the user agent, ip or anything else that you think you know about the client the security benefits are few.
As @pvg said:
Meaningful ways to protect the session are:
reset_sessionwhen logging users in and out to avoid session fixation.