Synopsis
A Reflected Cross-Site Scripting vulnerability exists in the Wordpress plugin 'Loops & Logic'
The ‘name’ parameter of the ‘tangible_fields_fetch’ and ‘tangible_fields_store’ actions is used in the response without any filtering, resulting in a reflected XSS vulnerability.
curl http://WORDPRESS/wp-admin/admin-ajax.php?action=tangible_fields_fetch&name=%3cimg+src%3dx+onerror%3dalert%28document.domain%29%3e
All of the vulnerable code is located in 'vendor/tangible/fields/fields/store.php'.
Registration of Unauthenticated Handlers :
// Line 69-70
add_action( 'wp_ajax_tangible_fields_store', [ $fields, '_ajax_store_callback' ] );
add_action( 'wp_ajax_nopriv_tangible_fields_store', [ $fields, '_ajax_store_callback' ] );
// Line 100-101
add_action( 'wp_ajax_tangible_fields_fetch', [ $fields, '_ajax_fetch_callback' ] );
add_action( 'wp_ajax_nopriv_tangible_fields_fetch', [ $fields, '_ajax_fetch_callback' ] );The ‘wp_ajax_nopriv_*’ variant makes both actions accessible to visitors who are not logged in.
Unfiltered input :
// Line 73 (store) and Line 104 (fetch)
$name = $_GET['name'] ?? '';The ‘name’ parameter is read directly from the request, without validation or sanitization.
Injection point (sink) :
// Ligne 75-80 (store), identique en ligne 106-111 (fetch)
if ( ! $field = $fields->get_field( $name ) ) {
return $fields->__send_ajax( [
'success' => false,
'error' => sprintf( __( 'Unknown field %1$s' ), $name ), // <- $name injected here
] );
}
Any ‘name’ that does not correspond to a registered field, that is, any arbitrary value, ends up in this branch. The raw value is included in the error message.
Sending the response
// Ligne 132-143
$fields->__send_ajax = function ( $data, $return = null ) {
if ( is_null( $return ) ) {
$return = defined( 'DOING_TANGIBLE_TESTS' ) && DOING_TANGIBLE_TESTS;
}
if ( $return ) {
return $data;
}
echo json_encode( $data ); // <- No JSON header; response served as text/html
exit;
};Solution
No patch has been released as of this date.
Disclosure Timeline
All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.
Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.
For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.
If you have questions or corrections about this advisory, please email [email protected]
Tenable One
Request a demo
The world’s leading AI-powered exposure management platform.
Thank You
Thank you for your interest in Tenable One.
A representative will be in touch soon.
Form ID: 7469
Form Name: one-eval
Form Class: c-form form-panel__global-form c-form--mkto js-mkto-no-css js-form-hanging-label c-form--hide-comments
Form Wrapper ID: one-eval-form-wrapper
Confirmation Class: one-eval-confirmform-modal
Simulate Success