I Found an Unauthenticated XSS in a WordPress Hotel Plugin — Then Someone Beat Me to It by a Week
The nd-booking WordPress plugin reflected the guest count URL parameter into an HTML attribute without proper escaping, allowing an attacker to inject attributes and execute JavaScript. An attacker could send a crafted link to a logged-in administrator and run code in their session.
osintteam.blog
Published on osintteam.blog
Everyone wants the story where you find the bug. Nobody tells the one where you find it, write a clean report, hit submit… and get back a single word: Duplicate.
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
The plugin used sanitize_text_field() on input but failed to escape the value with esc_attr() when printing it into an HTML attribute, allowing attribute injection.
Impact
An attacker could execute arbitrary JavaScript in the context of the vulnerable site, potentially compromising administrator sessions if a logged-in admin visits a crafted link.
What the attacker needed
Victim clicks a link; victim is logged in as admin
The fix
The plugin should escape the reflected value with esc_attr() when printing it into the HTML attribute.
How it was found
- Set up a local WordPress installation with the nd-booking plugin version 3.8.
- Create a page containing the [nd_booking_search_results] shortcode.
- Visit the page as a logged-out user with a crafted URL that includes both date parameters and a malicious guest count value.
- Observe that the injected JavaScript executes in the page origin.
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.
The plugin took a number from the web address and put it directly into the page's HTML without cleaning it properly. Because it didn't escape quotes, an attacker could add their own code to the page. When someone visits a specially crafted link, that code runs in their browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.