Stored XSS in drive.uber.com WordPress admin panel
The All In One Event Calendar plugin on drive.uber.com stored unfiltered error details, including a controllable URL, in the WordPress admin dashboard. An attacker could inject JavaScript that executes with administrator privileges when an admin views the dashboard.
- Fixed in 4 days
- Paid in 19 days
- Disclosed after 49 days
There is another bug in the All In One Event Calendar plugin used on drive.uber.com. An attacker can inject arbitrary JavaScript in the administrative Dashboard of WordPress. The script would be evaluated under administrator privileges (as only logged-in administrators can view the Dashboard). Such script can use AJAX calls to achieve a server-side compromise unless some kind of special protections are in place.
The script can be injected by causing an error condition in the calendar plugin. One way to trigger an error is described below. Whenever this happens, the plugin disables itself and places an error message "banner" in the administrative Dashboard and shows it to any administrator who logs on afterwards.
The error details can be manipulated by the attacker and special HTML characters aren't filtered. The error message includes e.g. the URL which triggered the error, which is controllable by the attacker.
#Reproducing#
The attack requires sending a malformed HTTP request without encoding special characters in the URL. Therefore this can't be done with a normal web browser. For example a PERL script like this produces the request:
#!/usr/bin/perl
open(NC,"|openssl s_client -connect drive.uber.com:443 -quiet") || die;
print NC "GET /oh/?ai1ec_js_widget=ai1ec_agenda_widget&render=true&events_per_page=$%&xss=<svg/onload=alert(/stored-xss/.source)>\r\n";
HTTP/1.1\r\n";
print NC "Host: drive.uber.com\r\n";
print NC "\r\n";
close(NC);
The HTTP response is a redirect back to the "front page", meaning the plugin couldn't render the calendar JSON data as supposed, but encountered an error condition.
Reproducing this of course requires that the plugin is reactivated (it's is currently disabled because I tested this).
Next, when an administrator logs on the system and is presented with the WordPress Dashboard, they should get an alert box, showing that the attacker-supplied JavaScript has been stored in the Dashboard.
Injecting another code won't work until the plugin is reactivated.
#Details#
The error in this case is an invalid format string in an SQL query, caused by the malformed events_per_page parameter. The XSS payload is included later in the URL above and gets included in the error message.
I have tested this bug on a local test server running WordPress and the All In One Event Calendar plugin. The difference is that instead of nginx my test server runs Apache. This, or other aspects of your server architecture might introduce differences in URL encoding etc. which could prevent the example from working (I'll test with nginx later).
#Impact#
Instead of showing an alert box, the script could use AJAX functions to e.g. create a new administrator user with a known password, or write arbitrary PHP code on the server via the plugin or theme editors. I've referred to such demonstrations in my previous reports.
#Fix#
I haven't reported this to the plugin author yet. One way to protect against this is to comment out the error detail generation in the file wp-content/plugins/all-in-one-event-calendar/lib/exception/handler.php, end of file (not tested).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The plugin did not filter special HTML characters when generating error messages, allowing attacker-controlled input to be stored and later rendered in the admin dashboard.
Impact
The injected script could use AJAX to create a new administrator user or write arbitrary PHP code, leading to server compromise, unless special protections are in place.
What the attacker needed
Plugin is active; attacker can send malformed HTTP request; administrator views dashboard
The fix
The error detail generation in the plugin's exception handler should be commented out or otherwise prevented from including unfiltered input.
How it was found
- Send a malformed HTTP request to the calendar plugin with a crafted events_per_page parameter and an XSS payload in the URL.
- The plugin encounters an error and stores an error banner containing the unfiltered URL in the WordPress admin dashboard.
- An administrator logs in and views the dashboard, causing the stored JavaScript to execute.
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 report has not been written yet. The Original tab links to the source.
A calendar plugin on a WordPress site showed error messages to administrators. The attacker could put their own code into the error message, and when an admin looked at the dashboard, that code ran in the admin's browser. This is called stored cross-site scripting (XSS) because the malicious code is saved on the server and later runs for someone else.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.