Changeset 2944510
- Timestamp:
- 07/28/2023 08:06:30 AM (3 years ago)
- Location:
- wp-cors/trunk
- Files:
-
- 1 deleted
- 2 edited
-
includes (deleted)
-
readme.txt (modified) (3 diffs)
-
wp-cors.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-cors/trunk/readme.txt
r1225425 r2944510 4 4 Requires at least: 3.6 5 5 Tested up to: 4.3 6 Stable tag: 0.2. 16 Stable tag: 0.2.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 == Description == 13 13 14 AJAX requests to this site from another (those containing an Origin header) will be allowed for any domains listed in the plugin's Settings page. 14 My use case is to allow content authors to write help pages in WordPress. 15 This content is fetched and embedded into a single page application hosted on another domain. 16 17 AJAX requests to this site from another are typically disallowed by the browser's security model. 18 To permit legitimate uses the requesting browser may include an Origin header containing its domain. 19 This plugin uses the Origin header to decide whether to allow the request or not. 20 Allowed domains can be specified in the plugin's Settings page. 15 21 16 22 == Installation == … … 45 51 == Changelog == 46 52 53 = 0.2.2 = 54 Tested up to WordPress 4.3 55 Prevent cross-site script injection on Settings page (CVE-2022-47606). 56 Note this vulnerability may only be exploited if the user is already logged in with Admin privilege. 57 47 58 = 0.2.1 = 48 59 Tested up to WordPress 4.3 -
wp-cors/trunk/wp-cors.php
r1225425 r2944510 6 6 * AJAX calls to integrate your content using the CORS standard. 7 7 * Author: Tim Stephenson 8 * Version: 0.2. 18 * Version: 0.2.2 9 9 * Author URI: http://knowprocess.com 10 10 * License: GPLv2 or later … … 12 12 13 13 define("CORS_ID", 'wp-cors'); 14 define("CORS_VERSION", "0.2. 1");14 define("CORS_VERSION", "0.2.2"); 15 15 define("CORS_NAME", 'CORS'); 16 define("CORS_DEBUG", false);16 define("CORS_DEBUG", true); 17 17 //require_once("includes/shortcodes.php"); 18 18 … … 64 64 <tr valign="top"> 65 65 <th scope="row">Allowed domains</th> 66 <td><input type="text" name="cors_domains" value="<?php echo get_option('cors_domains'); ?>" /></td> 66 <td><input type="text" name="cors_domains" 67 value="<?php echo esc_attr(get_option('cors_domains')); ?>" /></td> 67 68 </tr> 68 69 </table> … … 86 87 87 88 function cors_change_domains() { 88 if (!empty($_POST['cors_domains'])) { 89 //error_log('Request to change subscription WITH expected params: cors_domains: '.$_POST['cors_domains']); 89 $cors_domains = sanitize_url($_POST['cors_domains']); 90 if (!empty($cors_domains)) { 91 if (CORS_DEBUG) error_log('Request to change subscription WITH expected params: cors_domains: '.$cors_domains); 90 92 $user = wp_get_current_user(); 91 93 92 update_option( $user->ID, 'cors_domains', $ _POST['cors_domains']);94 update_option( $user->ID, 'cors_domains', $cors_domains); 93 95 die(); 94 96 } else {
Note: See TracChangeset
for help on using the changeset viewer.