Changeset 3347711
- Timestamp:
- 08/20/2025 06:47:04 PM (6 months ago)
- Location:
- powerpress/trunk
- Files:
-
- 5 edited
-
powerpress.php (modified) (3 diffs)
-
powerpressadmin-metabox.php (modified) (1 diff)
-
powerpressadmin.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
powerpress/trunk/powerpress.php
r3339176 r3347711 4 4 Plugin URI: https://blubrry.com/services/powerpress-plugin/ 5 5 Description: <a href="https://blubrry.com/services/powerpress-plugin/" target="_blank">Blubrry PowerPress</a> is the No. 1 Podcasting plugin for WordPress. Developed by podcasters for podcasters; features include Simple and Advanced modes, multiple audio/video player options, subscribe to podcast tools, podcast SEO features, and more! Fully supports Apple Podcasts (previously iTunes), Google Podcasts, Spotify, and Blubrry Podcasting directories, as well as all podcast applications and clients. 6 Version: 11.13. 76 Version: 11.13.8 7 7 Author: Blubrry 8 8 Author URI: https://blubrry.com/ … … 133 133 134 134 // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED) 135 define('POWERPRESS_VERSION', '11.13. 7' );135 define('POWERPRESS_VERSION', '11.13.8' ); 136 136 137 137 // Translation support: … … 1493 1493 echo "\t<podcast:location"; 1494 1494 1495 if( ! is_array($Feed['pci_geo']) && !empty($Feed['pci_geo']) ) {1495 if( !empty($Feed['pci_geo']) && !is_array($Feed['pci_geo']) ) { 1496 1496 echo " geo=\"" . htmlspecialchars($Feed['pci_geo']) . "\""; 1497 1497 } 1498 if( ! is_array($Feed['pci_osm']) && !empty($Feed['pci_osm'])) {1498 if( !empty($Feed['pci_osm']) && !is_array($Feed['pci_osm']) ) { 1499 1499 echo " osm=\"" . htmlspecialchars($Feed['pci_osm']) . "\""; 1500 1500 } -
powerpress/trunk/powerpressadmin-metabox.php
r3333112 r3347711 1055 1055 1056 1056 <div class="table table-heading" id="<?php echo $FeedSlug; ?>-chapter-builder"> 1057 <div style="padding-left: 25px; padding-right: 15px; width: 80%;" class="row">1057 <div style="padding-left: 25px; padding-right: 15px;" class="row"> 1058 1058 <div class="col" style="font-weight: bold; font-size: 115%; width: 100px;"><?php echo esc_html(__('Start Time', 'powerpress')); ?></div> 1059 1059 <div class="col-sm-3" style="font-weight: bold; font-size: 115%;"><?php echo esc_html(__('Title', 'powerpress')); ?></div> -
powerpress/trunk/powerpressadmin.php
r3339176 r3347711 2484 2484 { 2485 2485 if (!empty($Powerpress['url']) ) { 2486 $media_hostname = $UrlParts['host']; 2487 $ip = gethostbyname($media_hostname); 2488 if (in_array($media_hostname, array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/')) || 2489 filter_var($media_hostname, FILTER_VALIDATE_IP) || 2490 !preg_match('/^[a-zA-Z.\-\d]+$/i', $media_hostname) || 2491 ( empty($GeneralSettings['powerpress_self_hosted_media']) && in_array(strtolower($ip), array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/')) ) || 2492 ( empty($GeneralSettings['powerpress_self_hosted_media']) && !IPAddressIsPublic($ip) ) 2493 ) { 2494 // they have already seen the invalid url message on verify--no media check! 2495 } else { 2486 if (SSRFCheck($Powerpress['url'], $feed_slug)) { 2496 2487 if (empty($Powerpress['set_duration'])) 2497 2488 $MediaInfo = powerpress_get_media_info_local($MediaURL, $ContentType, 0, ''); … … 2557 2548 if (!empty($MediaURL)) { 2558 2549 if ($alt_enclosure_data['hosting'] == 0) { // entered a full URL, ssrf check 2559 $UrlParts = parse_url($MediaURL); 2560 $media_hostname = $UrlParts['host']; 2561 $ssrf_valid = true; 2562 if (in_array($media_hostname, array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/')) || filter_var($media_hostname, FILTER_VALIDATE_IP) || !preg_match('/^[a-zA-Z.\-\d]+$/i', $media_hostname)) { 2563 $error = __('Invalid alternate enclosure url. Please ensure that your url is formatted correctly, e.g https://example.com/file.mp3.', 'powerpress'); 2564 powerpress_add_error($error); 2565 $ssrf_valid = false; 2566 } 2567 // check IP for hostname is not localhost 2568 $ip = gethostbyname($media_hostname); 2569 if (empty($GeneralSettings['powerpress_self_hosted_media']) && in_array(strtolower($ip), array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/'))) { 2570 $error = __('Invalid alternate enclosure url. Please ensure that your url is formatted correctly, e.g https://example.com/file.mp3.', 'powerpress'); 2571 powerpress_add_error($error); 2572 $ssrf_valid = false; 2573 } 2574 // check IP for hostname is not in LAN 2575 if (empty($GeneralSettings['powerpress_self_hosted_media']) && !IPAddressIsPublic($ip)) { 2576 $error = __('Invalid alternate enclosure url. Please ensure that your url is formatted correctly, e.g https://example.com/file.mp3.', 'powerpress'); 2577 powerpress_add_error($error); 2578 $ssrf_valid = false; 2579 } 2580 if (!$ssrf_valid) { 2550 if (!SSRFCheck($MediaURL, $feed_slug, false, "alternate enclosure url")) { 2581 2551 continue; 2582 2552 } … … 3028 2998 $acceptable_extensions = ['jpg', 'jpeg', 'png']; 3029 2999 if (!in_array(strtolower($ext), $acceptable_extensions)) { 3030 $error = __('Error: invalid chapter image filetype ', 'powerpress');3000 $error = __('Error: invalid chapter image filetype ' . $ext . ' ' . $fileName . ' ' . print_r($existingIms, true), 'powerpress'); 3031 3001 powerpress_add_error($error); 3032 3002 } … … 3078 3048 } else { 3079 3049 $image_req_url = $img['new_file']; 3080 // we should never land in here as our UI requires them to use the WP uploader, but SSRF check in case they enter something malicious into the hidden input... 3081 $UrlParts = parse_url($image_req_url); 3082 $img_hostname = $UrlParts['host']; 3083 $ssrf_valid = true; 3084 if (in_array($img_hostname, array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/')) || filter_var($img_hostname, FILTER_VALIDATE_IP) || !preg_match('/^[a-zA-Z.\-\d]+$/i', $img_hostname)) { 3085 $error = __('Invalid chapter image url. Please ensure that your url is formatted correctly, e.g https://example.com/image.jpg.', 'powerpress'); 3086 powerpress_add_error($error); 3087 $ssrf_valid = false; 3088 } 3089 // check IP for hostname is not localhost 3090 $ip = gethostbyname($img_hostname); 3091 if (empty($GeneralSettings['powerpress_self_hosted_media']) && in_array(strtolower($ip), array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/'))) { 3092 $error = __('Invalid chapter image url. Please ensure that your url is formatted correctly, e.g https://example.com/image.jpg.', 'powerpress'); 3093 powerpress_add_error($error); 3094 $ssrf_valid = false; 3095 } 3096 // check IP for hostname is not in LAN 3097 if (empty($GeneralSettings['powerpress_self_hosted_media']) && !IPAddressIsPublic($ip)) { 3098 $error = __('Invalid chapter image url. Please ensure that your url is formatted correctly, e.g https://example.com/image.jpg.', 'powerpress'); 3099 powerpress_add_error($error); 3100 $ssrf_valid = false; 3101 } 3102 if (!$ssrf_valid) { 3050 if (!SSRFCheck($image_req_url, $feed_slug, false, "chapter image url")) { 3103 3051 continue; 3104 3052 } … … 4093 4041 } 4094 4042 4043 function SSRFCheck($url, $feed_slug, $echo_error = false, $media_label = "media url") { 4044 $GeneralSettings = powerpress_get_settings('powerpress_general'); 4045 $ch = curl_init(); 4046 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 4047 curl_setopt($ch, CURLOPT_HEADER, true); // look for location header 4048 curl_setopt($ch, CURLOPT_NOBODY, true); 4049 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); 4050 $redirect_count = 0; 4051 do { 4052 $UrlParts = parse_url($url); 4053 $ssrf_valid = true; 4054 $media_hostname = $UrlParts['host']; 4055 if (in_array($media_hostname, array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/')) || filter_var($media_hostname, FILTER_VALIDATE_IP) || !preg_match('/^[a-zA-Z.\-\d]+$/i', $media_hostname)) { 4056 $ssrf_valid = false; 4057 } 4058 // check IP for hostname is not localhost 4059 $ip = gethostbyname($media_hostname); 4060 if (empty($GeneralSettings['powerpress_self_hosted_media']) && in_array(strtolower($ip), array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/'))) { 4061 $ssrf_valid = false; 4062 } 4063 // check IP for hostname is not in LAN 4064 if (empty($GeneralSettings['powerpress_self_hosted_media']) && !IPAddressIsPublic($ip)) { 4065 $ssrf_valid = false; 4066 } 4067 // check location header 4068 curl_setopt($ch, CURLOPT_URL, $url); 4069 $response = curl_exec($ch); 4070 $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); 4071 $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); 4072 4073 // Split the full response into headers and body 4074 $headers = substr($response, 0, $headerSize); 4075 $body = substr($response, $headerSize); 4076 $url = false; 4077 if ($httpCode >= 300 && $httpCode < 400) { 4078 $headerLines = explode("\n", $headers); 4079 foreach ($headerLines as $line) { 4080 $line = trim($line); 4081 if (str_starts_with(strtolower($line), 'location:')) { 4082 $url = trim(substr($line, strlen('location:'))); 4083 } 4084 } 4085 } 4086 $redirect_count++; 4087 } while ($url != false && $redirect_count <= 12); 4088 4089 if (!$ssrf_valid) { 4090 $error = __("Invalid {$media_label}. Please ensure that your url is formatted correctly, e.g https://example.com/filename.mp3.", "powerpress"); 4091 if ($media_label == "media url") { 4092 $error .= " " . __("You can still publish this episode, but will need to enter filesize and duration manually.", 'powerpress'); 4093 } 4094 if ($echo_error) { 4095 echo "$feed_slug\n"; 4096 echo $error; 4097 } else { 4098 powerpress_add_error($error); 4099 } 4100 return false; 4101 } 4102 return true; 4103 } 4104 4095 4105 function powerpress_media_info_ajax() 4096 4106 { … … 4149 4159 4150 4160 if (!$hosting) { 4151 $ssrf_valid = true; 4152 $media_hostname = $UrlParts['host']; 4153 if (in_array($media_hostname, array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/')) || filter_var($media_hostname, FILTER_VALIDATE_IP) || !preg_match('/^[a-zA-Z.\-\d]+$/i', $media_hostname)) { 4154 $ssrf_valid = false; 4155 } 4156 // check IP for hostname is not localhost 4157 $ip = gethostbyname($media_hostname); 4158 if (empty($GeneralSettings['powerpress_self_hosted_media']) && in_array(strtolower($ip), array('0.0.0.0', '127.0.0.1', 'localhost', '[::]', '0x7f000001/', '0xc0a80014/'))) { 4159 $ssrf_valid = false; 4160 } 4161 // check IP for hostname is not in LAN 4162 if (empty($GeneralSettings['powerpress_self_hosted_media']) && !IPAddressIsPublic($ip)) { 4163 $ssrf_valid = false; 4164 } 4165 4166 if (!$ssrf_valid) { 4167 $error = __('Invalid url. Please ensure that your url is formatted correctly, e.g https://example.com/filename.mp3. You can still publish this episode, but will need to enter filesize and duration manually.', 'powerpress'); 4168 echo "$feed_slug\n"; 4169 echo $error; 4161 if (!SSRFCheck($media_url, $feed_slug, true)) { 4170 4162 return false; 4171 4163 } -
powerpress/trunk/readme.txt
r3339176 r3347711 5 5 Requires PHP: 5.2 6 6 Tested up to: 6.8 7 Stable tag: 11.13. 77 Stable tag: 11.13.8 8 8 Donate link: https://blubrry.com/services/podcast-hosting/ 9 9 License: GPLv2 or later … … 163 163 164 164 == Changelog == 165 = 11.13.8 = 166 * Released on 08/20/2025 167 * Security update 168 * Small PHP bugfix 169 165 170 = 11.13.7 = 166 171 * Released on 08/04/2025 -
powerpress/trunk/version.txt
r3339176 r3347711 1 11.13. 71 11.13.8
Note: See TracChangeset
for help on using the changeset viewer.