CVE-2021-1038
NixOS vulnerability analysis and mitigation

Overview

The vulnerability CVE-2021-1038 is related to improper sanitization of data URLs and style attributes in the lxml HTML Sanitizer. The issue was discovered by GitHub Security Lab team member Alvaro Muñoz and was disclosed on January 12, 2022. The vulnerability affects the lxml library, specifically its HTML sanitization functionality (GitHub Advisory).

Technical details

The vulnerability consists of two main issues: First, improper sanitization of inline style attributes where the code uses insufficient regular expressions to remove import statements and expression calls. Second, improper sanitization of data URL images where the regular expression r'^data:image/.+;base64' allows potentially malicious data URLs containing SVG images with embedded JavaScript code. The vulnerability was tracked as CVE-2021-43818 (GitHub Advisory).

Impact

Both issues identified in the lxml HTML Sanitizer could lead to Cross-Site Scripting (XSS) attacks. The style attribute vulnerability has lower priority as XSS vectors on CSS styles typically don't work on modern browsers, while the data URL vulnerability could allow execution of malicious JavaScript code through SVG images (GitHub Advisory).

Mitigation and workarounds

A fix for these vulnerabilities was released on December 12, 2021. The coordinated disclosure timeline indicates that the issues were reported on November 10, 2021, acknowledged the next day, and the fix was released approximately one month later (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-69264CRITICAL9.8
  • JavaScriptJavaScript
  • pnpm
NoYesJan 07, 2026
CVE-2025-69263HIGH8.8
  • JavaScriptJavaScript
  • pnpm
NoYesJan 07, 2026
CVE-2025-69262HIGH7.8
  • JavaScriptJavaScript
  • pnpm
NoYesJan 07, 2026
CVE-2025-20807MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2026-21885MEDIUM6.5
  • NixOSNixOS
  • miniflux
NoYesJan 08, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management