Wednesday, January 22, 2025
HomeCVE/vulnerabilityHackers Actively Exploiting WordPress Plugin Arbitrary File Upload Vulnerability

Hackers Actively Exploiting WordPress Plugin Arbitrary File Upload Vulnerability

Published on

SIEM as a Service

Follow Us on Google News

Hackers have been actively exploiting a critical vulnerability in the WordPress plugin 简数采集器 (Keydatas).

The vulnerability, CVE-2024-6220, allows unauthenticated threat actors to upload arbitrary files to a vulnerable site, potentially leading to remote code execution and complete site takeover.

This alarming development underscores the importance of maintaining updated plugins and robust security measures.

Discovery and Initial Response

On June 18, 2024, during the 0-day Threat Hunt Promo of Wordfence’s Bug Bounty Program, a researcher known as Foxyyy discovered and responsibly reported the vulnerability.

The flaw was found in the Keydatas plugin, which has over 5,000 active installations. The vulnerability was quickly confirmed, and active exploitation attempts were observed within days.

CVE-2024-6220­ – Vulnerability Details

The vulnerability summary from Wordfence Intelligence reveals a critical flaw in the 简数采集器 (Keydatas) plugin for WordPress, affecting all versions up to and including 2.5.2.

Identified as CVE-2024-6220, this vulnerability allows unauthenticated arbitrary file uploads due to missing file type validation in the keydatas_downloadImages function.

AttributeDetails
Description简数采集器 (Keydatas) <= 2.5.2 – Unauthenticated Arbitrary File Upload
Affected Plugin简数采集器 (Keydatas)
Plugin Slugkeydatas
Affected Versions<= 2.5.2
CVE IDCVE-2024-6220
CVSS Score9.8 (Critical)
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
ResearcherFoxyyy
Fully Patched Version2.6.1
Bounty Award$488.00
Vulnerability DetailsThe vulnerability stems from missing file type validation in the keydatas_downloadImages function, allowing attackers to upload arbitrary files, including malicious PHP scripts, to the WordPress uploads directory. This directory is publicly accessible, enabling remote code execution.

Technical Analysis

The Keydatas plugin connects a WordPress site with the keydatas.com app, primarily used to manage WordPress posts. The plugin’s keydatas_post_doc() function includes a password check, but the default password is set to “keydatas.com”.


$kds_password = get_option('keydatas_password', "keydatas.com"
$post_password = keydatas_getPostValSafe('kds_password');
if (empty($post_password) || $post_password != $kds_password) {
    keydatas_failRsp(1403, "password error", "提交的发布密码错误");
}

If site owners do not change this default password, attackers can exploit the plugin’s functions, including the vulnerable keydatas_downloadImages() function.


$docImgsStr = keydatas_getPostValSafe("__kds_docImgs");
if (!empty($docImgsStr)) {
    $docImgs = explode(',',$docImgsStr);
    if (is_array($docImgs)) {
        $upload_dir = wp_upload_dir();
        foreach ($docImgs as $imgUrl) {
            $urlItemArr = explode('/',$imgUrl);
            $itemLen=count($urlItemArr);
            if($itemLen>=3){
                //
                $fileRelaPath=$urlItemArr[$itemLen-3].'/'.$urlItemArr[$itemLen-2];
                $imgName=$urlItemArr[$itemLen-1];
                $finalPath=$upload_dir['basedir'] . '/'.$fileRelaPath;
                if (wp_mkdir_p($finalPath)) {
                    $file = $finalPath . '/' . $imgName;
                    if(!file_exists($file)){
                        $doc_image_data = file_get_contents($imgUrl);
                        file_put_contents($file, $doc_image_data);
                    }
                }
            }
        }//.for
    }//..is_array
}

The function downloads files specified in the __kds_docImgs request parameter using file_get_contents() and uploads them to the WordPress uploads directory using file_put_contents().

The lack of file type or extension checks allows attackers to upload malicious PHP files, potentially compromising site sites.

Top Attacking IP Addresses

  • 103.233.8.166 (Hong Kong)
  • 103.233.8.0 (Hong Kong)
  • 163.172.77.82 (France)
  • 84.17.37.217 (Hong Kong)
  • 84.17.57.0 (Hong Kong)

Wordfence Premium, Care, and Response users received a firewall rule to protect against this vulnerability on June 20, 2024.

Free users received the same protection on July 20, 2024. The Keydatas team was contacted on June 20, 2024, but after no response, the issue was escalated to the WordPress.org Security Team, leading to the plugin’s closure on July 16, 2024.

A patch was released on July 29, 2024. Users are urged to update to the latest patched version, 2.6.1, immediately.

To safeguard against such exploits, plugins must be regularly updated, vulnerability scans conducted, and robust firewall protection employed.

The active exploitation of the CVE-2024-6220 vulnerability in the Keydatas plugin highlights the critical need for vigilance in maintaining website security.

By staying informed and proactive, website owners can protect their sites from malicious attacks and ensure a safer web environment for all.

Are you from SOC and DFIR Teams? – Analyse Malware Incidents & get live Access with ANY.RUN -> Free Access

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Latest articles

The Growing Role of AI-Powered SAST in the Developer Toolkit

In today’s app dev world, where new apps and millions of lines of code...

Ex-CIA Analyst Pleaded Guilty For Leaking Top Secret National Defense Information

A former CIA analyst, Asif William Rahman, has pleaded guilty to charges of retaining...

Record Breaking 5.6 Tbps DDoS attack Launched by Mirai Botnet

 The Mirai botnet unleashed a record-breaking Distributed Denial of Service (DDoS) attack on October...

Criminal IP and OnTheHub Partner to Deliver Advanced Cybersecurity Solutions for Education

AI SPERA, a leading Cyber Threat Intelligence (CTI) provider, has collaborated with OnTheHub, a...

API Security Webinar

Free Webinar - DevSecOps Hacks

By embedding security into your CI/CD workflows, you can shift left, streamline your DevSecOps processes, and release secure applications faster—all while saving time and resources.

In this webinar, join Phani Deepak Akella ( VP of Marketing ) and Karthik Krishnamoorthy (CTO), Indusface as they explores best practices for integrating application security into your CI/CD workflows using tools like Jenkins and Jira.

Discussion points

Automate security scans as part of the CI/CD pipeline.
Get real-time, actionable insights into vulnerabilities.
Prioritize and track fixes directly in Jira, enhancing collaboration.
Reduce risks and costs by addressing vulnerabilities pre-production.

More like this

The Growing Role of AI-Powered SAST in the Developer Toolkit

In today’s app dev world, where new apps and millions of lines of code...

Ex-CIA Analyst Pleaded Guilty For Leaking Top Secret National Defense Information

A former CIA analyst, Asif William Rahman, has pleaded guilty to charges of retaining...

Record Breaking 5.6 Tbps DDoS attack Launched by Mirai Botnet

 The Mirai botnet unleashed a record-breaking Distributed Denial of Service (DDoS) attack on October...