Reading anyone's GroupMe messages through its push server
GroupMe's real-time push server let a client with no login read any user's messages as they were sent, and send forged ones into their app. Fixed in June 2024.
In April 2024 I found that GroupMe's real-time push server would let anyone listen to any account. With no login and no access token, a short script could subscribe to a user's channel and receive their direct messages, the messages in every group they belonged to, and the invite details of groups they were added to, as each event happened. The same gap let it send forged messages into anyone's app. I reported it to the Microsoft Security Response Center, which confirmed it and shipped a fix seven weeks later.
Summary
- Product: GroupMe (Microsoft); the report listed component version 1.3.7.40
- Impact: real-time read access to the direct and group messages of any GroupMe user, including private groups, and the ability to deliver forged messages to any user
- Reported: April 24, 2024, to MSRC (case 87624)
- Fixed: June 13, 2024, as reported by MSRC
How GroupMe delivers messages
GroupMe's clients keep a long-lived connection to push.groupme.com/faye, a Faye server. Faye implements the Bayeux publish and subscribe protocol: clients subscribe to named channels, and the server pushes every event published on a channel to its subscribers. GroupMe gives each user a channel named /user/{id} and each group one named /group/{id}. When someone sends you a message, likes your post, or adds you to a group, the event arrives on your user channel.
That design is common and sound, provided the server checks every subscription: the client should prove who it is, normally with an access token, and the server should only allow channels that belong to that account.
The flaw
My client sent no token at all. The only thing it added to each Bayeux message was a field named authenticated set to true. The server accepted subscriptions to any user or group channel I asked for. I can't see GroupMe's server code, so I can't say whether it trusted that field or skipped the check entirely. Either way, nothing tied a subscription to a signed-in account that owned the channel.
const Faye = require('faye');
const client = new Faye.Client('https://push.groupme.com/faye');
// No access token is sent. This flag is the only addition.
client.addExtension({
outgoing(message, callback) {
message.authenticated = true;
callback(message);
},
});
// Any user's numeric ID works here.
client.subscribe(`/user/${userId}`).withChannel((channel, event) => {
console.log(event.type, event.subject);
}); What a subscriber received
Subscribing to a user's channel delivered the same events their own app received:
direct_message.create: every direct message to the user, with the sender's name and the full textline.create: every message in every group the user belonged to, private groups included, with links to attached imageslike.create: who liked whatmembership.create: when the user was added to a group, its name, description, member list summary, invite link, and the group's SMS phone number
From one account to everyone they talk to
User IDs are plain numbers, and every event carries the sender's ID. My proof of concept subscribed to each new ID it saw, so watching a single account soon meant watching everyone who messaged it, and then everyone who messaged them. An attacker would not have needed a list of targets; the traffic supplied one.
Writing, not only reading
Bayeux lets a client publish to a channel as well as subscribe to it, and the same missing check covered both. From the same unauthenticated connection, I could publish events to another user's /user/{id} channel. Their app received them like any other event, and every field in a forged event, including who sent it, was mine to choose.
In testing, I sent:
- a group message attributed to another member, in this case a new poll that member had never created
- a direct message with its sender set to GroupMe itself, using the
systemsender type the service uses for its own notices - group system events such as
group.owner_changedandgroup.role_change_admin
// A direct message that claims to come from GroupMe.
client.publish(`/user/${targetId}`, {
type: 'direct_message.create',
subject: {
name: 'GroupMe',
sender_type: 'system',
recipient_id: targetId,
text: 'GroupMe Security Update: ...',
source_guid: crypto.randomBytes(16).toString('hex'),
created_at: Date.now(),
attachments: [],
},
}); A message that appears inside the real app, from GroupMe or from a friend, is about the most convincing phishing lure there is. And because publishing needed no account, nothing limited how much could be sent: a loop over a group's member list could push hundreds of events to every member.
Disclosure timeline
- April 24, 2024: reported to MSRC with a proof-of-concept script and a video of it reading live messages.
- April 26, 2024: MSRC opened case 87624.
- June 11, 2024: MSRC confirmed the behavior.
- June 13, 2024: MSRC reported the fix and closed the case. The fix also stopped forged publishing, which I had not reported. MSRC offered an acknowledgement on its Online Services researcher page; GroupMe was outside the bounty program, so no bounty was paid.
For anyone running a pub/sub server
Authorize every subscribe and publish request on the server, against a session the server issued, and check that the channel belongs to that session. Clients should rarely be allowed to publish to another user's channel at all. Anything the client sends about its own trust level, a flag like authenticated included, is input, not proof. Faye supports this directly through server-side extensions that can reject an incoming subscribe or publish message before it takes effect.