GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — XMLUnit2 has an RCE vulnerability caused by XSLT · Issue #264 · xmlunit/xmlunit

XMLUnit2 has an RCE vulnerability caused by XSLT #264

New issue
Copy link
New issue
Copy link
Closed
Closed
XMLUnit2 has an RCE vulnerability caused by XSLT#264
Copy link
Labels
coreenhancement
Milestone
2.10.0

Description

@c1gar
c1gar
opened on Mar 11, 2024
Issue body actions

pom.xml

<dependency>
			<groupId>org.xmlunit</groupId>
			<artifactId>xmlunit-core</artifactId>
			<version>2.9.1</version>
</dependency>

poc

import org.xmlunit.transform.Transformation;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

public class xmlunit_test {
    public static void main(String[] args) {
        Transformation transformation = new Transformation();
        Source xml = new StreamSource("1.xml");;
        transformation.setSource(xml);
        Source xsl = new StreamSource("1.xsl");;
        transformation.setStylesheet(xsl);
        Result result = new StreamResult("output.xml");;
        transformation.transformTo(result);
    }
}

217401710127739_ pic

There is no function for setting security parameters in org.xmlunit.transform.Transformation, and the default security parameters do not include defense against XSLT vulnerabilities.
And I would like to emphasize that XSLT vulnerabilities and XXE vulnerabilities are completely different types of vulnerabilities. XSLT vulnerabilities belong to CWE-94 type, while XXE vulnerabilities belong to CWE-611. For more details, please refer to [CVE-2017-7465](https://nvd.nist.gov/vuln/detail/CVE-2017-7465).

Activity

  1. bodewig
    added a commit that references this issue on Apr 28, 2024

    disable XSLT extension functions by default, add more configurers

    b81d48b
  2. bodewig commented on Apr 28, 2024

    @bodewig
    bodewig
    on Apr 28, 2024
    Member
    More actions

    with b81d48b I've disabled extension functions by default.

    Even with 2.9.1 and earlier it is possible to disable extension functions by passing in a properly configured TransformerFactory to the Transaformation class.

    I still need a way to do the same to XPathFactory and will look into it.

  3. bodewig
    added
    enhancement
    core
    on Apr 28, 2024
  4. bodewig
    added this to the 2.10.0 milestone on Apr 28, 2024
  5. bodewig
    added a commit that references this issue on Apr 28, 2024

    record extension function changes

    dcaafe9
  6. c1gar commented on Apr 28, 2024

    @c1gar
    c1gar
    on Apr 28, 2024
    Author
    More actions

    @bodewig I have applied for a CVE number for this. Would you mind disclosing it? The CVE number is CVE-2024-31573.

  7. bodewig commented on Apr 28, 2024

    @bodewig
    bodewig
    on Apr 28, 2024
    Member
    More actions

    I honestly don't believe this is worth a CVE as people who need to disable extension functions have always been able to do so. If you insist on the CVE it can certainly be "disclosed" - it's bee public knowledge for weeks anyway.

    What is your preferred way of disclosing it? I have zero experience with publishing CVEs around github.

  8. c1gar commented on Apr 29, 2024

    @c1gar
    c1gar
    on Apr 29, 2024
    Author
    More actions

    @bodewig I would like to proceed with disclosing this CVE. My preferred platform for disclosure is GitHub. If that is not feasible, we can disclose it in the way you are most familiar with. Thank you.

  9. bodewig commented on Apr 29, 2024

    @bodewig
    bodewig
    on Apr 29, 2024
    Member
    More actions

    @c1gar I will draft a security advisory later today, not sure I can share its content with you in a reasonable way - maybe you could drop me an email (my primary mail address is [email protected] )

  10. bodewig commented on May 1, 2024

    @bodewig
    bodewig
    on May 1, 2024
    Member
    More actions

    GHSA-chfm-68vv-pvw5

    Reacted by Sylwester Lachiewicz
  11. bodewig
    closed this as completedon May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      • 2.10.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.