Security issue
-
When user’s logged in and tries to view a license that doesn’t exist, an error is generated that is not handled by the plugin. For example is there’s no license with ID 123 and the user calls:
https://example.com/my-account/view-license-keys/123/The plugin doesn’t handle the error properly and depending on the theme error handling logic, sensitive information about server directory structure, database, and tokens can be revealed.
The issue is cause by /wp-content/plugins/license-manager-for-woocommerce/includes/Integrations/WooCommerce/MyAccount.php at line 238 in viewLicenseKeys() and can be solved by a simple if statement like:if($license != null) { $decrypted = $license->getDecryptedLicenseKey(); if ( is_wp_error( $decrypted ) ) { echo sprintf( '<p>%s</p>', $decrypted->get_error_message() ); return; } echo wc_get_template_html( 'myaccount/single.php', array( 'license' => $license, 'license_key' => $license->getDecryptedLicenseKey(), 'product' => ! empty( $license->getProductId() ) ? wc_get_product( $license->getProductId() ) : null, 'order' => ! empty( $license->getOrderId() ) ? wc_get_order( $license->getOrderId() ) : null, 'date_format' => get_option( 'date_format' ), ), '', LMFWC_TEMPLATES_DIR ); } else { echo 'Invalid license key'; }
Please proceed as it can be misused and put websites in danger easily.
The page I need help with: [log in to see the link]
- The topic ‘Security issue’ is closed to new replies.