# CVE-2026-90993: Apache XML Graphics Batik: Harden validation in SAXDocumentFactory

The Markdown version of <https://upatch.dev/cve/CVE-2026-90993>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-90993 is rated High 7.5 (CVSS 3.1, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N). It affects Apache XML Graphics Batik (Apache Software Foundation) and was published on 11 Nov 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.5%: the estimated chance it is exploited in the next 30 days, as of 25 Nov 2026. The upatch `cve-2026-90993-xxe-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-90993 (BATIK-1399, CWE-611), "Apache XML Graphics Batik: Harden validation in SAXDocumentFactory", was published on 11 November 2026 and affects Apache XML Graphics Batik through 1.19. While `SAXDocumentFactory.createDocument(InputSource)` and the static `saxFactory` initializer in `org.apache.batik.dom.util.SAXDocumentFactory` disable external entities on parsers they construct, the overload `SAXDocumentFactory.createDocument(String ns, String root, String uri, XMLReader r)` attaches `this` as `ContentHandler`, `DTDHandler`, and `EntityResolver` on the caller-supplied `XMLReader` and calls `r.parse(uri)` without disabling external general entities, external parameter entities, or external DTD loading. When a Java service calls `createDocument(ns, root, uri, r)` with a default `XMLReader` on an SVG or XML document that declares a `DOCTYPE` with an external `SYSTEM` entity such as `file:///etc/hostname` or `file:///etc/passwd`, the parser opens the local file and expands its contents into the parsed DOM tree. Version 1.20 (commit `ae70b4dececdc33cc79f86d43135ac8c230e094c`) fixes the vulnerability by setting `http://xml.org/sax/features/external-general-entities`, `http://xml.org/sax/features/external-parameter-entities`, and `http://apache.org/xml/features/nonvalidating/load-external-dtd` to `false` on `r` before parsing.

### Official description

XXE vulnerability in Apache XML Graphics Batik.

This issue affects Apache XML Graphics Batik: through 1.19.

Users are recommended to upgrade to version 1.20, which fixes the issue.

## What the upatch does

One BPF LSM program attached to `lsm/file_open` returns `-EPERM` when all of the following hold:

| Condition          | Checked                                                                                                                                                                                                                            |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Regular file       | `(dentry->d_inode->i_mode & S_IFMT) == S_IFREG`                                                                                                                                                                                    |
| Guarded host path  | Directly in `/etc` (excluding standard resolver, locale, and loader files `hosts`, `resolv.conf`, `nsswitch.conf`, `localtime`, `timezone`, `ld.so.cache`, `gai.conf`, and `host.conf`), directly in `/root`, or in `/home/<user>` |
| Batik Java process | Current task executable (`mm->exe_file`) is `java` and the first 256 bytes of its command line (`mm->arg_start` to `mm->arg_end`) contain `batik`                                                                                  |

When the `XMLReader` inside `SAXDocumentFactory.createDocument` tries to open a guarded local file such as `/etc/hostname` to resolve a `file:///` external entity, `openat` fails with `EPERM` and `createDocument` throws an `IOException` instead of incorporating the file's contents into the DOM. A refusal from an earlier BPF LSM program on the same hook is preserved, and key 0 of the `refused` per-CPU array map counts refused file opens.

The policy: [`cve-2026-90993-xxe-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-90993), 134 lines of BPF C attached at `lsm/file_open`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Any `java` process whose initial command-line arguments contain `batik` within the first 256 bytes cannot open regular files directly in `/etc` (other than the listed resolver and locale files), `/root`, or `/home/<user>`.
- Normal Batik SVG and XML DOM parsing, reading TLS trust stores under `/etc/ssl/` or `/etc/java-*`, and all file accesses by other processes or non-Batik JVMs continue to work.
- Not covered: a JVM whose classpath places `batik` beyond the first 256 bytes of `mm->arg_start` or loads Batik JARs only through a custom class loader or `@argfile`, or external entity references targeting application files outside `/etc`, `/root`, and `/home/<user>`.

## Preemption model and cost

The program holds no locks and updates its per-CPU `refused` counter with `__sync_fetch_and_add`, making it safe under every preemption model including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC`, and `PREEMPT_RT`. On every `file_open` outside `/etc`, `/root`, and `/home/<user>`, the program checks only the inode mode and the parent and grandparent dentry names before returning 0, avoiding task lookups and user-memory reads on normal file operations.

## Affected versions

Apache XML Graphics Batik through 1.19; fixed in 1.20 (commit `ae70b4dececdc33cc79f86d43135ac8c230e094c`).

Kernels: any Linux kernel supported by shirudo with BPF LSM (`lsm/file_open`) and BTF enabled, including Linux 7.4.

## How it was tested

On Apache XML Graphics Batik 1.19, the loaded upatch refused SAXDocumentFactory.createDocument opening /etc/hostname during external entity resolution while allowing normal SVG parsing.

- **Tested:** 25 Nov 2026
- **Target:** Apache XML Graphics Batik 1.19 (SAXDocumentFactory.createDocument with XMLReader) on OpenJDK 21, listening on 127.0.0.1:18093
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | XXE file:///etc/hostname read blocked | Normal SVG parsing works |
| --------------- | ------------------------------------- | ------------------------ |
| Before loading  | no                                    | yes                      |
| Upatch loaded   | yes                                   | yes                      |
| After unloading | no                                    | yes                      |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-90993
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-90993-1.0.0.bee oci://<registry>/<namespace>/cve-2026-90993 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-90993-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-90993 on oss-security](http://www.openwall.com/lists/oss-security/2026/11/11/20)
- [Apache mailing list announcement](https://lists.apache.org/thread.html/cnl5g2os5w048h32x50v1xgjnyo8y6vs)
- [BATIK-1399 Jira issue](https://issues.apache.org/jira/browse/BATIK-1399)
- [Fix commit ae70b4dececd](https://github.com/apache/xmlgraphics-batik/commit/ae70b4dececdc33cc79f86d43135ac8c230e094c)

### Links

- [CVE-2026-90993 on upatch.dev](https://upatch.dev/cve/CVE-2026-90993) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-90993)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-90993)
- [CWE-611](https://cwe.mitre.org/data/definitions/611.html)
- Upatch source: [upatches/cve-2026-90993](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-90993)

### More references from NVD (3)

- [issues.apache.org](https://issues.apache.org/jira/browse/BATIK-1399)
- [lists.apache.org](https://lists.apache.org/thread.html/cnl5g2os5w048h32x50v1xgjnyo8y6vs)
- [openwall.com](http://www.openwall.com/lists/oss-security/2026/11/11/20)
