
Irma Šlekytė
Cybersecurity
Session fixation and session hijacking are two major threats that exploit vulnerabilities in web application session management. These attacks allow cybercriminals to take over user sessions, potentially gaining unauthorized access to sensitive information. Since session identifiers (IDs) serve as the key to maintaining user authentication, they become a prime target for attackers. In this article, we'll break down how session hijacking and session fixation work, highlight their key differences, explore other session-based threats, and discuss best practices to defend against them.
Session hijacking is a type of attack where hackers take control of an active user session by stealing and exploiting the session ID. The session ID is a unique token that identifies the user and maintains state across requests, often stored in cookies, passed in URLs, or embedded in hidden form fields. In session hijacking attacks, once the attacker obtains the session ID, they can access the user’s account without needing credentials, allowing them to read sensitive data, make unauthorized changes, or escalate privileges. Timing is critical in these attacks, as session IDs are only valid for a limited period.
Session hijacking exploits weak points in how web sessions are managed. A typical session hijacking works like this:
Session hijacking attacks have been used in high-profile breaches. One early example was Firesheep, an extension for the Firefox browser released in 2010, which allowed anyone on the same network to hijack sessions of users logged into sites like Facebook or Twitter over HTTP.
More recently, attackers have targeted internal business apps by injecting session-stealing scripts into vulnerable web portals. That led to a full account takeover, access to sensitive internal systems, and data breaches.
Session fixation is a type of attack where the attacker sets the session identifier before the victim logs in. When the user authenticates with the same session ID, the attacker can reuse it to access the session without needing credentials. This exploit takes advantage of poor session management practices, such as not regenerating session IDs after login.
A session fixation attack typically follows this process:
Session fixation attacks rely on weak session management — specifically, accepting session IDs from untrusted sources (like URLs or form data) and failing to issue new IDs after login. If a system lets one user set or reuse another's session ID, it's vulnerable.
A session fixation vulnerability was discovered in Schneider Electric's EcoStruxure™ Power Monitoring Expert (PME). In this case, the system allowed a session ID to be set in advance via the login URL. An attacker could send a specially crafted link containing a predefined session ID to a victim. If the victim logged in using that link, the attacker could then use the same session ID to access the authenticated session — effectively hijacking it without needing to steal credentials or intercept tokens. This attack highlighted how improper session handling can lead to serious security breaches, even in industrial and enterprise environments.
Both session fixation and session hijacking take advantage of improper session management and have a similar goal: gaining access to a web server session ID. However, they differ in the way that attackers achieve this end goal.
In a session hijacking attack, the attacker waits for the user to log in and then steals the session ID to slip into the existing session unnoticed. In a session fixation attack, the attacker tricks the user into using a predetermined session ID.
Let’s see how session hijacking and session fixation compare side by side:
Factor | Session hijacking | Session fixation |
---|---|---|
Attack complexity | Moderate to high | Low to moderate |
User interaction required | No (passive attack) | Yes (requires tricking user) |
Prevention difficulty | High (requires encrypted communication and token security) | Moderate (requires session regeneration and validation) |
Impact severity | High (can lead to full account takeover) | Moderate (depends on session handling by the application) |
Attack vector | Network sniffing, XSS, malware | URL parameters, shared cookies, insecure login flow |
Session ID exposure | Token is stolen | Token is fixed before authentication |
Exploitation scenario | Public Wi-Fi hijacking, malware injecting session-stealing scripts | Phishing attacks, insecure login flows |
Affected systems | Web applications, APIs, mobile apps | Web applications with weak session management |
Beyond session fixation and hijacking, several related session attacks exist. While not always identical, they often overlap in risk and impact.
These techniques are often chained with session hijacking or fixation to gain access, escalate privileges, or maintain persistence. If your session handling is weak, attackers will find a way in.
Session-based attacks are a serious threat because they target one of the core mechanisms nearly all web applications rely on: session management. The fallout can affect everything from customer trust to regulatory standing.
These are the consequences when an attacker gains control of a session:
Even after the attack is over, the damage often continues with:
Most session-based attacks come down to poor session management. The fixes aren't complicated, but they need to be implemented consistently.
Here's how to secure the sessions of your web application:
Even with all the right precautions, session-based attacks can slip through. That's why security monitoring and automation matter.
NordStellar’s session hijacking prevention solution proactively scans the deep and dark web for stolen session cookies linked to an organization’s employees and customers. When a compromised session cookie is detected, the platform immediately alerts the organization with details such as the source, device, and other stolen information. To prevent attackers from exploiting stolen sessions, NordStellar enforces security measures that block unauthorized transactions, impersonation attempts, and other account fraud, ensuring seamless protection without disrupting legitimate user activity.
Stop session-based attacks before they cause damage with NordStellar — a next-gen threat exposure management platform. Contact the NordStellar team to learn more.