Reflected/Stored XSS on duckduckgo.com
A search result from Urban Dictionary containing an HTML injection payload was rendered unsanitised on DuckDuckGo's main search page, causing a stored cross-site scripting vulnerability. An attacker could execute arbitrary JavaScript in the context of duckduckgo.com by crafting a search query that triggers the malicious result.
- Triaged in 20 hours
- Fixed in 15 days
- Disclosed after 45 days
Summary by the researcher
Writeup here: https://monke.ie/duckduckgoxss/
The report
Hi DuckDuckGo,
While browsing normally (since I use DuckDuckGo on a daily basis), I discovered an interesting stored XSS on the duckduckgo main search engine. A payload that somebody had left on urbandictionary.com had triggered a HTML injection, and a stored XSS as a result.
Steps to Reproduce
- Search the following in the searchbar of DuckDuckGo:
urban dictionary "><img src=x< - A payload left by someone else will render itself and fire in the main DuckDuckGo page.
- It is also possible to visit the page via the DuckDuckGo URL as such and the XSS will trigger.
POC
- The page itself renders HTML. The payload fires.

evidence1.png From the original on HackerOne 
evidence2.png
Impact
There are several impacts here.
- Firstly, the DuckDuckGo URL serves as a payload, because simply visiting the page with the right search parameter triggers the XSS, although the search parameters themselves do not directly trigger it.
- Secondly, the XSS is stored in the search results, so this can be considered to be Stored XSS.
- It is possible to execute any Javascript via the main DuckDuckGo page.
If you have any questions or require clarification, I am happy to help. Cheers, PMOC
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 search result content from Urban Dictionary was inserted into the DuckDuckGo page without proper HTML sanitisation or escaping.
Impact
An attacker could execute arbitrary JavaScript in the context of the main DuckDuckGo page.
What the attacker needed
Victim searches for a specific term; malicious content exists on Urban Dictionary
How it was found
- Search for a specific term in DuckDuckGo's search bar.
- A payload left by someone else renders and fires on the main DuckDuckGo page.
- Alternatively, visit a crafted DuckDuckGo URL with the search parameter to trigger the XSS.
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.
XSS is when a site shows user content without cleaning it, so code runs in a visitor's browser. Here an Urban Dictionary entry was shown on DuckDuckGo's results page and executed as part of DuckDuckGo, letting an attacker run JavaScript on that page.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.