/

CVE-2026-22186

Severity:

HIGH RISK

(7.1)

XML External Entity (XXE) in Bio-Formats Leica Metadata

CVE-2026-22186

Modified

Vulnerability type

Category:

XML External Entity (XXE)

CWE:

CWE-611

Impact:

Server-Side Request Forgery (SSRF) and Local File Disclosure

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Bio-Formats up to and including version 8.3.0 contains an XML External Entity (XXE) vulnerability in the Leica Microsystems metadata parsing component, such as the XLEF handler.

When processing crafted Leica XML-based metadata files, the insecure XML parser configuration can allow external entities and external DTDs to be resolved, potentially leading to SSRF, local file disclosure where readable, or denial of service during parsing.

Affected context

The vulnerability affects environments that use Bio-Formats to parse Leica XML-based metadata files (for example, XLEF) in applications such as imaging servers, pipelines, or desktop analysis tools.

It is most relevant when Bio-Formats is exposed to metadata from untrusted or semi-trusted sources, such as uploaded microscopy data, shared datasets, or automated ingestion pipelines where the origin of files cannot be fully controlled.

The issue arises because the underlying XML DocumentBuilderFactory is not hardened against external entity expansion and external DTD loading.

Exploit preconditions

  • Attack surface: XML metadata parsing logic for Leica formats (e.g., XLEF) inside Bio-Formats.
  • Required access: Ability to supply or influence Leica XML-based metadata files that are processed by Bio-Formats (e.g., file upload, shared storage, ingestion from external sources).
  • Trigger point: Opening, importing, or otherwise parsing a malicious Leica metadata file that contains crafted XML entity definitions.
  • Why exploitation is possible: The DocumentBuilderFactory used by the Leica metadata parser is not configured to disable external entity resolution and external DTD access, allowing the XML parser to perform network requests or read local resources during entity expansion.

Why this happens

This vulnerability stems from insecure XML parser configuration, mapped to CWE-611: Improper Restriction of XML External Entity Reference.

The Leica metadata parsing component relies on a DocumentBuilderFactory that permits external entities and DTDs to be resolved, treating parts of the XML content as instructions for the parser to fetch external resources.

When untrusted metadata files are processed, attacker-controlled entity declarations can cause the parser to initiate outbound connections or attempt to read local files, exposing internal network paths or sensitive local data and consuming excessive resources during parsing.

Potential impact

  • Outbound network requests to attacker-controlled or internal endpoints (SSRF), potentially interacting with internal services not otherwise exposed.
  • Access to local system resources that the parsing process can read, such as configuration files or logs, via external entity resolution.
  • Denial of service through resource-intensive XML parsing, such as recursive entity expansions or large external resources.
  • Leakage of environment details (e.g., internal hostnames, reachable ports) through controlled error behavior or side channels.

General mitigation guidance

Mitigation generally focuses on hardening XML parser configuration and avoiding external resource resolution for untrusted data.

Recommended defensive patterns include:

  • Configuring XML parsers (DocumentBuilderFactory and related APIs) to disable external entities, DTDs, and external schema loading by default.
  • Using secure XML processing modes or hardened factory helpers that enforce safe defaults across the codebase.
  • Treating all metadata files as untrusted input and separating their parsing from high-privilege contexts (e.g., running parsers with least-privilege accounts and limited filesystem access).
  • Limiting outbound network access from components responsible for XML parsing, especially when handling user-supplied or third-party files.
  • Implementing robust input validation and size limits to reduce the risk of resource exhaustion during parsing.

How teams detect issues like this

Detection typically involves a combination of code-level analysis and runtime monitoring:

  • Static analysis rules that flag XML parser creation without secure features enabled (e.g., missing attributes to disable external entities and DTDs on DocumentBuilderFactory).
  • Code review checklists that explicitly call out XML parsing as a risk area and require verification of secure parser configuration for all XML-handling components.
  • Security tests or fuzzing that exercise XML parsers with crafted payloads to observe unintended outbound requests or excessive resource consumption.
  • Runtime monitoring and logging of unexpected outbound HTTP/HTTPS or other protocol requests from metadata parsing services, especially at the time files are ingested.
  • Use of automated security scanning tools integrated into CI/CD that detect unsafe XML parsing patterns in Java and related ecosystems.

Sources

SourceLink
docs.openmicroscopy.orgdocs.openmicroscopy.org/bio-formats/
github.comgithub.com/ome/bioformats/security/advisories/GHSA-x9vc-qh97-8gjp
seclists.orgseclists.org/fulldisclosure/2026/Jan/6
vulncheck.comvulncheck.com/advisories/bio-formats-xxe-in-leica-xlef-metadata-parser

Frequently asked

questions

It can be, if an attacker can upload or otherwise provide Leica XML-based metadata to a service that processes files using Bio-Formats. In such deployments, exploitation can occur remotely via crafted input files.

The attacker needs the ability to influence or supply metadata files that Bio-Formats will parse—commonly through file upload, shared storage, or automated ingestion mechanisms. No direct shell or API access to the host is required beyond that capability.

The safest pattern is to enforce secure XML parser configuration everywhere: disable external entities, external DTDs, and external resource loading by default, and process XML in a context with restricted privileges and minimal filesystem/network access.

Establish standard, hardened XML parsing utilities for your codebase, require their use through code review and automated checks, and treat all data formats that embed XML as untrusted input. Combine this with least-privilege runtime configurations and network egress controls for components that handle external files.

Find out what's already
exploitable in your codebase.