DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Redis-Based Tomcat Session Management
  • When Kubernetes Breaks Session Consistency: Using Cosmos DB and Redis Together
  • The Clandestine Culprits: Unmasking Modern Web Security Misconfigurations (And Their Automated Nemeses)
  • Cookies Revisited: A Networking Solution for Third-Party Cookies

Trending

  • GenAI Isn't Solving the Problem Most Development Teams Actually Have
  • When Your Documentation Manages Itself: mdship and AI-Assisted Markdown
  • Testing Strategies for Web Development Code Generated by LLMs
  • Context Rot: Why Your AI Agent Gets Worse the Longer It Works
  1. DZone
  2. Coding
  3. Languages
  4. Turning Off Session Fixation Protection in Tomcat 7

Turning Off Session Fixation Protection in Tomcat 7

By 
Stacey Schneider user avatar
Stacey Schneider
·
Apr. 26, 11 · Interview
Likes (0)
Comment
Save
Tweet
Share
15.1K Views

Join the DZone community and get the full member experience.

Join For Free

Session fixation protection is a new feature that was introduced as part of the Apache Tomcat 7 release process, and has been backported and turned on by default in all versions from version 6.0.21 on. Session fixation happens when an attacker sends a link to the victim with a session ID included. The minute the victim authenticates the session in the link by logging in, the attacker is able to just click the session link and have full access to the intended victims account.

According to Mark Thomas, release manager for Tomcat 7 and member of the Apache Security Committee, in an article on TomcatExpert.com today":

Essentially, when a user authenticates their session, Tomcat will change the session ID. It does not destroy the previous session, rather it renames it so it is no longer found by that ID. So in our example above, Bob would try and log on with that session, and he would not be able to find it.

Turning Off Session Fixation Protection

Since it is turned on by default, the configuration is implicit inside of Tomcat. To turn it off, you will need to explicitly add the configuration and turn it off. First you will need to find the details of the specific type of authentication valve you are using in the Apache Tomcat Valve Configuration Documentation. Then you would need to navigate to the context.xml file for your application (not $CATALINA_BASE/conf/context.xml - that is the global context.xml that provides defaults for all web applications). Add the valve with the appropriate class for your authentication type (e.g., for basic authentication add a valve using class="org.apache.catalina.authenticator.BasicAuthenticator". Finally, set the parameter changeSessionIdOnAuthentication="false".

When to Turn Off Session Fixation Protection

Generally, this is not recommended. The Apache Security Team deemed this feature a basic enough protection that it should be afforded to all users implicitly. However, in some cases application specific behavior could break and the feature would need to be turned off until the functionality could be restored using the protection. For more information on the feature and when to use it, see the full article from Mark Thomas on TomcatExpert.com.

Apache Tomcat Session (web analytics)

Opinions expressed by DZone contributors are their own.

Related

  • Redis-Based Tomcat Session Management
  • When Kubernetes Breaks Session Consistency: Using Cosmos DB and Redis Together
  • The Clandestine Culprits: Unmasking Modern Web Security Misconfigurations (And Their Automated Nemeses)
  • Cookies Revisited: A Networking Solution for Third-Party Cookies

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook