Plugin Directory

Changeset 1985236


Ignore:
Timestamp:
12/04/2018 02:43:46 PM (7 years ago)
Author:
griffinjt
Message:

Update to 1.5.2 to fix potential privilege escalation issue with the notifications post type.

Location:
optinmonster
Files:
62 added
4 edited

Legend:

Unmodified
Added
Removed
  • optinmonster/trunk/assets/css/settings.css

    r1492937 r1985236  
    534534.omapi-optin .omapi-links a {
    535535    font-size: 12px;
    536     color: #555d66;
    537 }
    538 
    539 .omapi-optin .omapi-links a:hover {
    540     color: #23282d;
    541536}
    542537
  • optinmonster/trunk/includes/class-am-notification.php

    r1936255 r1985236  
    1111     * @license    GPL-2.0+
    1212     * @copyright  Copyright (c) 2017, Retyp LLC
    13      * @version    1.0.6
     13     * @version    1.0.7
    1414     */
    1515    class AM_Notification {
     
    7676        public function custom_post_type() {
    7777            register_post_type( 'amn_' . $this->plugin, array(
    78                 'supports' => false,
     78                'can_export'      => false,
     79                'supports'        => false,
     80                'capability_type' => 'manage_options'
    7981            ) );
    8082        }
     
    8688         */
    8789        public function get_remote_notifications() {
    88             if ( ! current_user_can( apply_filters( 'am_notifications_display', 'manage_options' ) ) ) {
     90            if ( ! apply_filters( 'am_notifications_display', is_super_admin() ) ) {
    8991                return;
    9092            }
     
    181183         */
    182184        public function display_notifications() {
    183             if ( ! current_user_can( apply_filters( 'am_notifications_display', 'manage_options' ) ) ) {
     185            if ( ! apply_filters( 'am_notifications_display', is_super_admin() ) ) {
    184186                return;
    185187            }
     
    338340                    }
    339341                    break;
     342                case 'mi-lite' :
    340343                case 'mi' :
    341                     $option = get_option( 'monsterinsights_license' );
    342                     $key    = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
    343                     $level  = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
    344 
    345                     // Possibly check for a constant.
    346                     if ( empty( $key ) && defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {
    347                         $key = MONSTERINSIGHTS_LICENSE_KEY;
     344                    if ( version_compare( MONSTERINSIGHTS_VERSION, '6.9.0', '>=' ) ) {
     345                        if ( MonsterInsights()->license->get_site_license_type() ) {
     346                            $key  = MonsterInsights()->license->get_site_license_key();
     347                            $type = MonsterInsights()->license->get_site_license_type();
     348                        } else if ( MonsterInsights()->license->get_network_license_type() ) {
     349                            $key  = MonsterInsights()->license->get_network_license_key();
     350                            $type = MonsterInsights()->license->get_network_license_type();
     351                        }
     352                        // Check key fallbacks
     353                        if ( empty( $key ) ) {
     354                            $key = MonsterInsights()->license->get_license_key();
     355                        }
     356                    } else {
     357                        $option = get_option( 'monsterinsights_license' );
     358                        $key    = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
     359                        $level  = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
     360                        // Possibly check for a constant.
     361                        if ( empty( $key ) && defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {
     362                            $key = MONSTERINSIGHTS_LICENSE_KEY;
     363                        }
    348364                    }
    349365                    break;
     
    367383            if ( empty( $key ) && empty( $level ) ) {
    368384                $level = 'none';
     385            }
     386
     387            // Possibly set the level to 'unknown' if a key is entered, but no level can be determined (such as manually entered key)
     388            if ( ! empty( $key ) && empty( $level ) ) {
     389                $level = 'unknown';
    369390            }
    370391
     
    399420         */
    400421        public function dismiss_notification() {
    401             if ( ! current_user_can( apply_filters( 'am_notifications_display', 'manage_options' ) ) ) {
     422            if ( ! apply_filters( 'am_notifications_display', is_super_admin() ) ) {
    402423                die;
    403424            }
  • optinmonster/trunk/optin-monster-wp-api.php

    r1936255 r1985236  
    66 * Author:      OptinMonster Team
    77 * Author URI:  https://optinmonster.com
    8  * Version:     1.5.1
     8 * Version:     1.5.2
    99 * Text Domain: optin-monster-api
    1010 * Domain Path: languages
     
    6161     * @var string
    6262     */
    63     public $version = '1.5.1';
     63    public $version = '1.5.2';
    6464
    6565    /**
  • optinmonster/trunk/readme.txt

    r1981574 r1985236  
    55Tested up to: 5.0
    66Requires PHP: 5.3
    7 Stable tag: 1.5.1
     7Stable tag: 1.5.2
    88License: GNU General Public License v2.0 or later
    99
     
    176176== Changelog ==
    177177
     178= 1.5.2 =
     179* Fixed potential privilege escalation bug.
     180* Bumped for 5.0.
     181
    178182= 1.5.1 =
    179183* Fixed a possible security issue with admin notices.
Note: See TracChangeset for help on using the changeset viewer.