Self-XSS via filename + CSRF on contact us ‘multipart/data’ form
A contact form's file-upload error message reflected the uploaded filename without proper encoding, allowing HTML and script injection. Because the upload used a multipart POST, the author built a custom CSRF page that auto-submits a file to turn the self-XSS into a reflected XSS triggered on a victim.
السلا� عليك� و رح� ة الله قبل كل شيئ ارجو � نك� الدعاء لإخواننا في غزة, الله� أنصره� نصرا قريبا � ؤزرا
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 filename from the multipart upload was inserted into the error message without HTML encoding, and the endpoint accepted cross-site multipart POSTs without CSRF protection.
Impact
An attacker could run script in a victim's browser via a crafted page that auto-submits the upload, though the report does not detail what actions the script could take.
What the attacker needed
Victim visits attacker page; victim's browser submits multipart form
How it was found
- Submit a random string in the contact form and observe it is reflected.
- Upload a file with an unusual extension and see the filename reflected in an error message.
- Inject HTML into the filename and confirm it renders.
- Use a dot-free JavaScript call to bypass the extension check.
- Build a custom CSRF page that auto-submits a multipart file upload.
- Confirm the resulting reflected XSS is exploitable.
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 website showed back the name of a file you uploaded inside an error message. Normally only you would see this, which is called self-XSS and is not very useful. The author made a page that quietly uploads a file for the victim, so the victim's own browser runs the injected script.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.