CVE-2026-18781 vulnerability and BitFire protection

How BitFire Stops CVE-2026-18781 PHAR Upload Exploitation

WordPress 漏洞研究

BitFire blocks malicious uploads and PRO RASP prevents unauthorized PHAR creation through the vulnerable Contact Form 7 add-on.

Unauthenticated Critical Severity Remote Code Execution Unrestricted File Upload
BitFire·漏洞通报研究发表
咨询CVE-2026-18781
组件Drag and Drop Multiple File Upload for Contact Form 7
相关来源inc/dnd-upload-cf7.php — dnd_upload_cf7_upload() filename pipeline
执行摘要

WordPress 管理员需要了解什么

CVE-2026-18781 is a critical unauthenticated filename-validation flaw in Drag and Drop Multiple File Upload for Contact Form 7 before version 1.3.9.9. An attacker can obtain a nonce, then POST a PHAR polyglot whose filename hides `phar` with an interleaved control byte. Validation sees an allowed extension, but later filename normalization removes the byte and reconstructs a dangerous PHAR name before the file is written. Code execution then depends on the form and server stack or a reachable `phar://` file-operation sink. BitFire Bot Protection blocks restricted automated POST delivery, the WAF inspects and rejects malicious upload content, and BitFire PRO RASP prevents unauthorized PHAR archive creation at the filesystem boundary.

一目了然

主要事实

  • All versions before 1.3.9.9 are affected
  • The public admin-ajax.php upload path requires no WordPress account
  • A control byte hidden inside `phar` bypasses pre-normalization filename checks
  • Direct execution depends on form settings and the server PHP-handler configuration
  • Version 1.3.9.9 rejects control bytes and validates the final normalized filename
  • BitFire WAF blocks malicious uploads and PRO RASP prevents unauthorized PHAR creation
01
漏洞概述

了解曝光

WordPress 网站受影响的组件、攻击路径和实际风险。

受影响的组件Drag and Drop Multiple File Upload for Contact Form 7
潜在影响范围60,000安装
攻击技术unrestricted file upload
已发表2026-09-22
BitFire stops this exploit at three decisive boundaries: automated POST delivery, malicious upload inspection, and unauthorized PHAR creation on disk.
02
技术分析

该漏洞如何发挥作用

研究详细信息、受影响的版本、利用行为和补救指南。

A Filename Mutation Reconstructs a Dangerous PHAR Archive

The plugin exposes `dnd_codedropz_upload` through unauthenticated `admin-ajax.php`; a companion action issues a usable nonce to anonymous callers, so no WordPress account is required. In version 1.3.9.8, the handler checks the multipart filename before Contact Form 7 removes control characters. A name with a control byte inside `phar` therefore passes the ASCII, blacklist, allowlist, and MIME-pattern checks as an allowed image. The final normalization silently removes that byte and writes `poc.phar.jpg`, or literal `poc.phar` when a form permits `filetypes:*`. Direct PHP execution requires a compatible Apache handler and ineffective upload-directory denial. The default `.jpg` result instead requires another attacker-influenced `phar://` file-operation sink and a viable POP chain. Those dependencies matter, but the upload still places an intact attacker-controlled PHAR on the server.

BitFire FREE Stops Automated Delivery and Malicious Upload Content

BitFire Bot Protection evaluates the client before the vulnerable plugin runs. Unknown or restricted automation cannot POST to the public AJAX actions, mint the nonce, or submit the multipart upload unless it is explicitly allowed; clients presenting as browsers must pass lightweight JavaScript verification. This blocks common scripted exploit delivery at the request boundary, while a verified browser or allowlisted integration still remains subject to later controls. The BitFire WAF then evaluates what the upload contains. Its malicious-upload inspection rejects web shells, executable PHP, malicious code, and other dangerous payloads before the vulnerable handler writes them. A weaponized PHAR polyglot carrying PHP and serialized exploit material crosses that inspection boundary. These request protections are available in BitFire FREE for eligible non-commercial sites; commercial use requires the appropriate license.

BitFire PRO RASP Prevents Unauthorized PHAR Creation

BitFire PRO RASP provides the independent runtime boundary that remains effective if a human-controlled client reaches the AJAX handler or an upload evades request filtering. Filesystem protection observes the attempted write and prevents an unauthenticated requester from creating the attacker-controlled PHAR archive. That blocks the dangerous on-disk primitive itself: there is no literal `.phar` for a permissive PHP handler to execute and no disguised `.phar.jpg` archive for a later `phar://` operation to parse. RASP does not repair the plugin's filename ordering or sanitize the supplied name. It denies the unauthorized filesystem outcome after request processing begins, preventing this vulnerable upload path from establishing executable PHP, a PHAR gadget payload, or a persistent backdoor.

Patch 1.3.9.9, Then Investigate for Persistence

Upgrade immediately to version 1.3.9.9 or later. The release rejects control and DEL bytes, moves anti-script normalization before extension extraction, validates the final filename that will be written, and hardens blacklist matching and dangerous-basename checks. The writeup also identifies residual separator-based PHAR reconstruction in 1.3.9.9, so administrators should retain layered upload and runtime protection rather than relying on filename validation alone. Patching does not remove an earlier compromise. Run BitFire Threat Hunter to find backdoor administrator accounts, hidden database triggers, long-running PHP processes, and droppers that can restore malware or reinfect the site. Remove discovered persistence, review upload and access logs, and rotate WordPress, hosting, database, and deployment credentials. An absent or auto-deleted upload does not prove the site is clean.

Block the Upload Chain Before It Becomes Code Execution

Sites running an affected release should update now and treat prior public upload exposure as an incident-response trigger. Deploy BitFire to enforce every meaningful boundary in this chain: Bot Protection denies restricted automated POST activity, the WAF rejects malicious upload payloads before plugin processing, and BitFire PRO RASP prevents unauthorized PHAR creation even when vulnerable code is reached. Then use Threat Hunter to investigate whether an attacker established another foothold during the exposure window. Patch the plugin, enable BitFire's layered protection, remove any persistence, and rotate relevant credentials rather than trusting server-specific execution restrictions as the only barrier.

03
来源审查

易受攻击和固定的代码

相关来源位于 inc/dnd-upload-cf7.php — dnd_upload_cf7_upload() filename pipeline.

之前弱势行为
$extension = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );

if ( ( ! preg_match( $file_type_pattern, $filename )
     || ! dnd_cf7_validate_type( $extension, $supported_type ) )
   && $supported_type != '*' ) {
    wp_send_json_error( $error_invalid_type );
}

// Dangerous mutation occurs after validation.
$filename = wpcf7_antiscript_file_name( $filename );
$new_file = path_join( $path['upload_dir'], $filename );
move_uploaded_file( $tmp_file, $new_file );
之后纠正行为
// Reject control/DEL bytes.
$pattern = '/^[\x20-\x7E\p{L}\p{N}\p{M}\p{Z}\p{P}\p{Sc}]+$/u';

$filename = dnd_cf7_remove_icons( $filename );

// Normalize before extracting and validating the extension.
$filename = wpcf7_antiscript_file_name( $filename );
$extension = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );

// Revalidate the exact filename that will be written.
$final_ext = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
if ( $supported_type == '*' && (
    in_array( $final_ext, $not_allowed_ext, true )
    || dnd_cf7_is_dangerous_filename( $filename )
) ) {
    wp_send_json_error( $error_invalid_type );
}
04
零日保护

防止第一个利用请求

BitFire 在漏洞被公开之前以及其他供应商有时间开发签名或补丁之前,在零天保护 WordPress 服务器。

01 · 验证停止未知客户端

在之前未知的漏洞代码到达 WordPress 之前,机器人控制和浏览器验证会阻止不受信任的自动化客户端。

02·检测阻止恶意行为

常规 WAF 保护可识别危险的请求行为和恶意负载,而无需等待特定于漏洞的签名。

03 · 预防遏制运行时攻击

RASP 遵循 PHP 内部的执行,防止对受保护的文件、帐户和数据库内容进行未经授权的更改。

BitFire · WordPress 保护零日准备就绪
BitFire 零日 WordPress 漏洞防护
BitFire 结合了经过验证的客户端控制、基于行为的 WAF 检测和运行时 RASP 实施,可在漏洞利用名称、CVE、签名或供应商补丁之前保护 WordPress。
关于作者

科里·马什

Cory 拥有 20 多年的互联网安全经验,是 BitFire 项目的首席开发人员。

阅读 BitFire 安全研究 →
保护您的 WordPress 网站

在下一个漏洞到来之前添加保护。

BitFire 将机器人控制、请求检查、恶意软件检测和运行时保护结合在一个 WordPress 安全平台中。

免费保护我的网站 →