PHP session.use_trans_sid Session Hijacking

Published on 02 May 2022
1 min read
Vulnerability

There are many web applications that have set use_trans_sid as enabled. An enabled use_trans_sid will allow the PHP to pass session ID through the URL. This passing technique is a medium risk vulnerability in the cyber world as this vulnerability makes the web application more prone to session hijacking attacks. Session hijacking is a form of identity theft attack. Here, an attacker impersonates himself as another user so as to steal the victim’s session ID. If session,use_trans_sid is enabled, an attacker can easily sniff cookie data from the coomunication as this setting allows cookie transfer using URL.

Example

The below code is an example:-

		session.use_trans_sid = 'on'

	

Impact

Using this vulnerability, an attacker can:-

  • perform session hijacking attack
  • manipulate sensitive information
  • leak sensitive information
  • gain administrator access to the web application

Mitigation / Precaution

The vulnerability can be fixed by:-

  • Disabling session.use_trans_sid from php.ini or .htaccess.
    • php.ini
		session.use_trans_sid = 'off'

	
* .htaccess
		php_flag session.use_trans_sid off

	
Rejah Rehim
Written by
Co-founder, Director

Rejah brings more than 12 years of industry experience in Information Technology. He is a fervent security enthusiast and serves as a Project Leader at OWASP Foundation, and Commander (Hon.) at Kerala Police. He has authored two books titled “Effective Python Penetration Testing” and “Python Penetration Testing Cookbook” and is the creator of 9 Mozilla add-ons.

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo