CVE-2026-30830: Defuddle XSS Vulnerability via Unescaped String Interpolation
Summary
CVE-2026-30830: defuddle vulnerable to XSS via unescaped string interpolation in _findContentBySchemaText image tag. Affects defuddle versions < 0.9.0. Fixed in 0.9.0. 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
Defuddle is an open-source package designed for processing and rendering structured data in web applications. It allows developers to extract and display content from various sources, enhancing user experience. However, it has a vulnerability that exposes applications to cross-site scripting (XSS) attacks due to improper handling of HTML attributes during string interpolation.
Vulnerability Detail
The vulnerability arises from the _findContentBySchemaText method in the src/defuddle.ts file, which directly interpolates image src and alt attributes into an HTML string without escaping. An attacker can exploit this by injecting a quote character in the alt attribute, allowing them to break out of the attribute context and inject malicious event handlers. This XSS vulnerability can affect any application that renders Defuddle's HTML output, such as browser extensions and web clippers. The issue is distinct from previous sanitization bypasses, as it occurs during string construction rather than in the DOM, making it difficult for existing sanitization functions to mitigate the risk.
How To Fix
Latest published version: 0.19.5 as of 23 Oct 2026
npm install defuddle@0.19.5
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.9.0
This is the first release that contains the fix.
npm install defuddle@0.9.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using images with potentially unsafe alt attributes until the package is updated. Ensure that any input to the alt attribute is sanitized and does not contain characters that could break out of the attribute context.
Conclusion
The CVE-2026-30830 vulnerability in the Defuddle package poses a risk of XSS attacks due to unescaped string interpolation. It is crucial to update to the patched version 0.9.0 or later and implement the suggested code changes to mitigate this risk. Utilizing tools like Vulert can help monitor for such vulnerabilities in your applications.
See every vulnerability recorded for defuddle →
FAQ
CVE-2026-30830 is a vulnerability in the Defuddle package that allows for cross-site scripting (XSS) attacks due to improper handling of HTML attributes.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.
The CVSS score for this vulnerability is 2.1, indicating a low severity level.
You can update the Defuddle package to the patched version by running the command: npm install defuddle@0.9.0.
If you cannot update the package, ensure that any user-generated content is sanitized and avoid using images with unsafe attributes in the meantime.
References
Related vulnerabilities
Recent vulnerabilities recorded for defuddle.