Changeset 3344512
- Timestamp:
- 08/14/2025 09:36:16 AM (6 months ago)
- Location:
- drag-and-drop-multiple-file-upload-contact-form-7
- Files:
-
- 33 added
- 3 edited
-
tags/1.3.9.1 (added)
-
tags/1.3.9.1/admin (added)
-
tags/1.3.9.1/admin/form-generator-v1.php (added)
-
tags/1.3.9.1/admin/form-generator-v2.php (added)
-
tags/1.3.9.1/assets (added)
-
tags/1.3.9.1/assets/css (added)
-
tags/1.3.9.1/assets/css/dnd-upload-cf7.css (added)
-
tags/1.3.9.1/assets/images (added)
-
tags/1.3.9.1/assets/js (added)
-
tags/1.3.9.1/assets/js/codedropz-uploader-jquery.js (added)
-
tags/1.3.9.1/assets/js/codedropz-uploader-min.js (added)
-
tags/1.3.9.1/assets/js/dev (added)
-
tags/1.3.9.1/assets/js/dev/jquery-dev.js (added)
-
tags/1.3.9.1/assets/js/dev/native-dev.js (added)
-
tags/1.3.9.1/drag-n-drop-upload-cf7.php (added)
-
tags/1.3.9.1/inc (added)
-
tags/1.3.9.1/inc/dnd-mime-types.php (added)
-
tags/1.3.9.1/inc/dnd-upload-cf7.php (added)
-
tags/1.3.9.1/languages (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-de_DE.mo (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-de_DE.po (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-fr_FR.mo (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-fr_FR.po (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-ko_KR.mo (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-ko_KR.po (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-nl_NL.mo (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-nl_NL.po (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-ru_RU.mo (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-ru_RU.po (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-zh_TW.mo (added)
-
tags/1.3.9.1/languages/drag-and-drop-multiple-file-upload-contact-form-7-zh_TW.po (added)
-
tags/1.3.9.1/readme.txt (added)
-
tags/1.3.9.1/uninstall.php (added)
-
trunk/drag-n-drop-upload-cf7.php (modified) (2 diffs)
-
trunk/inc/dnd-upload-cf7.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
drag-and-drop-multiple-file-upload-contact-form-7/trunk/drag-n-drop-upload-cf7.php
r3310153 r3344512 7 7 * Text Domain: drag-and-drop-multiple-file-upload-contact-form-7 8 8 * Domain Path: /languages 9 * Version: 1.3.9. 09 * Version: 1.3.9.1 10 10 * Author: Glen Don L. Mongaya 11 11 * Author URI: http://codedropz.com … … 22 22 23 23 /** Define plugin Version */ 24 define( 'dnd_upload_cf7_version', '1.3.9. 0' );24 define( 'dnd_upload_cf7_version', '1.3.9.1' ); 25 25 26 26 /** Define constant Plugin Directories */ -
drag-and-drop-multiple-file-upload-contact-form-7/trunk/inc/dnd-upload-cf7.php
r3310153 r3344512 255 255 // Add random folder. 256 256 if ( true === $dir ) { 257 $random_folder = dnd_cf7_get_unique_id(); 258 if ( $random_folder ) { 259 $uploads_dir = $uploads_dir .'/'. $random_folder; 257 $unique_id = dnd_cf7_get_unique_id(); 258 if ( $unique_id ) { 259 $random_folder = preg_replace( '/[^a-zA-Z0-9_-]/', '', $unique_id ); 260 $uploads_dir = $uploads_dir .'/'. sanitize_file_name( $random_folder ); // Sanitize File Name Aug 2025 260 261 } 261 262 } … … 1049 1050 // Validate path if it's match on the current folder 1050 1051 $unique_id = dnd_cf7_get_unique_id(); 1051 $current_folder = dirname( $path ); 1052 $current_path = $dir['upload_dir'] .'/'. $unique_id .'/'. wp_basename( $path ); 1052 $current_folder = trim( dirname( $path ) ); 1053 $file_name = wp_basename( $path ); // added Aug 2025 1054 $current_path = $dir['upload_dir'] .'/'. sanitize_file_name( $unique_id ) .'/'. $file_name; 1053 1055 1054 1056 // Show an error 1055 1057 if ( 'yes' !== dnd_cf7_settings('drag_n_drop_mail_attachment') ) { 1056 if ( ( $unique_id && $unique_id !== trim( $current_folder ) ) || ! file_exists( $current_path ) ) {1058 if ( ( $unique_id && $unique_id !== $current_folder ) || ! file_exists( $current_path ) || preg_match( '#\.\.[/\\\\]#', $path ) ) { 1057 1059 wp_send_json_error( 'Error: Unauthorized Request!' ); 1058 1060 } … … 1060 1062 1061 1063 // Concatenate path and upload directory 1062 $file_path = realpath( trailingslashit( $dir['upload_dir'] ) . trim( $path ) ); 1064 $path = trailingslashit( $current_folder ) . sanitize_file_name( $file_name ); // fixed traversal attack. (Aug 2025) 1065 $file_path = realpath( trailingslashit( $dir['upload_dir'] ) . $path ); 1063 1066 1064 1067 // Check if is in the correct upload_dir 1065 if ( ! preg_match( "/". wpcf7_dnd_dir ."/i", $file_path ) ) {1068 if ( ! preg_match( '#(?:^|/)' . preg_quote( wpcf7_dnd_dir, '#' ) . '(/|$)#i', $file_path ) ) { 1066 1069 wp_send_json_error('It\'s not a valid upload directory'); 1067 1070 } … … 1384 1387 ?> 1385 1388 <script type="text/javascript"> 1389 function dnd_cf7_generateUUIDv4() { 1390 const bytes = new Uint8Array(16); 1391 crypto.getRandomValues(bytes); 1392 bytes[6] = (bytes[6] & 0x0f) | 0x40; // version 4 1393 bytes[8] = (bytes[8] & 0x3f) | 0x80; // variant 10 1394 const hex = Array.from(bytes, b => b.toString(16).padStart(2, "0")).join(""); 1395 return hex.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, "$1-$2-$3-$4-$5"); 1396 } 1397 1386 1398 document.addEventListener("DOMContentLoaded", function() { 1387 1399 if ( ! document.cookie.includes("wpcf7_guest_user_id")) { 1388 document.cookie = "wpcf7_guest_user_id=" + crypto.randomUUID() + "; path=/; max-age=" + (12 * 3600) + "; samesite=Lax";1400 document.cookie = "wpcf7_guest_user_id=" + dnd_cf7_generateUUIDv4() + "; path=/; max-age=" + (12 * 3600) + "; samesite=Lax"; 1389 1401 } 1390 1402 }); -
drag-and-drop-multiple-file-upload-contact-form-7/trunk/readme.txt
r3310153 r3344512 5 5 Requires at least: 3.0.1 6 6 Tested up to: 6.8 7 Stable tag: 1.3.9. 07 Stable tag: 1.3.9.1 8 8 Requires PHP: 5.2.4 9 9 License: GPLv2 or later … … 179 179 180 180 == Changelog == 181 = 1.3.9.1 = 182 - Fixed : Security issues related to cookie (Thanks to WordFence) 183 - Bug : Fixed or Replace crypto.randomUUID() error on non https. [Support Link](https://wordpress.org/support/topic/crypto-randomuuid-error/) 184 181 185 = 1.3.9.0 = 182 186 - Security: Fixed security issues reported by Wordfence "Remote Code Execution via PHAR File Upload if changing the filename something like poc.phar".
Note: See TracChangeset
for help on using the changeset viewer.