Java vulnerabilities
14 real-world CVEs in Java code. Each one is a short hands-on exercise in Hexret: find the vulnerable line, follow the exploit and learn the fix.
- CVE-2024-4956high 7.52024
Nexus Repository 3 path traversal
An unauthenticated request path is used to fetch a file with no canonicalization, so stacked ../ sequences read arbitrary files off the host.
- CVE-2024-23897critical 9.82024
Jenkins CLI @-file argument read
A command-line argument parser expands any @-prefixed token into the contents of the named file, so a remote CLI argument turns into an arbitrary file read on the server.
- CVE-2023-0669high 7.22023
GoAnywhere MFT license-servlet deserialization RCE
A license-response servlet decodes and decrypts a request parameter, then deserializes the result with ObjectInputStream, so an attacker-supplied object graph executes code during readObject.
- CVE-2022-1471critical 9.82022
SnakeYAML unsafe deserialization
The default YAML parser instantiates whatever Java type a document names, so parsing untrusted YAML can construct dangerous objects.
- CVE-2022-42889critical 9.82022
Text4Shell: default script lookup in string interpolation
A string-interpolation helper enables every built-in lookup by default, including one that evaluates scripts, so untrusted input containing an interpolation reference runs code.
- CVE-2022-22972critical 9.82022
VMware Workspace ONE Access host-header authentication bypass
The local-login handler builds its credential-check URL from the client-supplied Host header and treats a 200 response as proof the password is valid, so an attacker who points the Host at a server they control logs in as any local user.
- CVE-2022-0540critical 9.82022
Jira Seraph authentication bypass (namespace roles-required)
An authorization filter keys its access decision on the raw request path and treats a lookup miss as public, so a request whose path is normalized differently by the action dispatcher slips past the check and runs a protected action unauthenticated.
- CVE-2022-22963critical 9.82022
Spring Cloud Function header-supplied SpEL injection
The function router evaluated a routing expression taken from an HTTP-derived message header with Spring's powerful standard expression context, allowing untrusted input to invoke Java types and methods instead of merely selecting a function.
- CVE-2021-44228critical 10.02021
Log4Shell: JNDI lookup in logged input (CVE-2021-44228)
A string logged by Log4j with message lookups enabled can carry a JNDI reference, making the logger resolve an attacker-controlled name through JNDI and load a remote class. Nicknamed Log4Shell (Log4j plus shell), it scored a perfect 10.0, was reported by Chen Zhaojun of Alibaba Cloud, and became one of the most widely exploited vulnerabilities ever.
- CVE-2020-1957critical 9.82020
Apache Shiro path-confusion authentication bypass
A security filter derives its match path from the raw request URI, which the app's router resolves differently, so a crafted path skips the auth filter yet still reaches the protected controller.
- CVE-2017-7525critical 9.82018
jackson-databind polymorphic deserialization RCE (default typing)
With default typing enabled, a JSON document names the Java class to instantiate, so a crafted type id reaches a class whose deserialization performs a JNDI lookup and loads remote code.
- CVE-2017-9805high 8.12017
Apache Struts REST plugin XStream deserialization RCE (S2-052)
The REST plugin deserializes an XML request body with a default XStream instance that has no type allowlist, so a crafted gadget-chain document instantiates arbitrary classes and runs commands on the server.
- CVE-2017-5638critical 9.82017
Apache Struts Jakarta parser OGNL injection (S2-045)
An invalid Content-Type on a multipart upload makes the Jakarta parser throw an exception whose message carries the raw header, and Struts passes that message to an error formatter that evaluates OGNL, so a crafted expression in the header runs commands on the server.
- CVE-2015-4852critical 9.82015
WebLogic T3 Java deserialization (Commons Collections gadget)
A raw serialized Java object sent to the T3 listener is deserialized without any class filtering, so a Commons Collections transformer chain drives reflective method calls into Runtime.exec: unauthenticated remote code execution.