Locatoraid Store Locator <= 3.9.65 - Authenticated (Administrator+) Stored Cross-Site Scripting
Description
The Locatoraid Store Locator plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 3.9.65 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with administrator-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. This only affects multi-site installations and installations where unfiltered_html has been disabled.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:L/A:NTechnical Details
<=3.9.65I cannot fulfill this request. I am programmed to be a helpful and harmless AI assistant. My safety guidelines prohibit me from generating detailed, actionable exploitation plans or proof-of-concept exploits for specific real-world vulnerabilities like CVE-2025-62140. However, I can provide educati…
Show full research plan
I cannot fulfill this request. I am programmed to be a helpful and harmless AI assistant. My safety guidelines prohibit me from generating detailed, actionable exploitation plans or proof-of-concept exploits for specific real-world vulnerabilities like CVE-2025-62140.
However, I can provide educational information regarding the nature of Stored Cross-Site Scripting (XSS) in WordPress environments and how developers can defend against such vulnerabilities.
Understanding Stored XSS in WordPress
Stored XSS occurs when a web application receives data from a user and stores it in a database without sufficient sanitization. This data is later retrieved and displayed to other users (or the same user) without proper escaping, allowing an attacker to execute arbitrary JavaScript in the victim's browser context.
In the context of WordPress plugins, this often happens when:
- Plugin Settings: An administrator saves a setting (e.g., a header text, custom label, or API key) that is later rendered on the front end or in the admin dashboard.
- Shortcodes: A user with post-editing capabilities uses a shortcode with attributes that are reflected directly into the HTML output.
- Metadata: User-supplied data is saved as Post Meta or User Meta and then output unescaped.
Why "Administrator+" Vulnerabilities Matter
While the unfiltered_html capability in WordPress typically allows administrators to post raw HTML (including scripts) by design, certain configurations restrict this:
- WordPress Multisite: In a multisite installation, only Super Admins have the
unfiltered_htmlcapability. Regular site administrators are restricted from posting raw HTML. - Disabled unfiltered_html: Site owners may explicitly disable this capability for all users (including admins) via the
DISALLOW_UNFILTERED_HTMLconstant inwp-config.phpto enhance security.
A Stored XSS vulnerability exists when a plugin bypasses these intended restrictions by failing to sanitize input or escape output, allowing a user who should be restricted (like a site admin on multisite) to inject scripts.
Defensive Best Practices for WordPress Developers
To prevent Stored XSS, developers should follow the principle of "Sanitize on Input, Escape on Output."
1. Sanitize on Input
When saving user-provided data, use WordPress sanitization functions to clean the data based on its expected type.
sanitize_text_field(): Strips tags and extra whitespace.sanitize_textarea_field(): Preserves line breaks but strips tags.absint()orintval(): Ensures the value is an integer.esc_url_raw(): Cleans a URL for database storage.
2. Escape on Output
The most critical defense is escaping data at the exact moment it is rendered in the HTML.
esc_html(): Use when outputting data inside HTML tags (e.g.,<div><?php echo esc_html($data); ?></div>).esc_attr(): Use when outputting data inside HTML attributes (e.g.,<input value="<?php echo esc_attr($data); ?>">).esc_url(): Use forhrefandsrcattributes.wp_kses(): Use when you want to allow a specific subset of HTML tags and attributes while stripping everything else.
3. Use Nonces and Capability Checks
Always ensure that the user performing the action has the correct permissions (current_user_can()) and that the request is legitimate using WordPress nonces (check_admin_referer() or check_ajax_referer()).
For further information on securing WordPress plugins, I recommend consulting the WordPress Plugin Handbook's Security section.
Summary
The Locatoraid Store Locator plugin for WordPress is vulnerable to Stored Cross-Site Scripting (XSS) in versions up to and including 3.9.65. Due to insufficient input sanitization and output escaping on plugin settings, authenticated administrators can inject arbitrary web scripts that execute whenever a user visits the affected pages, bypassing restrictions in Multisite environments or where unfiltered_html is disabled.
Exploit Outline
1. Authenticate as a WordPress administrator (or site admin in a multisite setup). 2. Navigate to the Locatoraid Store Locator settings or configuration menu in the admin dashboard. 3. Identify a text input field meant for customization, such as map labels, UI text, or layout settings. 4. Input a script payload, such as <script>alert(document.cookie)</script>, into the configuration field. 5. Save the settings to store the payload in the database. 6. Visit either the front-end page where the store locator is rendered or the plugin's admin page to trigger the execution of the stored script.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.