CVE-2026-47079: CWE-838 Inappropriate Encoding for Output Context in joshnuss xml_builder
Inappropriate Encoding for Output Context vulnerability in joshnuss xml_builder (XmlBuilder module) allows Content Spoofing, Cross-site Scripting. This vulnerability is associated with program files lib/xml_builder.ex and program routines XmlBuilder.generate/1, XmlBuilder.generate/2, XmlBuilder.escape_string/1, XmlBuilder.escape_entity/1. XmlBuilder.generate/1 does not escape literal & characters in text or attribute values when they are followed by an entity-like token (lt;, gt;, amp;, quot;, apos;). As a result, attacker-supplied input such as <script> is emitted verbatim into the serialized XML rather than being escaped to &lt;script&gt;. When a downstream XML parser later reads the document, it decodes the entity sequences into the literal characters <script>, promoting inert-looking text into real markup. This allows an attacker to bypass upstream filters that block raw < and > characters, injecting markup into any downstream consumer that parses the produced XML and renders the text content in a markup-sensitive context (HTML, SVG, RSS/Atom feeds). Both element text and attribute values are affected. This issue affects xml_builder: from 0.0.6 before 2.4.1.
AI Analysis
Technical Summary
The vulnerability in joshnuss xml_builder (CVE-2026-47079) arises from inappropriate encoding for output context (CWE-838) in the XmlBuilder.generate/1 function and related routines. The function does not properly escape '&' characters when followed by entity-like tokens (e.g., lt;, gt;, amp;, quot;, apos;), causing attacker-supplied input such as <script> to be included verbatim in serialized XML. When downstream XML parsers decode these entities, the text is interpreted as real markup, enabling injection of malicious markup into any downstream consumer that parses and renders the XML. Both element text and attribute values are affected. This vulnerability affects xml_builder versions from 0.0.6 up to 2.4.1.
Potential Impact
An attacker can inject malicious markup into XML documents generated by the vulnerable xml_builder versions, potentially leading to content spoofing and cross-site scripting (XSS) in applications that parse and render the XML output in markup-sensitive contexts such as HTML, SVG, or RSS/Atom feeds. The vulnerability allows bypassing upstream filters that block raw '<' and '>' characters by exploiting improper escaping of entity-like sequences. However, the CVSS score is low (2.1), indicating limited impact or exploitability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch is currently documented. Until a patch is available, users should consider applying manual input validation or escaping on data before passing it to xml_builder, or avoid using affected versions in security-sensitive contexts. Monitor vendor channels for updates regarding an official fix.
CVE-2026-47079: CWE-838 Inappropriate Encoding for Output Context in joshnuss xml_builder
Description
Inappropriate Encoding for Output Context vulnerability in joshnuss xml_builder (XmlBuilder module) allows Content Spoofing, Cross-site Scripting. This vulnerability is associated with program files lib/xml_builder.ex and program routines XmlBuilder.generate/1, XmlBuilder.generate/2, XmlBuilder.escape_string/1, XmlBuilder.escape_entity/1. XmlBuilder.generate/1 does not escape literal & characters in text or attribute values when they are followed by an entity-like token (lt;, gt;, amp;, quot;, apos;). As a result, attacker-supplied input such as <script> is emitted verbatim into the serialized XML rather than being escaped to &lt;script&gt;. When a downstream XML parser later reads the document, it decodes the entity sequences into the literal characters <script>, promoting inert-looking text into real markup. This allows an attacker to bypass upstream filters that block raw < and > characters, injecting markup into any downstream consumer that parses the produced XML and renders the text content in a markup-sensitive context (HTML, SVG, RSS/Atom feeds). Both element text and attribute values are affected. This issue affects xml_builder: from 0.0.6 before 2.4.1.
CVSS v4.0
Score 2.1low
Affected software
cpe:2.3:a:joshnuss:xml_builder:*:*:*:*:*:*:*:*Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in joshnuss xml_builder (CVE-2026-47079) arises from inappropriate encoding for output context (CWE-838) in the XmlBuilder.generate/1 function and related routines. The function does not properly escape '&' characters when followed by entity-like tokens (e.g., lt;, gt;, amp;, quot;, apos;), causing attacker-supplied input such as <script> to be included verbatim in serialized XML. When downstream XML parsers decode these entities, the text is interpreted as real markup, enabling injection of malicious markup into any downstream consumer that parses and renders the XML. Both element text and attribute values are affected. This vulnerability affects xml_builder versions from 0.0.6 up to 2.4.1.
Potential Impact
An attacker can inject malicious markup into XML documents generated by the vulnerable xml_builder versions, potentially leading to content spoofing and cross-site scripting (XSS) in applications that parse and render the XML output in markup-sensitive contexts such as HTML, SVG, or RSS/Atom feeds. The vulnerability allows bypassing upstream filters that block raw '<' and '>' characters by exploiting improper escaping of entity-like sequences. However, the CVSS score is low (2.1), indicating limited impact or exploitability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch is currently documented. Until a patch is available, users should consider applying manual input validation or escaping on data before passing it to xml_builder, or avoid using affected versions in security-sensitive contexts. Monitor vendor channels for updates regarding an official fix.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- EEF
- Date Reserved
- 2026-05-18T17:28:10.319Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a882376acd9273b49f80ec6
Added to database: 08/21/2026, 10:07:50 UTC
Last enriched: 08/21/2026, 10:22:39 UTC
Last updated: 08/21/2026, 11:03:50 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.