Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : July 5, 2026

CVE-2026-57321: Interactive Content – H5P <= 1.17.7 Authenticated (Contributor+) Arbitrary File Deletion PoC, Patch Analysis & Rule

Plugin h5p
Severity High (CVSS 8.1)
CWE 22
Vulnerable Version 1.17.7
Patched Version 1.17.8
Disclosed June 25, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-57321:
This vulnerability allows authenticated attackers with Contributor-level access to delete arbitrary files on the WordPress server. The flaw exists in the Interactive Content – H5P plugin versions up to and including 1.17.7. The CVSS score is 8.1, indicating high severity.

The root cause resides in insufficient file path validation within the H5P editor library. Specifically, the vulnerable code is in `/h5p/h5p-editor-php-library/h5peditor.class.php` at lines 176-177. The original check uses `preg_match(‘/^(w+://|../)/i’, $oldFiles[$i]) === 0` to block only files with protocol prefixes or directory traversal sequences. This regex does not catch files containing `./` (current directory references) or `//` (double slash). An attacker can supply a path like `./wp-config.php` which passes the old validation. The function `removeContentFile` then deletes the file without sufficient sanitization. Additionally, the `cloneContentFile` method in `/h5p/h5p-php-library/h5p-default-storage.class.php` at line 334 also lacked similar validation.

Exploitation requires Contributor-level access or higher. The attacker interacts with the H5P content editor, likely via AJAX endpoints that trigger the file cleanup routine. By sending a crafted request to the H5P content update or creation action, the attacker sets `oldFiles` parameters containing malicious file paths. The vulnerable loop iterates over old files and deletes those not present in the new file list. The attacker supplies a path like `./wp-config.php` which bypasses the original regex, causing the plugin to delete the target file. The exact AJAX action is likely `h5p_update_content` or similar, but the core issue is the path validation bypass.

The patch changes the path validation in `h5peditor.class.php` from a regex to explicit checks using `str_contains` for `./` and `//`. The new condition is `!str_contains($oldFiles[$i], ‘./’) && !str_contains($oldFiles[$i], ‘//’)`. This blocks any file path containing a current directory reference or double slashes. A similar fix was applied to `cloneContentFile` in `h5p-default-storage.class.php` with a guard that returns early if `str_contains($file, ‘./’)`. These changes prevent attackers from using relative or malformed paths to escape the intended content directory.

The impact is severe: authenticated attackers can delete critical files such as `wp-config.php`, which contains database credentials and security keys. Deleting this file can allow remote code execution if the WordPress installation attempts to regenerate the config file or if the site becomes misconfigured. Arbitrary file deletion can also remove `.htaccess`, `index.php`, or plugin/theme files, leading to site defacement, denial of service, or further exploitation.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/h5p/h5p-editor-php-library/h5peditor.class.php
+++ b/h5p/h5p-editor-php-library/h5peditor.class.php
@@ -174,8 +174,7 @@

       // Remove old files.
       for ($i = 0, $s = count($oldFiles); $i < $s; $i++) {
-        if (!in_array($oldFiles[$i], $newFiles) &&
-            preg_match('/^(w+://|../)/i', $oldFiles[$i]) === 0) {
+        if (!in_array($oldFiles[$i], $newFiles) && !str_contains($oldFiles[$i], './') && !str_contains($oldFiles[$i], '//')) {
           $this->h5p->fs->removeContentFile($oldFiles[$i], $content);
           // (optionally we could just have marked them as tmp files)
         }
--- a/h5p/h5p-php-library/h5p-default-storage.class.php
+++ b/h5p/h5p-php-library/h5p-default-storage.class.php
@@ -334,6 +334,10 @@
    * @param int $toid Target Content ID
    */
   public function cloneContentFile($file, $fromId, $toId) {
+    if (str_contains($file, './')) {
+      return; // Skip file
+    }
+
     // Determine source path
     if ($fromId === 'editor') {
       $sourcepath = $this->getEditorPath();
--- a/h5p/h5p.php
+++ b/h5p/h5p.php
@@ -15,7 +15,7 @@
  * Plugin Name:       H5P
  * Plugin URI:        http://h5p.org/wordpress
  * Description:       Allows you to upload, create, share and use rich interactive content on your WordPress site.
- * Version:           1.17.7
+ * Version:           1.17.8
  * Author:            Joubel
  * Author URI:        http://joubel.com
  * Text Domain:       h5p
--- a/h5p/public/class-h5p-plugin.php
+++ b/h5p/public/class-h5p-plugin.php
@@ -24,7 +24,7 @@
    * @since 1.0.0
    * @var string
    */
-  const VERSION = '1.17.7';
+  const VERSION = '1.17.8';

   /**
    * The Unique identifier for this plugin.

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.