In early 2022, Mozilla patched a serious security hole in Firefox and related products. Labeled CVE-2022-26485, this vulnerability involves a use-after-free bug triggered by removing an XSLT parameter during document processing. Soon after discovery, attackers were seen exploiting this flaw in the wild.
What Is CVE-2022-26485?
CVE-2022-26485 is a high-impact use-after-free (UAF) vulnerability in Firefox’s XSLT processing component. 
In plain English:  
When a website runs an XML transformation (XSLT), an attacker can remove a parameter during the process, causing memory that should be “busy” to be freed and then reused for something else. If the browser uses this memory after freeing it—maybe running attacker code instead—that can lead to crashes, data leaks, or worse: remote code execution.
This bug affects several Mozilla products
- Firefox versions *before* 97..2 (release notes)
Focus for Android before 97.3.
If you’re using a browser version older than those, you should update now.
1. XSLT Processing Basics
XML Stylesheets Language Transformations (XSLT) lets a browser (like Firefox) convert and display XML using a style template. XSLT use in browsers is powerful, but handling XML documents and associated JS events can introduce security risks—like this one.
2. Where’s the Bug?
The main problem was inside Firefox’s handling of XSLT parameters. There’s an internal class for XSLT parameters on the stack. Under certain conditions, removing the parameter while it’s still in use causes the browser to access memory that’s already been released (“freed”).
Code Snippet (Simplified C++ Style)
void ProcessXSLTParams(XSLTParams* params) {
    while (params->hasNext()) {
        Param* p = params->next();
        // ...do something...
        if (shouldRemove(p)) {
            params->remove(p);
            // At this point, 'p' may have been deleted!
        }
        // Using 'p' after it may have been deleted
        DoWork(p); // Use-After-Free if p is now invalid
    }
}
*The dangerous part: after params->remove(p), p might no longer point to valid memory, but DoWork(p) still tries to use it!*
Use JavaScript to remove parameters while the transformation is happening.
3. This triggers the use-after-free bug, possibly leading to the browser executing malicious code (remote code execution).
Public Proof-of-Concept (POC)
Since this vulnerability was actively exploited in the wild, responsible researchers and Mozilla intentionally withheld full public exploits. But the advisory (Mozilla’s MFSA 2022-09) notes real-world abuse.
Here’s a simplified JavaScript snippet showing the bug’s potential surface
let xsltDoc = new XSLTProcessor();
xsltDoc.importStylesheet(stylesheetDoc);
// Vulnerable sequence: 
// Remove parameter during transformation
xsltDoc.setParameter(null, "badParam", "value");
xsltDoc.removeParameter(null, "badParam");
// Now, transform the XML
let result = xsltDoc.transformToFragment(xmlDoc, document);
// Under the hood, a use-after-free could be triggered
*The attacker would need to control timing and XSLT content to maximize risk. Full remote code execution requires further steps.*
Thunderbird < 91.6.2
- Firefox for Android/Focus < 97.3.
2. Disable JavaScript and XSLT (if possible)
This vulnerability relies on active XSLT usage. Limiting or disabling such features can reduce risks—though this may break websites.
Key References and Further Reading
- Mozilla Security Advisory 2022-09 (CVE-2022-26485)
- CVE Details on CVE-2022-26485
- Firefox’s Bugzilla Issue #1750532 (restricted)
- XSLTProcessor Documentation (MDN)
- Red Hat Security Advisory
Final Word
CVE-2022-26485 was a major browser flaw—abused in the wild—arising from a subtle memory use issue in XSLT handling. It shows how powerful web features can open the door to security bugs, and why timely browser updates matter.
Stay safe: update now—and keep an eye out for more browser bug writeups in the future.
*For comments or corrections, please reply below.*
Timeline
Published on: 12/22/2022 20:15:00 UTC
Last modified on: 12/30/2022 16:22:00 UTC
