Stored XSS from Display Settings triggered on Save and viewing realtime search demo
An attribute name containing an image tag with an error handler was stored and later rendered without encoding in display settings and the realtime search demo, triggering script on those pages.
- Triaged in 15 hours
- Fixed in 4 days
- Paid in 4 days
- Disclosed after 34 days
Here are the steps to trigger the XSS:
-
Create a JSON record that will contain the following attribute: {"<img src=1 onerror=alert(document.domain)>": "XSS attribute"}
-
Go to Indices -> Display and select the attribute <img src=1 onerror=alert(document.domain)> under Attributes for Faceting and click save.
-
Note that XSS is triggered multiple times on that page.
-
XSS is now triggered on https://www.algolia.com/explorer#?index=index_name as it also shows the attribute.
-
Create a public UI Demo and to the public url, xss is triggered. I've created a demo url: https://www.algolia.com/realtime-search-demo/xsstest
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
What the attacker needed
Ability to create a JSON record with a custom attribute name; access to Indices -> Display settings; victim views the affected page or public demo
How it was found
- Create a JSON record with an attribute name containing an image tag with an error handler.
- Go to Indices -> Display and select that attribute under Attributes for Faceting, then save.
- Observe the script executing multiple times on that page.
- View the attribute in the Algolia explorer, where the script also runs.
- Create a public UI Demo and visit its public URL, where the script runs again.
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.
A stored cross-site scripting (XSS) flaw lets someone save a piece of text that includes a small script, and later that script runs in other people's browsers when they view the page. Here, an attribute name was saved with an image tag that runs code when the image fails to load, and the site displayed it without making it safe.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.