Cloudanix VulnDB

CVE-2022-46873

High · 8.8

CVSS

8.8

EPSS

0.7%

Published

Dec 22, 2022

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

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

  1. Locate a page that reflects attacker-controlled markup while enforcing a Content Security Policy
  2. Craft markup containing a script whose hash matches an allowed source under unsafe-hashes semantics
  3. Deliver the payload to a victim browser running an unpatched Firefox version
  4. 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