Skip to content
Info disclosure Write-up Beginner

You can’t stop me. MS Teams session hijacking and bypass

Microsoft Teams stores unencrypted session tokens and cached conversations in the user's roaming AppData folder. An attacker who can read that folder can copy it to another machine and open Teams to gain access to the victim's account without authenticating or triggering conditional access policies.

Bandit Pingu Follow

Published on pentestpartners.com

How cleartext session tokens are stored in an unsecured directory that can be stolen and used to impersonate a Teams user.

PTP Admin, on pentestpartners.com

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a design choice: Teams keeps its cookie database and cached data unencrypted in the roaming AppData folder so the data can follow users across devices, which means anyone with file access can read the tokens.

Impact

An attacker with access to the folder could impersonate the user in Teams, read cached direct messages and channel conversations, and bypass multi-factor authentication and conditional access policies; the author notes the issue cannot be mitigated and is unlikely to be fixed by Microsoft.

What the attacker needed

Read access to the victim's Teams folder; ability to run Teams on another machine

The fix

The text says it cannot be mitigated and is unlikely to be fixed; the only suggested action is monitoring and alerting on the Teams data folders on Windows, macOS and Linux.

How it was found

  1. Copy the victim's Teams folder from their roaming AppData directory, optionally keeping only the listed files to reduce size.
  2. Set up a virtual machine with Teams installed.
  3. Replace the Teams folder on the virtual machine with the victim's copied folder.
  4. Open Teams to get an authenticated session as the victim.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you log into an app, it often saves a small file called a session token so you do not have to type your password again. Teams saved these tokens in plain text in a folder that is meant to be copied between computers, so anyone who could read that folder could take the tokens and use them to act as the victim. Because the token already proves the login happened, extra checks like multi-factor authentication are skipped.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.