Skip to content
Access control Write-up Advanced

CVE-2024-23832 Mastodon Vulnerability: Remote user impersonation and takeover

Mastodon versions before certain patches failed to validate the id property of remote ActivityPub objects, allowing attackers to impersonate any remote actor as seen from the vulnerable server. This could also overwrite existing objects and intercept further traffic between the server and the impersonated actor.

github.com

Published on github.com

Due to a gap in validation of federated content in the affected Mastodon versions, attackers can craft payloads that impersonate remote ActivityPub actors (federated accounts) as-seen-from the affected server.

The author, on github.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

The FetchRemoteResource code path passed the fetched object's self-reported id instead of the queried URL, so the id was never compared against the actual location.

Impact

Attackers could impersonate any remote ActivityPub actor as seen from a vulnerable Mastodon server, even if the remote server did not use Mastodon, and could overwrite existing objects to intercept further traffic.

What the attacker needed

Ability to serve crafted ActivityPub content; vulnerable Mastodon server fetches the content

The fix

The text lists patched versions but does not describe the fix; it should be fixed by comparing the fetched object's id against the queried URL before trusting it.

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.

Mastodon is social software that talks to other servers using a protocol called ActivityPub. Each account and post has a unique web address (its id), and servers normally check that this address matches where the content was actually fetched from. A missing check let an attacker claim any address they liked, so the server believed fake content came from a real remote account.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.