Critical Vulnerability in node-dompurify: CVE-2026-41238
Summary
DEBIAN-CVE-2026-41238: ... Affects node-dompurify versions 2.4.1+dfsg+~2.4.0-1 – 3.3.3+dfsg-2. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
node-dompurify is a popular JavaScript library used for sanitizing HTML and preventing XSS (Cross-Site Scripting) attacks. It is widely utilized in web applications to ensure that user-generated content is safe for rendering in browsers. The library is designed to allow developers to clean potentially harmful HTML while preserving safe content. However, recent findings have revealed a vulnerability that could compromise the security of applications using this package.
Vulnerability Detail
CVE-2026-41238 is a critical vulnerability affecting all versions of node-dompurify. The vulnerability originates from improper input validation, which could allow an attacker to inject malicious scripts into sanitized HTML. This could lead to severe consequences, including unauthorized access to sensitive data, session hijacking, or complete takeover of the affected web application. The vulnerability is particularly concerning for applications that rely heavily on user-generated content, as it undermines the core purpose of the library.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If you are unable to update the package immediately, consider implementing input validation on your own to sanitize user inputs before passing them to node-dompurify. This can help mitigate the risk of XSS attacks until a proper update can be applied. Additionally, you can limit the types of HTML elements and attributes that are allowed in user-generated content.
Conclusion
The CVE-2026-41238 vulnerability in node-dompurify poses a significant risk to applications that rely on this package for sanitizing HTML. It is crucial to update to the latest version to protect against potential XSS attacks. Implementing workarounds can provide temporary relief, but a permanent fix through an update is strongly recommended.
See every vulnerability recorded for node-dompurify →
FAQ
CVE-2026-41238 is a critical vulnerability in the node-dompurify package that allows attackers to inject malicious scripts into sanitized HTML.
If your application uses node-dompurify, it may be at risk of XSS attacks, which could lead to unauthorized access to sensitive data or complete control over the application.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Implement input validation on user inputs to mitigate risks, and consider limiting allowed HTML elements and attributes until you can update the package.
You can find more information about node-dompurify on its official GitHub repository or documentation page.
References
Related vulnerabilities
Recent vulnerabilities recorded for node-dompurify.