Skip to content

Prevent XSS by disabling Lottie expression evaluation - #3197

Merged
vytisbulkevicius merged 1 commit into
developmentfrom
bugfix/otter-internals/321
Nov 23, 2026
Merged

vytisbulkevicius merged 1 commit into
developmentfrom
bugfix/otter-internals/321

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Closes https://github.com/Codeinwp/otter-internals/issues/321

Summary

Added an end-to-end test to verify that Lottie animation data is rendered without evaluating embedded JavaScript expressions across different player components, ensuring potentially unsafe expressions are not executed.


Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@pirate-bot

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.5 KB 178.5 KB 0 B (0.00%)
Blocks 1.65 MB 1.65 MB 0 B (0.00%)
CSS 7.83 KB 7.83 KB 0 B (0.00%)
Dashboard 174.07 KB 174.07 KB 0 B (0.00%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.73 KB 4.73 KB 0 B (0.00%)
Pro 440.37 KB 440.37 KB 0 B (0.00%)

@pirate-bot

Copy link
Copy Markdown
Contributor

Plugin build for b8e061b is ready 🛎️!

@pirate-bot

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":431.65,"q50":446,"q75":471.5,"cnt":10}, firstPaint: {"q25":1685.21,"q50":1739.92,"q75":1814.98,"cnt":10}, domContentLoaded: {"q25":4421.61,"q50":4450.59,"q75":4483.09,"cnt":10}, loaded: {"q25":4425.53,"q50":4454.67,"q75":4487.12,"cnt":10}, firstContentfulPaint: {"q25":3316.72,"q50":3321.69,"q75":3355.67,"cnt":10}, firstBlock: {"q25":21049.09,"q50":21646.65,"q75":21761.9,"cnt":10}, type: {"q25":34.93,"q50":38.68,"q75":43.65,"cnt":10}, typeWithoutInspector: {"q25":33.79,"q50":35.52,"q75":37.02,"cnt":10}, typeWithTopToolbar: {"q25":45.46,"q50":52.52,"q75":70.42,"cnt":10}, typeContainer: {"q25":19,"q50":20.66,"q75":22.35,"cnt":10}, focus: {"q25":178.69,"q50":191.31,"q75":215.94,"cnt":10}, inserterOpen: {"q25":54.29,"q50":57.62,"q75":60.89,"cnt":10}, inserterSearch: {"q25":35.49,"q50":36.58,"q75":37.82,"cnt":10}, inserterHover: {"q25":5.92,"q50":6.33,"q75":7.61,"cnt":20}, loadPatterns: {"q25":2244.72,"q50":2328.48,"q75":2378.9,"cnt":10}, listViewOpen: {"q25":284.08,"q50":294.02,"q75":304.82,"cnt":10}

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The change removes Lottie expression evaluation from both bundled players, and the base-versus-head runs confirm that embedded expressions no longer execute.

Validation details
  • Files reviewed: 3/3 changed files.
  • Both bundles lose only the expressions plugin registration. This covers four copies in dotlottie-player.min.js and one in lottie-player.min.js [R2].
  • A source check found no other reachable eval path from animation data in the head bundles.
  • Static Chromium pages loaded each tree's bundles with the test markup. Base ran the expression for all three elements. Head did not [R6] [R8].
  • The frontend and editor previews load only the two patched bundles. The AMP path runs Lottie inside a cross-origin sandboxed AMP iframe.
Untested areas
  • The WordPress e2e spec did not run because Docker, wp-env and node_modules are unavailable.
  • A .lottie archive file did not run in a browser. Only the source check covers it.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • inc/render/amp/class-lottie.block.php:35-48 — unverified: AMP rendering passes the same user-selected URL to amp-bodymovin-animation instead of the patched players. Whether its engine registers expressions remains unresolved: the checkout…
    • inc/class-registration.php:580-582,1030-1038 — unverified: AMP rendering passes the same user-selected URL to amp-bodymovin-animation instead of the patched players. Whether its engine registers expressions remains unresolved: the checkout…

🤖 Automated review · run code-review-agent_6b03e16a42d812.65482695.


🤖 Review agent — review posted ✅ on b8e061b5 · approved · 0 findings · 23 min

Run code-review-agent_6b03e16a42d812.65482695 · trail

@vytisbulkevicius
vytisbulkevicius merged commit 2d45c6c into development Nov 23, 2026
15 checks passed
@vytisbulkevicius
vytisbulkevicius deleted the bugfix/otter-internals/321 branch November 23, 2026 13:44
@pirate-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.12 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants