# CVE-2026-47079: Round-trip Corruption via Improper Entity Escaping in xml_builder

> Attackers can inject malicious scripts into XML output by exploiting improper entity escaping, leading to XSS in downstream consumers.

- **Severity:** Low 2.1 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Aug 2026
- **Updated:** 21 Aug 2026
- **Also known as:** EEF-CVE-2026-47079, GHSA-5hjx-8g53-cmvm

## What is CVE-2026-47079?

CVE-2026-47079 is a low-severity cross-site scripting vulnerability in joshnuss xml_builder, published on 21 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official 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 &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.

Weakness: CWE-838 (Inappropriate Encoding for Output Context)

## Which versions are affected by CVE-2026-47079?

1 open source package ship an affected version, including xml_builder.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `xml_builder` | Hex | From 0.0.6 | 2.4.1 |

## How do I fix CVE-2026-47079?

Upgrade xml_builder to 2.4.1 or later.

## Is CVE-2026-47079 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-47079 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-47079 and fix it if it is affected.

What it is: CVE-2026-47079 is a low-severity cross-site scripting vulnerability in joshnuss xml_builder, published on 21 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-47079 exists.

Affected packages and fixed versions:
- xml_builder (Hex): affected from 0.0.6; fixed in 2.4.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-47079/ (Markdown: https://insights.sbomify.com/CVE-2026-47079/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-47079
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-47079
- OSV: https://osv.dev/vulnerability/CVE-2026-47079

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-47079/
Summaries are generated and may contain mistakes; the official description above is the record.
