I am jointly developing a simple web application in Rails 3.0.9 , and I realized that it is possible to fake session_id with a malicious request. Keep in mind that this is my first RoR application, so I can be completely wrong in my concepts.
The current functionality of the application requires sessions, so I switched to the ActiveRecordStore session store, installed it, and started testing in primitive workflows. I noticed that the Rails environment creates a cookie with the name _session_id and the value of some random hash-like row (in the DB SESSION table, this row corresponds to the session_id column).
If this cookie value changes, for example, with Firebug, the current session identifier is changed to one containing cookie data (checked using request.session_options[:id] ), and this change applies to the database table, creating a new session record with the above options.
While this does not affect session variables, the session identifier deviated from the usual regular hash view for the user who tampered with it.
The question is: how can this behavior be detected or prevented?
source share