REPORT / 01

Analysis Report · Folder Analysis cache/happy-elementor-addons_3.20.3 → cache/happy-elementor-addons_3.20.4 — CVE-2025-14635

Shared security patch analysis results

mode patchdiff ai claude_cli haiku
02 · Lifecycle actions cancel · resume · skip · regenerate
03 · Share this analysis copy link · embed report
03 · CVE Security Analysis & Writeups ai-generated · per cve

Comprehensive security analysis generated by AI for each confirmed CVE match. Click on a CVE to view the detailed writeup including vulnerability background, technical details, patch analysis, and PoC guide.

CVE-2025-14635 NVD
AI-Generated Analysis
05 · Findings filter · search · paginate
Use quotes for exact: "SQL injection" · Operators: hello AND bye, admin OR root, -error, NOT warning
Showing 0 to 0 of 0 results
extensions/custom-js.php AI: 1 vulnerabilities 1 true positive CVE-2025-14635
--- cache/happy-elementor-addons_3.20.3/extensions/custom-js.php	2025-12-24 00:35:49.969433781 +0000+++ cache/happy-elementor-addons_3.20.4/extensions/custom-js.php	2025-12-24 00:36:50.001147304 +0000@@ -57,15 +57,29 @@         $element->end_controls_section(); 	} -	public function before_save_data( $data ) {-		if ( ! current_user_can( 'administrator' ) ) {-			$page_setting = get_post_meta( get_the_ID(), '_elementor_page_settings', true );+	public function before_save_data_old( $data ) {+		if ( ! current_user_can('administrator') ) {+			$page_setting = get_post_meta(get_the_ID(), '_elementor_page_settings', true); 			if ( isset( $data['settings']['ha_page_custom_js'] ) && isset( $page_setting['ha_page_custom_js'] ) ) {-				$prev_js = isset( $page_setting['ha_page_custom_js'] ) ? trim( $page_setting['ha_page_custom_js'] ) : '';+				$prev_js = isset( $page_setting['ha_page_custom_js'] ) ? trim($page_setting['ha_page_custom_js']) : ''; 				$data['settings']['ha_page_custom_js'] = $prev_js; 			} 		} 		return $data;+	}++	public function before_save_data( $data ) {+		if ( ! current_user_can( 'administrator' ) && isset( $data['settings']['ha_page_custom_js'] ) ) {+			$page_setting = get_post_meta( get_the_ID(), '_elementor_page_settings', true );+			if ( isset( $page_setting['ha_page_custom_js'] ) ) {+				// Restore previous value if it exists.+				$data['settings']['ha_page_custom_js'] = trim( $page_setting['ha_page_custom_js'] );+			} else {+				// Remove any custom JS attempt from non-admin users+				unset( $data['settings']['ha_page_custom_js'] );+			}+		}+		return $data; 	}  	public function render_scroll_to_top_html() {
AI Analysis
Vulnerability Existed: yes
TRUE POSITIVE
Improper Access Control - CWE-639 - extensions/custom-js.php lines 60-68
[Old Code]
```php
public function before_save_data( $data ) {
    if ( ! current_user_can( 'administrator' ) ) {
        $page_setting = get_post_meta( get_the_ID(), '_elementor_page_settings', true );
        if ( isset( $data['settings']['ha_page_custom_js'] ) && isset( $page_setting['ha_page_custom_js'] ) ) {
            $prev_js = isset( $page_setting['ha_page_custom_js'] ) ? trim( $page_setting['ha_page_custom_js'] ) : '';
            $data['settings']['ha_page_custom_js'] = $prev_js;
        }
    }
    return $data;
}
```
[Fixed Code]
```php
public function before_save_data( $data ) {
    if ( ! current_user_can( 'administrator' ) && isset( $data['settings']['ha_page_custom_js'] ) ) {
        $page_setting = get_post_meta( get_the_ID(), '_elementor_page_settings', true );
        if ( isset( $page_setting['ha_page_custom_js'] ) ) {
            // Restore previous value if it exists.
            $data['settings']['ha_page_custom_js'] = trim( $page_setting['ha_page_custom_js'] );
        } else {
            // Remove any custom JS attempt from non-admin users
            unset( $data['settings']['ha_page_custom_js'] );
        }
    }
    return $data;
}
```
Explanation:
The original code had a critical authorization bypass vulnerability. Non-administrator users could save custom JavaScript by exploiting the logic flaw: if a non-admin user submitted custom JS but there was no previously saved custom JS in the page settings, the condition `isset( $data['settings']['ha_page_custom_js'] ) && isset( $page_setting['ha_page_custom_js'] )` would be false, allowing the malicious custom JS to pass through unchanged. The fixed version explicitly removes any custom JS attempts from non-admin users when no previous value exists, and properly restores the previous value only when it exists. The additional early-exit check `isset( $data['settings']['ha_page_custom_js'] )` in the condition also improves efficiency by skipping unnecessary processing.
CVE Analysis Results:
CVE-2025-14635: Yes
View CVE Description
The Happy Addons for Elementor plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'ha_page_custom_js' parameter in all versions up to, and including, 3.20.3 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page, despite the intended role restriction of Custom JS to Administrators.
Showing 1 to 1 of 1 results