CVE-2022-31743
Medium · 6.5CVSS
6.5
EPSS
0.5%
Published
Dec 22, 2022
CISA due date
—
Cloudanix analysis
An older version of the Firefox browser could let attackers slip unwanted code into certain web pages that display user comments, allowing that code to run when someone views the page.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Application
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Incorrect HTML comment parsing in Firefox allows user-controlled data placed inside comments to break out and inject executable script, enabling cross-site scripting that differs from other browsers' behavior.
Why it matters to the business
Attackers could run unauthorized code in users' browsers on affected sites, potentially stealing session data or performing actions as the user; however the issue is old with minimal exploitation activity so operational risk remains low for updated environments.
How an attack unfolds
An attacker supplies crafted input containing HTML comment sequences that the vulnerable parser mishandles, causing injected script to execute when the page renders in an unpatched Firefox browser; no named threat actors or ransomware campaigns have been observed leveraging this flaw.
How to fix it
Upgrade Mozilla Firefox to version 101 or later; enable automatic updates and audit any internal web applications that reflect data inside HTML comments.
How to confirm the fix worked
Verify installed Firefox version is 101 or higher; attempt reproduction with test payloads that place script inside comments and confirm the script does not execute.
Typical attack path
- Locate a web application that places attacker-controlled data inside HTML comments
- Craft input that uses the parser discrepancy to terminate the comment early and inject script tags
- Deliver the payload via a link or form submission to a victim using vulnerable Firefox
- Script executes in the victim's browser context with the site's origin
How to detect it
Examine web server access logs and application logs for unusual comment payloads containing script tags or HTML entities that attempt to break out of comments; review browser telemetry or proxy logs for visits to suspect pages around the time of any reported anomalous behavior.
What your security team should do
- Prioritize deployment of Firefox 101+ across all managed systems
- Scan web applications for user data rendered inside HTML comments and refactor to safer output encoding
- Review browser update policies and enforce automatic updates to reduce exposure windows on legacy issues
The record
Firefox's HTML parser did not correctly interpret HTML comment tags, resulting in an incongruity with other browsers. This could have been used to escape HTML comments on pages that put user-controlled data in them. This vulnerability affects Firefox < 101.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Ubuntu:18.04:LTS | firefox | 0 | 101.0.1+build1-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 | 101.0.1+build1-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 | 101.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