@@ -112,43 +112,27 @@ information into the log, and it is required for security reason.
112112CVE-2015 -9284 mitigation
113113--------------
114114
115- Active Record Session Store version 1.x and are affected by [ CVE-2019 -25025] .
116- This means an attacker can perform a timing attack against the session IDs
117- stored in the database. This issue was resolved in version 2.0.0 thanks to
118- [ #151 ] . The fix contains a backwards compatibilty fallback that migrates
119- affected sessions whenever they are used successfully.
115+ Sessions that were created by Active Record Session Store version 1.x are
116+ affected by [ CVE-2019 -25025] . This means an attacker can perform a timing
117+ attack against the session IDs stored in the database.
120118
121119[ CVE-2019-25025 ] : https://github.com/advisories/GHSA-cvw2-xj8r-mjf7
122- [ #151 ] : https://github.com/rails/activerecord-session_store/pull/151
123-
124- However, as long those sessions exist in your database you are still affected
125- by the security issue. Therefore it is strongly recommended not to rely on the
126- fallback but to actively migrate the insecurely stored session IDs by calling
127- the ` #secure! ` method on all sessions.
128120
129- Please be aware that you need to copy/adapt this method if you're using a
130- custom class for storing your sessions (as described earlier in the
131- ` Configuration ` part of this ` README ` ).
121+ After upgrade to version 2.0.0, you should run [ ` db:sessions:upgrade ` ] rake task
122+ to upgrade all existing session records in your database to the secured version.
132123
133- The following example Active Record Migration will work for the default setup
134- of this gem:
124+ [ `db:sessions:upgrade` ] : https://github.com/rails/activerecord-session_store/blob/master/lib/tasks/database.rake#L22
135125
136- ``` ruby
137- # db/migrate/20210310083511_cve201925025_mitigation.rb
138- class Cve201925025Mitigation < ActiveRecord ::Migration [5.2 ]
139- def up
140- ActionDispatch ::Session ::ActiveRecordStore .session_class.find_each(& :secure! )
141- end
142-
143- def down
144- # no-op
145- end
146- end
126+ ``` console
127+ $ rake db:sessions:upgrade
147128```
148129
149- After ` rails db:migrate ` is performed, the session IDs are stored in the
150- securely hashed format provided by ` Rack::Session::SessionId ` and no longer
151- vulnerable to CVE-2019 -25025.
130+ This rake task is idempotent and can be run multiple times, and session data of
131+ users will remain intact.
132+
133+ Please see [ #151 ] for more details.
134+
135+ [ #151 ] : https://github.com/rails/activerecord-session_store/pull/151
152136
153137Contributing to Active Record Session Store
154138--------------
0 commit comments