CVE-2024-0604 — Best WordPress Gallery Plugin – FooGallery <= 2.4.7 -Authenticated(Administrator+) Stored Cross-Site Scripting via settings

The Best WordPress Gallery Plugin – FooGallery plugin for WordPress is vulnerable to Stored Cross-Site Scripting via admin settings in all versions up to, and including, 2.4.7 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with administrator-level permissions 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.

Proof of Concepts

  1. Open plugin setting and go to Language section /wp-admin/edit.php?post_type=foogallery&page=foogallery-settings#language
  2. Put XSS Payload ‘Image Viewer “Prev” Text’ form Prev</script><img src onerror=alert(/XSS/)>
  3. Create new Gallery and put the shortcode in a new post

XSS Payload will triggered in the created post.

var FooGallery_il8n = {"template":{"image-viewer":{"prev":"Prev</script><img src onerror=alert(/XSS/)>"}}};

Note: All form in **Image Viewer Template** is vulnerable to XSS

Impact

This makes it possible for authenticated attackers, with administrator-level permissions and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.