Skip to content

EEF-CVE-2026-47079 CVE-2026-47079 GHSA-5hjx-8g53-cmvm

Round-trip Corruption via Improper Entity Escaping in xml_builder

Not rated yet Hex
Severity
0.0 / 10
Unknown · CVSS 4.0
Exploit chance (EPSS)
0.19%
Chance of exploitation in the next 30 days. Higher than 8.55% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-838 Inappropriate Encoding for Output Context
Fix
2.4.1
Upgrade xml_builder to this version or later

Description

Summary

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 &lt;script&gt; is emitted verbatim into the serialized XML rather than being escaped to &amp;lt;script&amp;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.

Affected versions

Hex

PackageVulnerableFixed in
xml_builder
>= 0.0.6, < 2.4.1
2.4.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

xml_builder Hex → 2.4.1

mix
{:xml_builder, "~> 2.4.1"} # then: mix deps.update xml_builder

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N

Attack vector
Local
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
None
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
Low
Availability (subsequent systems)
None

Weakness

CWE-838: Inappropriate Encoding for Output Context

The product uses or specifies an encoding when generating output to a downstream component, but the specified encoding is not the same as the encoding that is expected by the downstream component.

How to prevent it
  • Implementation: Use context-aware encoding. That is, understand which encoding is being used by the downstream component, and ensure that this encoding is used. If an encoding can be specified, do so, instead of assuming that the default encoding is the same as the default being assumed by the downstream component.
  • Architecture and Design: Where possible, use communications protocols or data formats that provide strict boundaries between control and data. If this is not feasible, ensure that the protocols or formats allow the communicating components to explicitly state which encoding/decoding method is being used. Some template frameworks provide built-in support.
  • Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using the ESAPI Encoding control [REF-45] or a similar tool, library, or framework. These will help the programmer encode outputs in a manner less prone to error. Note that some template mechanisms provide built-in support for the appropriate encoding.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
EEF-CVE-2026-48590
Element and Attribute Names Injected Verbatim into XML Output in xml_builder
Not rated yet Also affects xml_builder
EEF-CVE-2026-47080
CDATA Section Breakout via Unsanitised ]]> in xml_builder
Not rated yet Also affects xml_builder
GHSA-vvh5-7v3m-j3mj
Moodle Unsanitized HTML in site log for config_log_created
Medium Same weakness, CWE-838
GHSA-jhcf-j4hg-v64r
Pimcore Access Control Issues
Critical Same weakness, CWE-838

Credits: Jonatan Männchen / EEF, Joshua Nussbaum, Peter Ullrich

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor