Reflected Cross-Site scripting in : mtn.bj
A reflected cross-site scripting flaw existed in the file upload filename field on mtn.bj. An attacker could inject a script via a crafted filename so that it executes in a victim's browser and accesses cookies or session tokens.
Originally disclosed on HackerOne
- Triaged in 37 days
- Fixed in 42 days
- Disclosed after 2 months
Summary by the researcher
Writeup : ██████████
The report
Hello Team I have found a Reflected XSS vulnerability in mtn.jb by file name
Steps To Reproduce:
[add details for how we can reproduce the issue]
- go to :
████ 2. enter any email and press Suivant 3. fill all the inputs by any data . 4. in file upload upload any photo with payload file name : "><img src=x onerror=alert(document.cookie);.jpg
5 . the payload executed in the page
Supporting Material/References: 1 - video showing poc 2 - screenshot
Impact
An attacker can use XSS to send a malicious script to an unsuspecting user. The end user’s browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page
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 application reflected the uploaded file's name into the page without encoding it, so HTML and script in the name were treated as markup.
Impact
An attacker could run a script in an unsuspecting user's browser that reads cookies, session tokens and other sensitive data, and could rewrite the page content.
What the attacker needed
Victim visits the crafted page or link; attacker can upload a file with a crafted name
How it was found
- Open the sign-up page on the site.
- Enter any email address and press the continue button.
- Fill in the remaining form fields with arbitrary data.
- Upload a photo whose filename contains an HTML image tag with an error handler.
- Observe the script executing on the page.
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.
Cross-site scripting (XSS) is when a website displays user-supplied text as if it were part of the page's code, so a script hidden in that text runs in the visitor's browser. Here the name of an uploaded photo was shown back on the page without being made safe, so a name containing a script tag ran. That script could then read the visitor's cookies, which are small pieces of data the site uses to remember who is logged in.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.