essays on the failure of machines
18 Oct 2014 · 562 words · 3 min

Hijacking Google Calendar events and other missing access controls

contents 5 sections

Introduction

  1. User A creates an event that can’t be modified by guests.
  1. User B receives an invitation. The “more details” link leads to a URL like:

https://www.google.com/calendar/event?action=VIEW&eid=MW5hNm5hcnFzdm44ZnM4OGtwbDhrMjhzdTggZWNuZWxhZGlzQG0&tok=MjQjbWljaGFsLmEubWFyZWtAZ21haWwuY29tODQ0MzNmZDVlZTZiMTBkYzgzNjY5M2RlMzZkYzRlNTcyYzE4YzhjNg&ctz=Europe/Berlin&hl=en

which is accessible to users A and B, but inaccessible to any other Google user (let’s call them user C):

Viewing private events as an anonymous user

However, the first security issue is that it’s accessible to any anonymous (not logged-in) user:

Modifying responses of attendees

Furthermore, we can tamper with the eid parameter from the URL, which is Base64-encoded. So base64_to_text("MW5hNm5hcnFzdm44ZnM4OGtwbDhrMjhzdTggZWNuZWxhZGlzQG0") = "1na6narqsvn8fs88kpl8k28su8 ecneladis@m", where @m is short for @gmail.com. The first part is common to every invited user, and I guess it’s a token unique to the given event. The second part identifies the current user. So we can modify it to text_to_base64("1na6narqsvn8fs88kpl8k28su8 jon.doe@gmail.com").

Voilà, we’re still not authenticated with Google, but we’re able to modify the reply status from the event creator’s context:

We can also perform other actions by impersonating the event’s creator and modifying the event for every invited person, or we can modify the event only for a specific person by specifying the proper email in the eid parameter. No cookies are needed; the only requirement is to tamper with the eid parameter. As mentioned before, the eid and tok parameters are available to every invited person - so they can easily bypass the authentication mechanism for the given events.

Hijacking events

In a similar fashion, from the context of user B, I was able to pass the eid parameter specific to an event managed by user A and transfer its ownership to user C.

Taking someone else's event

B is an ordinary guest, signed in as themselves. Nothing in the request below comes from A.

A · ownerB · guestCalendarC
1creates "Test event 2"; guests can't modify it
2invitation: eid + tok
3POST /calendar/reqevxfer with the eid of A's event
4email: "… would like to transfer ownership of Test event 2 to you"
5accepts
C now owns A's event. A never asked for the transfer.
Steps 3 and 4 are shown in the screenshots below: the transfer request, and the email that reached C.

–

–

Summary

Who could do what

The event was set so that guests can't modify it. Red cells are where Calendar allowed more than that.

actionmeant foractually possible for
View the event, signed in as a stranger (C)nobodynobody, correctly blocked
View the eventA and the guestsalso anyone not signed in who has the link
Change a guest's responsethat guestanyone with the link, signed out, by rewriting eid
Edit the event, e.g. its titleA onlyanyone with the link, signed out, acting as A
Transfer ownershipA onlyguest B, using the eid of A's event
Every guest gets a working eid and tok in their invitation, so "anyone with the link" includes every guest and anyone they forward it to.