Skip to content
XSS Write-up Intermediate

DuckDuckGo Privacy Essentials vulnerabilities: Insecure communication and Universal XSS

The DuckDuckGo Privacy Essentials browser extension used insecure window.postMessage communication without origin checks, leaking the parent frame's URL and iframe id to any web page, and it inserted unescaped data from a remote JSON file into dynamically executed JavaScript code. An attacker who could control that remote data could execute arbitrary JavaScript on any website the user visits and send messages to the extension's background page.

palant.info

Published on palant.info

2021-03-15 Security/Privacy/Duckduckgo 6 mins

Wladimir Palant, on palant.info

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 extension trusted messages from any origin and inserted unescaped remote data into dynamically executed JavaScript code.

Impact

A malicious or compromised server could execute arbitrary JavaScript on any website the user visits and control extension settings or read tab information, though the text notes the data source is normally trusted.

What the attacker needed

Victim uses the extension; attacker controls the remote JSON data

The fix

The extension removed the insecure content script and changed the dynamic code to use JSON.stringify() for proper encoding.

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 browser extension can add extra features to your browser. This extension used a messaging system that any website could listen to and send messages on, so websites could learn private details and even trick the extension into running harmful code. The extension makers fixed both problems in an update.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.