Plugin Directory

Changeset 2935713


Ignore:
Timestamp:
07/07/2023 06:56:37 PM (3 years ago)
Author:
zinoui
Message:

Vulnerability fixes

Location:
http-headers/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • http-headers/trunk/README.txt

    r2924462 r2935713  
    66Tested up to: 6.2.2
    77Requires PHP: 5.3
    8 Stable tag: 1.18.11
     8Stable tag: 1.19.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    8787== Changelog ==
    8888
     89= 1.19.0 =
     90*Release Date - 7th July, 2023*
     91
     92* Fixed: SSRF vulnerability by an Admin user
     93* Fixed: XSS vulnerability by an Admin user
     94
    8995= 1.18.11 =
    90 *Release Date - 11th Jun, 2023*
     96*Release Date - 11th June, 2023*
    9197
    9298* Fixed: Remote Code Execution by an Admin user
  • http-headers/trunk/http-headers.php

    r2924462 r2935713  
    44Plugin URI: https://github.com/riverside/http-headers
    55Description: A plugin for HTTP headers management including security, access-control (CORS), caching, compression, and authentication.
    6 Version: 1.18.11
     6Version: 1.19.0
    77Author: Dimitar Ivanov
    88Author URI: https://github.com/riverside
     
    3939}
    4040
    41 function build_csp_value($value) {
     41function build_csp_value($value, $escape=false) {
    4242    if (!is_array($value))
    4343    {
     
    6262                    $val .= " " . $source;
    6363                }
    64                 $csp[] = sprintf("%s %s", $key, $val);
     64                $csp[] = sprintf("%s %s", $key, $escape ? esc_html($val) : $val);
    6565            } elseif ($source) {
    66                 $csp[] = sprintf("%s %s", $key, $source);
     66                $csp[] = sprintf("%s %s", $key, $escape ? esc_html($source) : $source);
    6767            }
    6868        } else {
     
    7373            if (in_array($key, array('plugin-types', 'report-to')) && !empty($val))
    7474            {
    75                 $csp[] = sprintf("%s %s", $key, $val);
     75                $csp[] = sprintf("%s %s", $key, $escape ? esc_html($val) : $val);
    7676            }
    7777        }
  • http-headers/trunk/views/age.php

    r2233507 r2935713  
    2727        <?php settings_fields( 'http-headers-age' ); ?>
    2828        <?php do_settings_sections( 'http-headers-age' ); ?>
    29         <input type="text" name="hh_age_value" class="http-header-value" size="5" value="<?php echo esc_attr(get_option('hh_age_value')); ?>"<?php echo $age == 1 ? NULL : ' checked'; ?>>
     29        <input type="text" name="hh_age_value" class="http-header-value" size="5" value="<?php echo (int) esc_attr(get_option('hh_age_value')); ?>"<?php echo $age == 1 ? NULL : ' checked'; ?>>
    3030        <?php _e('seconds', 'http-headers'); ?>
    3131    </td>
  • http-headers/trunk/views/ajax-inspect.php

    r2852524 r2935713  
    2424}
    2525
    26 $response = wp_remote_head($_POST['url'], $args);
     26$response = wp_safe_remote_head($_POST['url'], $args);
    2727$status = wp_remote_retrieve_response_code($response);
    2828$dictionary = wp_remote_retrieve_headers($response);
  • http-headers/trunk/views/category.php

    r2852524 r2935713  
    3232        {
    3333            $value = get_option($key .'_value');
     34            if (is_string($value))
     35            {
     36                $value = esc_html($value);
     37            }
    3438            switch ($key)
    3539            {
     
    4549                case 'hh_x_xxs_protection':
    4650                    if ($value == '1; report=') {
    47                         $value .= get_option('hh_x_xxs_protection_uri');
     51                        $value .= esc_html(get_option('hh_x_xxs_protection_uri'));
    4852                    }
    4953                    break;
     
    5761                    if ($value == 'ALLOW-FROM')
    5862                    {
    59                         $value .= ' ' . get_option('hh_x_frame_options_domain');
     63                        $value .= ' ' . esc_html(get_option('hh_x_frame_options_domain'));
    6064                    }
    6165                    break;
     
    8589                    if ($value == 'origin')
    8690                    {
    87                         $value = get_option('hh_timing_allow_origin_url');
     91                        $value = esc_html(get_option('hh_timing_allow_origin_url'));
    8892                    }
    8993                    break;
     
    9195                    if ($value == 'origin')
    9296                    {
    93                         $value = join('<br>', get_option('hh_access_control_allow_origin_url', array()));
     97                        $value = join('<br>', array_map('esc_html', get_option('hh_access_control_allow_origin_url', array())));
    9498                    }
    9599                    break;
     
    100104                    break;
    101105                case 'hh_content_security_policy':
    102                     $value = build_csp_value($value);
     106                    $value = build_csp_value($value, true);
    103107                    if (get_option('hh_content_security_policy_report_only')) {
    104108                        $item[0] .= '-Report-Only';
     
    133137                    break;
    134138                case 'hh_www_authenticate':
    135                     $value = get_option('hh_www_authenticate_type');
     139                    $value = esc_html(get_option('hh_www_authenticate_type'));
    136140                    break;
    137141                case 'hh_cache_control':
     
    181185                        $tmp[] = 'enforce';
    182186                    }
    183                     $tmp[] = sprintf('report-uri="%s"', get_option('hh_expect_ct_report_uri'));
     187                    $tmp[] = sprintf('report-uri="%s"', esc_html(get_option('hh_expect_ct_report_uri')));
    184188                    $value = join(', ', $tmp);
    185189                    break;
     
    192196                        {
    193197                            $_names[] = '<p class="hh-p">&nbsp;&nbsp;&nbsp;&nbsp;'.$name.'</p>';
    194                             $_values[] = '<p class="hh-p">'.$value['value'][$key].'</p>';
     198                            $_values[] = '<p class="hh-p">'.esc_html($value['value'][$key]).'</p>';
    195199                        }
    196200                    }
     
    199203                    break;
    200204                case 'hh_report_to':
    201                     $value = get_http_header('report_to');
     205                    $value = esc_html(get_http_header('report_to'));
    202206                    break;
    203207                case 'hh_nel':
    204                     $value = get_http_header('nel');
     208                    $value = esc_html(get_http_header('nel'));
    205209                    break;
    206210                case 'hh_feature_policy':
    207                     $value = get_http_header('feature_policy');
     211                    $value = esc_html(get_http_header('feature_policy'));
    208212                    break;
    209213                case 'hh_permissions_policy':
    210                     $value = get_http_header('permissions_policy');
     214                    $value = esc_html(get_http_header('permissions_policy'));
    211215                    break;
    212216                case 'hh_x_robots_tag':
    213                     $value = get_http_header('x_robots_tag');
     217                    $value = esc_html(get_http_header('x_robots_tag'));
    214218                    break;
    215219                case 'hh_clear_site_data':
Note: See TracChangeset for help on using the changeset viewer.