Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6110753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:33:06+00:00 2026-05-23T14:33:06+00:00

I am co-developing a simple web app in Rails 3.0.9 and I have realized

  • 0

I am co-developing a simple web app in Rails 3.0.9 and I have realized that there is a possible session_id tampering possible via malicious request. Mind the fact, that this is my first RoR application, so I could be totally wrong in my conceptions.

Current application functionality requires sessions so I turned to ActiveRecordStore session storage, installed it and started testing in primitive workflows. I noticed that Rails framework creates cookie with the name _session_id and value of some random hash-like string (in DB SESSION table this string corresponds to session_id column).

If that value in the cookie is changed, for example with Firebug, current session id changes to one provided with cookie’s data (inspected with request.session_options[:id]), and the change is propagated to the database table, creating new session record with aforementioned parameters.

While this brings no implications on a variables of the session, the session id have deviated from its usual hash-like appearance to a user tampered one.

Here is the question – how this behavior can be detected or preferably prevented?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:33:06+00:00Added an answer on May 23, 2026 at 2:33 pm

    To answer your question, it is important to understand the mechanics of how the session-id is generated. (from the docs)

    A session id consists of the hash value of a random string. The random string is the current time, a random number between 0 and 1, the process id number of the Ruby interpreter (also basically a random number) and a constant string. Currently it is not feasible to brute-force Rails’ session ids. To date MD5 is uncompromised, but there have been collisions, so it is theoretically possible to create another input text with the same hash value. But this has had no security impact to date.

    So the session ID is engineered to be cryptographically “hard” to guess. An attacker could change the session_id but the idea is that they could never guess a valid session.

    How can this be prevented?

    Based on the above logic, if you lower your session expiration times, there will be considerably fewer “live” session_id’s. Thus making it even harder for an attacker to randomly select a usable id.

    How can this behavior be detected?

    The easiest way is to log all requests with invalid (not expired) session id’s. If you see a considerable influx of such requests, someone is probably attempting to acquire a session that is not their own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing a web app that will have a pretty complex user and
I am developing a web app in Rails that needs to perform computationally intensive
I am developing a simple web app that uses the Google translation API in
I'm having a problem with java sessions. I'm developing a simple web app, where
This is probably a simple question but I am developing a web app in
I have started developing a new Rails app on my server using RVM, Rails
I'm developing a simple servlet/JSP, data-driven web site on Google App Engine. I've started
I'm kind of new to rails - I'm currently learning by developing a web-app,
I'm developing a simple web app and I just want to allow the user
I am developing a simple rating system for my employer's profile based web-app. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.