Insufficient Session Expiration leads to Account Takeover via Password Change
The platform did not invalidate session tokens on logout or password change, and the password change endpoint accepted an old token without requiring the current password or a second factor. An attacker holding a victim's old token could change the victim's password and take over the account.
Bug Bounty
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
During bug hunting in VDP programs, the researcher analysed a presentation platform. The feature in question is the user profile page, where a user can modify their own account data, and the account password change feature. Normally, a session token identifies the logged-in user for these actions, and logging out should end that session.
At first glance the issue looked like an ordinary problem that might easily be classified as low or P4. Once the impact is understood, the danger becomes clear: a simple mistake in the back-end code can expose users' accounts to complete takeover.

Setup
The researcher was testing access control on the platform and used a token from another account against a victim's profile. The token format observed was a value like auth_token=abk193. No specific tools or versions are described in the report.
Finding it
While searching for access control vulnerabilities, the researcher found that the user profile page allowed user data to be modified. Changing the account name using a token from another account, like auth_token=abk193, successfully changed the victim's account name. Up to this point, everything was working.
The researcher then analysed the token to see what it consisted of, and tried to decode it to check whether it stored user information that could be exploited via IDOR or something similar. After decoding, it stored user data like ID, username, and email. However, part of the token was encrypted, so it was not possible to simply decode it, modify the user_id, re-encode it, and use it.
Exploitation
Step 1: Test whether the token survives logout
The researcher went back to changing the account name, but this time kept the token that was used, logged out of the account, and logged back in. The account name was changed again, but instead of using the new active token, the old token used before logging out was substituted. It worked and changed the account name. This was identified as an Insufficient Session Expiration vulnerability.
Step 2: Move from the name change to the password change
Reporting the issue in that state would likely have been classified as Informative, so the same method was tried on the account password change feature. The platform had no security measures like 2FA for changing the password. The same process was repeated on the password change endpoint, and using an old token after logging out changed the account password.
Step 3: Assess how long the token stays valid
What made this more dangerous is that the token does not have a clear expiration date. From the researcher's testing, the token remained valid for more than 24 hours.
Because of this, the severity increased significantly, turning into Insufficient Session Expiration leads to Account Takeover, making it around High / P2. A report was written and submitted, but the reply was that it was a duplicate.

Root cause
The old token remained valid after the user logged out, and the server accepted it. The password change feature also lacked any additional protection: to change the password, the system only asks for the new password and a confirmation field. There is no requirement to enter the old password, and there is no 2FA or OTP verification. The combination means an attacker holding an old token can log into their own account, use the stolen token in the password change request, and successfully change the victim's password. This leads to a permanent account takeover, even if the victim clicks Logout, because the server still considers the old token valid.
Impact
The impact is highly critical due to a combination of two dangerous factors: the user's session token never truly expires, and the password change feature lacks any security protections. An attacker could take over any account on the platform just by having an old token of the victim. As for how an attacker could get this old token, there are many realistic ways, such as through XSS vulnerabilities. Furthermore, if an attacker manages to access the victim's account just once on a compromised device, they can grab the token and use it whenever they want to completely take over the account.
Fix
The suggested fixes are:
- When a user changes their password, the server should immediately invalidate all active sessions associated with that user account, except the current one.
- When a user clicks Logout, the server must not only delete the token from the browser but also invalidate or blacklist it on the server side. This ensures that even if an attacker has the old token, it will no longer work.
- Session tokens should have a reasonable expiration time. A token that stays valid for 24 hours or more without any rotation is dangerous. Developers should set a short lifetime for tokens and require users to re-authenticate after that period.
- Implement an additional layer of verification (such as 2FA or email OTP) before executing critical actions like changing the password or email address. This ensures that even if a session token is stolen, the attacker cannot complete the Account Takeover without access to the user's email or 2FA device.

- Logout invalidation on other endpoints: capture a token, log out, log back in, and replay the old token against profile updates, email change, password change, and any other authenticated action. A positive result is any state-changing request that succeeds with the pre-logout token.
- Password change without the old password: submit a password change using only the new password and confirmation fields. A positive result is a successful change with no old-password, 2FA, or OTP check.
- Token lifetime measurement: keep a token and replay it at intervals after logout. A positive result is the token still being accepted well beyond the expected session lifetime, as in the more than 24 hours observed here.
- Token structure probing: decode the token and look for user identifiers such as ID, username, and email. If part of the token is encrypted, test whether the encrypted portion can be swapped between accounts or whether the plaintext portion can be modified without invalidating the token.
- Cross-account token use: use a token from one account against another account's profile or password change request. A positive result is a successful change on the victim's account.
What happened, in plain words
A security researcher was testing a website that hosts presentations (think of a site where people upload slide decks and share them). While poking around, they found a mistake in how the site handles login sessions. A session is what keeps you logged in after you type your password: the site gives your browser a small piece of text called a token, and your browser sends it back with every request so the site knows who you are. Logging out is supposed to throw that token away so it can never be used again.
On this platform, logging out did not really end the session on the server. The old token kept working. Worse, the password change form did not ask for the old password and had no second check such as a code sent to your phone or email. Put those two things together and anyone who gets hold of an old token can change the victim's password and take over the account permanently.
The researcher first thought this was a minor issue, the kind that gets filed as low priority or "P4". After working out the full impact, they rated it around High / P2. They wrote a report and submitted it, and the reply was that it was a duplicate: someone else had already reported the same problem.

The pieces you need to know
Before walking through the steps, here are the basic ideas, because the rest of the article leans on them.
- A web request. When you click a button on a website, your browser sends a message to a computer somewhere (the server) asking it to do something, and the server sends a reply. That is all a request is.
- An API. Short for Application Programming Interface. In web terms it is the set of addresses (endpoints) a site's own pages talk to behind the scenes. For example, the page where you edit your profile sends your new name to an endpoint, and the server saves it. You never see these addresses in the address bar, but the browser uses them.
- An endpoint. One specific address on the server that does one specific job, such as "change the account name" or "change the password".
- A token (or session token). A short string of characters the server hands your browser after you log in. Your browser stores it (often in a cookie, which is a small labelled box of text a site keeps in your browser) and attaches it to every later request. The server reads it and says "ah, this is user X". It works like a cloakroom ticket: you hand in your coat, get a ticket, and the ticket proves the coat is yours. If someone else gets your ticket, they can collect your coat.
- A cookie. A small piece of data a website asks your browser to keep and send back on each visit to that site. The token in this story travels as a cookie named
auth_token. - Logging out. Normally this means two things: the browser deletes its copy of the token, and the server marks the token as dead so that even a copy of it stops working. This platform only did the first part.
- Session expiration. Sessions should not last forever. A token should stop working after a set time (say, a few hours) or after logout. "Insufficient Session Expiration" is the name for the bug where a token lives longer than it should.
- Access control. The rules about who is allowed to do what. A broken access control bug means one user can do something to another user's data.
- IDOR. Short for Insecure Direct Object Reference. It is a type of access control bug where a request contains an identifier (like a user ID number) and the server does not check that the person making the request is allowed to touch that particular record. If you can change the number in a request and see someone else's data, that is an IDOR.
- Account takeover. Exactly what it sounds like: an attacker gains full control of someone else's account, usually by changing the password so the real owner is locked out.
- 2FA and OTP. Two-factor authentication means a second proof of identity beyond the password, such as a code from an app or a text message. OTP means one-time password, the short code that is valid once. If a critical action like a password change asks for an OTP, a stolen token alone is not enough.
- XSS. Cross-site scripting, a bug where an attacker can get their own code to run inside someone else's browser on a website. It is one of the ways an attacker could steal a token.
- Severity ratings (P4, P2, High). Bug bounty programmes rank findings by how much damage they allow. P4 is the lowest, P2 is high, and "Informative" means "we saw it, but it is not really a security problem".
- VDP. Vulnerability Disclosure Programme: a scheme where a company accepts security reports, sometimes without paying a bounty.
- Duplicate. A report describing a bug the programme has already received from someone else.
The setup
The researcher was hunting for bugs in VDP programmes and was looking at a presentation platform. The two features involved are the user profile page, where you can change your own account details, and the password change feature. Normally the token is what tells the server which account these actions apply to, and logging out should end that.
The test involved taking a token that belongs to one account and using it while acting as another. That matters because the whole test is about taking a token that belongs to one account and using it while acting as another. The token looked like this:
auth_token=abk193
This is the name of the cookie (auth_token) followed by an equals sign and the value. The report does not describe any particular tools or software versions.
Finding it
Step 1: changing someone else's name
While looking for access control problems, the researcher noticed that the profile page let a user modify account data. They tried changing the account name using a token from a different account, like auth_token=abk193, and the victim's account name changed successfully.
Why this step matters: it proved the server trusted whatever token arrived and did not check that the token belonged to the account being edited. In plain terms, the cloakroom accepted a ticket for a different coat. At this point it looked like a normal access control bug.
Step 2: looking inside the token
Next, the researcher examined the token to see what it was made of. The idea was to decode it and check whether it carried user information that could be abused through an IDOR: if the token plainly contained a user ID, you could try swapping that number for another user's and see what happened.
After decoding, the token did contain user data such as ID, username, and email. But part of the token was encrypted. That meant the simple trick of decoding it, editing the user_id, encoding it again and sending it back would not work, because part of the token was encrypted, so decoding, editing and re-encoding was not possible.. So the researcher changed approach.
Step 3: does the token survive logout?
The researcher went back to the name change feature, but this time kept a copy of the token, logged out of the account, and logged back in. Then they changed the account name again, but instead of using the fresh token from the new login, they sent the old token from before the logout.
It worked. The name changed. That is the moment the bug became clear: the server had never invalidated the old token when the user logged out. This is what "Insufficient Session Expiration" means in practice. The old token from before logout was still accepted.
Why this step matters: a token that survives logout turns every leak of a token, however old, into a permanent key. The logout button gives users a false sense of safety.
Step 4: from name change to password change
Reporting only the name change would probably have been filed as "Informative", because changing a display name is annoying but not serious. So the researcher repeated the same method against the password change feature.
They noticed the platform had no extra protection such as 2FA on password changes. They repeated the process on the password change endpoint, and using an old token after logging out changed the account password.
Why this step matters: the name change proved the token outlived logout, but the password change proves the consequence. Whoever controls the password controls the account.
Step 5: how long does the token live?
What made the issue worse was that the token had no clear expiration date. In the researcher's testing, it stayed valid for more than 24 hours.
Why this step matters: the longer a token lives, the bigger the window for an attacker to use a stolen one. A token that works for a day or more, with no rotation, is a standing invitation.
Because of this, the severity rose sharply. The finding became "Insufficient Session Expiration leads to Account Takeover", rated around High / P2. The researcher wrote it up and submitted it. The reply was that it was a duplicate.

Why it works: the root cause
Two separate weaknesses combine here.
- The server keeps accepting tokens after logout. Logging out should tell the server "this token is dead". Here the server carried on treating the old token as valid, so a copy taken before logout still worked afterwards.
- The password change asks for almost nothing. To change the password, the system only asks for the new password and a confirmation field. There is no requirement to type the old password, and there is no 2FA or OTP check.
Put together, an attacker holding an old token can log into their own account, prepare a password change request, swap in the victim's old token, and change the victim's password. The takeover is permanent, and it survives the victim clicking Logout, because the server still considers the old token valid.
The impact
The report calls the impact highly critical, for the same two reasons. The session token never truly expires, and the password change has no protection. An attacker could take over any account on the platform just by holding an old token for it.
How would an attacker get such a token? The report names XSS as one realistic route: if an attacker can run their own code in a victim's browser on the site, they can read the token. Another route: if an attacker ever gets access to the victim's account once, on a shared or compromised device for example, they can copy the token and use it whenever they like to take the account over completely.
How to fix it
The report lists four measures.
- Kill other sessions on password change. When a user changes their password, the server should immediately invalidate all active sessions for that account, except the one making the change. If someone else was using an old token, they are thrown out at the exact moment the real owner takes back control.
- Make logout real. When a user clicks Logout, the server must not only delete the token from the browser but also invalidate or blacklist it on the server side. Then even an attacker holding a copy finds it no longer works.
- Give tokens a sensible lifetime. A token that stays valid for 24 hours or more without rotation is dangerous. Set a short lifetime and require the user to log in again after it expires.
- Add a second check for critical actions. Require something extra, such as 2FA or an email OTP, before changing the password or email address. Then a stolen token alone is not enough: the attacker also needs access to the victim's email or 2FA device.

Things worth testing on other sites
- Logout invalidation on other endpoints. Capture a token, log out, log back in, and replay the old token against profile updates, email change, password change, and any other action that requires being logged in. Any request that changes something and succeeds with the pre-logout token is a positive result.
- Password change without the old password. Submit a password change using only the new password and confirmation fields. A successful change with no old-password, 2FA or OTP check is a positive result.
- Token lifetime measurement. Keep a token and replay it at intervals after logout. A positive result is the token still being accepted well beyond the expected session lifetime, as in the more than 24 hours observed here.
- Token structure probing. Decode the token and look for user identifiers such as ID, username and email. If part of the token is encrypted, test whether the encrypted portion can be swapped between accounts, or whether the plaintext portion can be modified without invalidating the token.
- Cross-account token use. Use a token from one account against another account's profile or password change request. A successful change on the victim's account is a positive result.
Glossary
- 2FA (two-factor authentication): a second proof of identity beyond the password, such as a code from an app or a text message.
- Access control: the rules deciding who is allowed to do what on a system.
- Account takeover: an attacker gaining full control of someone else's account, usually by changing its password.
- API (Application Programming Interface): the set of addresses a website's pages use behind the scenes to talk to its server.
- Cookie: a small piece of data a website asks your browser to store and send back on each request to that site.
- Duplicate: a bug report describing a problem the programme has already received from someone else.
- Endpoint: one specific address on a server that performs one specific job.
- IDOR (Insecure Direct Object Reference): an access control bug where a request contains an identifier such as a user ID and the server does not check that the requester may access that record.
- Informative: a report outcome meaning the programme saw the issue but does not consider it a security problem.
- OTP (one-time password): a short code valid for a single use, often sent by email or text message.
- P2 / P4: positions on a bug bounty severity scale, where P4 is the lowest and P2 is high.
- Request: a message a browser sends to a server asking it to do something, and the reply the server sends back.
- Session: the state of being logged in, kept alive by a token the browser sends with each request.
- Session expiration: the point at which a session token stops being accepted, whether by time or by logout.
- Session token: a string the server gives your browser after login, which proves who you are on later requests.
- Severity: a rating of how much damage a bug allows, often expressed as P-levels or words such as High.
- XSS (cross-site scripting): a bug that lets an attacker run their own code inside someone else's browser on a website, which can be used to steal tokens.