Skip to content
XSS Write-up Intermediate

Bypass CSRF Prevention with Cross Site Scripting (XSS)

A stored XSS vulnerability in the WP Logs Book plugin lets an attacker run JavaScript in an administrator's browser. Because WordPress places the user-creation nonce in the page DOM, the injected script can read it and submit a request that creates a new administrator account.

medium.com

Published on medium.com

สวัสดีครับผม คิม ที่เพื่อนๆมักเรียกกันว่า Kim Japan Antivirus …. ไม่ต้องไปนึกคำย่อ 5555 วันนี้ผมจะมานำเสนอวิธีหนึ่งที่ใช้ในการ Escalate ความรุนแรงของ XSS ให้มากขึ้น และเพิ่มความระมัดระวังการใช้ CMS & Open Source ที่มีลักษณะการเก็บ nonce ที่คล้ายกันครับ วิธีนี้ก็ไม่น่าจะใช่อะไรไหม่สำหรับคนที่สอบ OSCP…

歔欷と, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the user-creation nonce is embedded in the page DOM, so any XSS reaching an administrator can read it and bypass the CSRF protection it was meant to provide.

Impact

An attacker who can store XSS in the plugin could create a new administrator account without the victim's knowledge, and the author notes this could be chained further toward RCE.

What the attacker needed

Vulnerable WP Logs Book plugin; attacker can store XSS in login logs; admin views the logs page

How it was found

  1. Inject a stored XSS payload through the WP Logs Book plugin so it is saved for the admin to see.
  2. Wait for an administrator to open the dashboard or logs page, where the script executes.
  3. Use the script to fetch the user-new page and extract the nonce from the response.
  4. Send a POST request with that nonce to create a new user with the administrator role.

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 write-up has not been written yet. The Original tab links to the source.

A nonce is a random value a website puts in a form to prove the request really came from that site, which normally stops another site from forging actions. Here the plugin let an attacker store script that runs when an admin views the logs page, and that script could read the nonce already present on the page and use it to create a new admin account.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.