Cross-Field XSS – A Creative Bypass I Found During Testing
The application validated each input field separately, so splitting an XSS payload across the first name and last name fields bypassed length limits, keyword filters and character sequence checks. When the two fields were combined for display, the browser reconstructed and executed the full payload.
Published on medium.com
This is my first security write-up, and I wanted to share a creative finding I came across while performing security testing on a web application.
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
Impact
This could allow session cookie theft, data exfiltration and performing actions on behalf of victims, and splitting across fields increases the total payload length available, making it possible to load external scripts.
What the attacker needed
Ability to create or edit a worker profile; victim views the rendered profile
The fix
The application should allow only required characters in input fields and use output encoding before rendering user-controlled data in the browser.
How it was found
- Create a worker profile with a first name and last name.
- Observe that the page displays the full name by joining the first and last name.
- Place the first part of an XSS payload in the first name field and the second part in the last name field so each field passes validation.
- View the worker profile and see the browser reconstruct and execute the full payload.
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.
Cross-site scripting (XSS) is when an attacker gets their own code to run in another user's browser. Here, the site checked each name field on its own, so the attacker put half of a malicious snippet in the first name and half in the last name. The site then joined the two halves on the page, and the browser ran the combined code.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.