CVE-2022-46873
High · 8.8CVSS
8.8
EPSS
0.7%
Published
Dec 22, 2022
CISA due date
—
Cloudanix analysis
Older versions of the browser could let attackers slip harmful code past website security rules that were supposed to stop it.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Application
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Missing implementation of the unsafe-hashes CSP directive allows an attacker who can inject markup into an otherwise CSP-protected page to execute injected scripts, subject to the remaining policy constraints.
Why it matters to the business
Attackers could run unauthorized code inside users' browsers on protected pages, potentially leading to session hijacking, data theft, or further compromise of user accounts on affected sites.
How an attack unfolds
An attacker first identifies a page that accepts user-controlled markup but is protected by a Content Security Policy. Because the browser lacks unsafe-hashes support, the attacker crafts markup that injects executable script while still satisfying the policy's hash or nonce rules, resulting in code execution within the page's origin.
How to fix it
Upgrade all Firefox installations to version 108 or later, which implements the unsafe-hashes CSP directive. Review and tighten existing Content Security Policies to reduce reliance on inline scripts where possible.
How to confirm the fix worked
Confirm Firefox version is 108 or higher. Test pages with CSP headers that include unsafe-hashes directives and verify that injected scripts are blocked as expected.
Typical attack path
- Locate a page that reflects attacker-controlled markup while enforcing a Content Security Policy
- Craft markup containing a script whose hash matches an allowed source under unsafe-hashes semantics
- Deliver the payload to a victim browser running an unpatched Firefox version
- Bypass CSP restrictions and execute arbitrary JavaScript in the victim's session context
How to detect it
Review web server or browser CSP violation reports for unexpected inline script executions on pages protected by Content Security Policy. Correlate with Firefox version telemetry or user-agent strings indicating versions below 108.
What your security team should do
- Prioritize updating all Firefox deployments to 108 or newer
- Audit web applications for CSP policies that could be weakened by this browser limitation
- Enable CSP reporting to monitor for unexpected script execution attempts
- Educate developers on safe use of unsafe-hashes once browser support is confirmed
The record
Because Firefox did not implement the <code>unsafe-hashes</code> CSP directive, an attacker who was able to inject markup into a page otherwise protected by a Content Security Policy may have been able to inject executable script. This would be severely constrained by the specified Content Security Policy of the document. This vulnerability affects Firefox < 108.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Ubuntu:18.04:LTS | firefox | 0 | 108.0+build2-0ubuntu0.18.04.1 |
| Ubuntu:18.04:LTS | mozjs38 | 0 | No fix |
| Ubuntu:18.04:LTS | mozjs52 | 0 | No fix |
| Ubuntu:20.04:LTS | firefox | 0 | 108.0+build2-0ubuntu0.20.04.1 |
| Ubuntu:20.04:LTS | mozjs52 | 0 | No fix |
| Ubuntu:20.04:LTS | mozjs68 | 0 | No fix |
| Ubuntu:22.04:LTS | mozjs78 | 0 | No fix |
| Ubuntu:22.04:LTS | mozjs91 | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | mozjs38 | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | mozjs52 | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | mozjs52 | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | mozjs68 | 0 | No fix |
| Ubuntu:Pro:22.04:LTS | mozjs78 | 0 | No fix |
| openSUSE:Tumbleweed | MozillaFirefox | 0 | 108.0.1-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