Bad content-type in response header when getting document can lead to html injection
The server returned documents with a text/html content type regardless of the file's actual format, so an uploaded file containing HTML would be rendered as HTML when another user requested it. This could allow an attacker to inject HTML into the victim's browser.
Originally disclosed on HackerOne
- Triaged in 3 days
- Fixed in 2 months
- Disclosed after 3 months
Bug
When request document by genesis_id or filename, the content-type field in response header is 'text/html'. And the document content can be anything. So if we upload an odt file with html format and share with other users, it can lead to html injection when others request that file.
PoC
- img1 via es_id
- img2 via filename (share with others)
Attachments


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 set a fixed text/html content type for all document responses instead of deriving it from the file's actual type or forcing a download.
Impact
An attacker could inject HTML into another user's browser when that user opens the shared document.
What the attacker needed
Ability to upload a document; ability to share it with a victim; victim opens the shared document
How it was found
- Upload an ODT file whose content is HTML.
- Share the file with another user.
- Have the other user request the document by its identifier or filename.
- The response is served as text/html and the HTML is injected.
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.
The label always said 'web page' even for files that were not web pages, so a file containing HTML code would be shown as a web page and its HTML would be injected.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.