CVE-2021-43540
Medium · 6.5CVSS
6.5
EPSS
0.9%
Published
Dec 8, 2021
CISA due date
—
Cloudanix analysis
A browser problem let some add-ons leave hidden scripts running on websites even after the add-on was removed, allowing continued activity without the user's knowledge.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Application
- Class
- Authorization Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
WebExtensions granted the required permissions can register and install ServiceWorkers scoped to arbitrary third-party origins; these workers are not removed during extension uninstall, leaving persistent background execution contexts.
Why it matters to the business
Organizations face ongoing risk of unauthorized background scripts on user browsers that survive extension removal, enabling stealthy tracking or actions without ongoing user or admin visibility.
How an attack unfolds
An attacker crafts a signed or sideloaded WebExtension requesting ServiceWorker-related permissions, convinces users to install it, registers persistent workers for chosen third-party sites, then removes the extension so the workers continue executing independently.
How to fix it
Upgrade all affected Mozilla Firefox installations to version 95 or later; audit and remove extensions that request broad ServiceWorker permissions.
How to confirm the fix worked
Confirm Firefox version is 95 or higher via about:support; enumerate registered ServiceWorkers in about:serviceworkers and verify none persist from previously uninstalled extensions.
Typical attack path
- Attacker publishes or distributes a WebExtension with ServiceWorker permissions
- User installs the extension
- Extension registers ServiceWorkers for target third-party origins
- Extension is uninstalled or removed
- ServiceWorkers remain active and execute on the target sites
How to detect it
Inspect about:serviceworkers and extension storage for registrations originating from extensions no longer present; review browser console or telemetry logs for ServiceWorker install events tied to removed add-ons.
- about:serviceworkers
- ServiceWorker register for third-party origin without active extension
- persistent worker script after extension uninstall
What your security team should do
- Immediately upgrade Firefox to 95 or newer across the environment
- Review and restrict WebExtension permissions in enterprise policies
- Monitor browser update compliance and extension inventories
The record
WebExtensions with the correct permissions were able to create and install ServiceWorkers for third-party websites that would not have been uninstalled with the extension. This vulnerability affects Firefox < 95.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Ubuntu:18.04:LTS | firefox | 0 | 95.0+build1-0ubuntu0.18.04.1 |
| Ubuntu:20.04:LTS | firefox | 0 | 95.0+build1-0ubuntu0.20.04.1 |
| Ubuntu:22.04:LTS | firefox | 0 | 95.0+build1-0ubuntu1 |
| openSUSE:Tumbleweed | MozillaFirefox | 0 | 95.0-1.1 |
| openSUSE:Tumbleweed | firefox-esr | 0 | 128.5.1-1.1 |
Related vulnerabilities
- CVE-2023-25736 An invalid downcast from `nsHTMLDocument` to `nsIContent` could have lead to undefined… Also affects firefox
- CVE-2023-25733 The return value from `gfx::SourceSurfaceSkia::Map()` wasn't being verified which could… Also affects firefox
- CVE-2023-32210 Documents were incorrectly assuming an ordering of principal objects when ensuring we… Also affects firefox
- CVE-2023-32216 Memory safety bugs present in Firefox 112. Also affects firefox
- CVE-2023-32209 A maliciously crafted favicon could have led to an out of memory crash. Also affects firefox
- CVE-2023-32208 Service workers could reveal script base URL due to dynamic `import()`. Also affects firefox
- CVE-2023-29551 Memory safety bugs present in Firefox 111. Also affects firefox
- CVE-2023-32207 A missing delay in popup notifications could have made it possible for an attacker to… Also affects firefox