FormLayer <= 1.0.6 - Unauthenticated Information Exposure
Description
The FormLayer plugin for WordPress is vulnerable to Sensitive Information Exposure in all versions up to, and including, 1.0.6. This makes it possible for unauthenticated attackers to extract sensitive user or configuration data.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:NTechnical Details
What Changed in the Fix
Changes introduced in v1.0.7
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-59519 (FormLayer Information Exposure) ## 1. Vulnerability Summary The FormLayer plugin for WordPress (versions <= 1.0.6) is vulnerable to **Sensitive Information Exposure** due to an insecure implementation of the `wp_localize_script` function in the frontend…
Show full research plan
Exploitation Research Plan: CVE-2026-59519 (FormLayer Information Exposure)
1. Vulnerability Summary
The FormLayer plugin for WordPress (versions <= 1.0.6) is vulnerable to Sensitive Information Exposure due to an insecure implementation of the wp_localize_script function in the frontend. The plugin passes the entire contents of the formlayer_settings WordPress option to the frontend as part of the formlayer_data JavaScript object. This option contains global plugin configurations, including sensitive credentials such as hCaptcha secret keys and potentially other third-party integration keys (Mailchimp, Slack, etc., in Pro versions).
Since the script and its localized data are enqueued on any page containing a FormLayer shortcode, an unauthenticated attacker can extract these secrets by simply visiting such a page and inspecting the global JavaScript variables.
2. Attack Vector Analysis
- Vulnerable Endpoint: Any public-facing page or post containing the
[formlayer]shortcode. - Vulnerable Mechanism:
wp_localize_scriptinmain/frontend.php. - Payload Location: The HTML source code of the rendered page, specifically within a
<script>tag defining theformlayer_dataobject. - Authentication: Unauthenticated (No login required).
- Preconditions:
- The plugin must be active.
- At least one page must contain the
[formlayer]shortcode to trigger asset enqueuing. - Sensitive data (like hCaptcha keys) must be saved in the plugin settings.
3. Code Flow
- Initialization: In
formlayer.php,formlayer_load_plugin()is hooked toplugins_loaded. - Hook Registration:
formlayer_load_plugin()hooks\FormLayer\Frontend::initto theinithook. - Frontend Init:
\FormLayer\Frontend::init(inmain/frontend.php) hooks\FormLayer\Frontend::enqueue_assetstowp_enqueue_scripts. - Information Leakage: The
enqueue_assets()function executes the following:wp_localize_script('formlayer-frontend', 'formlayer_data', [ 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('formlayer-frontend'), 'messages' => get_option('formlayer_settings', []), // <--- VULNERABLE: Entire settings array leaked 'is_pro' => defined('FORMLAYER_PRO_VERSION') ? true : false, ]); - Data Persistence: As seen in
main/ajax.php, thesave_settings()method saves sensitive keys likecaptcha_h_secret_keyinto theformlayer_settingsoption array. - Exposure: WordPress renders this data in the HTML:
var formlayer_data = {"ajax_url":"...","nonce":"...","messages":{"captcha_h_secret_key":"SECRET_VALUE",...},...};
4. Nonce Acquisition Strategy
This vulnerability is an information exposure that does not require a nonce to trigger. However, the exposed formlayer_data object contains a valid nonce for the formlayer-frontend action, which can be used to interact with the formlayer_submit_form AJAX endpoint.
To extract the leaked data and the nonce via the security agent:
- Create a page with the shortcode
[formlayer id="1"](or any valid form ID). - Navigate to the page using
browser_navigate. - Execute JavaScript to retrieve the localized object:
browser_eval("window.formlayer_data") - The sensitive keys will be located in the
.messagesproperty of the returned object.
5. Exploitation Strategy
Step-by-Step Plan:
- Configuration: Update the
formlayer_settingsoption with a "canary" secret key to simulate a configured environment. - Target Creation: Create a
formlayer_formpost and a public page containing the corresponding shortcode. - Extraction: Navigate to the public page as an unauthenticated user.
- Payload: Execute
browser_eval("window.formlayer_data.messages"). - Verification: Parse the JSON output and confirm the presence of the "canary" secret key.
6. Test Data Setup
Run these WP-CLI commands to prepare the environment:
# 1. Set a sensitive canary value in settings
wp option update formlayer_settings '{"captcha_h_secret_key":"CVE-2026-59519-CANARY-SECRET", "captcha_h_site_key":"site-key-123"}' --format=json
# 2. Create a dummy form (needed for the shortcode to render)
FORM_ID=$(wp post create --post_type=formlayer_form --post_title="Leak Test Form" --post_status=publish --post_content='{"fields":[{"type":"text","label":"Name"}]}' --porcelain)
# 3. Create a public page with the shortcode
wp post create --post_type=page --post_title="Contact Us" --post_status=publish --post_content="[formlayer id=\"$FORM_ID\"]"
7. Expected Results
- The
browser_evalcall towindow.formlayer_datashould return an object. - The
messagesproperty of that object should contain a key-value pair:"captcha_h_secret_key": "CVE-2026-59519-CANARY-SECRET". - The
nonceproperty should contain a 10-character WordPress nonce.
8. Verification Steps
After the exploit attempt, verify the results against the database state:
# Check the value in the database to ensure the leaked data matches
wp option get formlayer_settings --format=json
If the output of browser_eval matches the output of wp option get, the information exposure is confirmed.
9. Alternative Approaches
If the [formlayer] shortcode does not render or enqueue scripts due to missing form data, try targeting the render_shortcode logic in main/frontend.php.
- Fallback Rendering: If the form content is not valid JSON, the plugin falls back to
render_form_fallback. - Direct Script Check: Even if the form HTML is broken, if
wp_enqueue_script('formlayer-frontend', ...)is called, theformlayer_dataobject will be present in the page head or footer. Check the page source for the stringformlayer_dataeven ifbrowser_evalfails initially.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.