
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
devise_ssl_session_verifiable
Advanced tools
This is a plugin for Devise which allows you to prevent session hijacking when sharing a session between http and https. It verifies the session via an extra cookie which is set upon the initial authentication. This cookie is restricted to SSL connections, so it won't be transferred in a non-secure way. If the user from the session can't be validated this way, she'll need to reauthenticate herself.
Add to your Gemfile:
gem 'devise_ssl_session_verifiable'
Add to your model which already uses devise :ssl_session_verifiable:
devise ..., :ssl_session_verifiable
Make sure you have all login and other critical operations secured with SSL. You can inforce this in the routes for instance.
In case you would like to provide a special page for users which transition from non-SSL to SSL but fail the verification (maybe because they were logged in insecurely over HTTP), you can use the provided failure app to trigger a custom action. Setup steps:
Setup the custom failure app and route in your routes:
devise_for :users,
:failure_app => DeviseSslSessionVerifiable::FailureApp,
:controllers => { :sessions => 'users/sessions' }
devise_scope :user do
scope as: "user" do
resource :session_verification, :only => [:new, :create]
end
end
The new_user_session_verification_path should be under SSL. In your custom sessions controller, add a verify action like this:
class Users::SessionVerificationController < Devise::SessionsController
def new
@back_to = stored_location_for(:user)
if session[:unverified_user]
@unverified_user = User.serialize_from_session(*session[:unverified_user])
end
end
end
That way you also have access to the user record for which the ssl verification failed.
MIT License. Copyright 2013 Mobalean LLC. http://mobalean.com/
FAQs
Unknown package
We found that devise_ssl_session_verifiable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.