GHSL-2023-015: Unsafe deserialization in Apache Submarine - CVE-2023-46302
Apache Submarine used SnakeYaml's default constructor to parse user-supplied YAML, allowing unsafe deserialization. An attacker could send a crafted YAML request to trigger remote code execution.
Apache Submarine is vulnerable to unsafe deserialization due to the use of SnakeYaml’s default constructor when parsing user-supplied data.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The YAML parser was used with its default constructor, which allows instantiation of arbitrary classes from the input, rather than restricting to safe types.
Impact
This issue may lead to Remote Code Execution.
What the attacker needed
Network access to the Submarine API; attacker-controlled server hosting a JAR
The fix
The fix commit was pushed, but the text does not describe the fix details.
How it was found
- Send an HTTP POST request to the serve endpoint with Content-Type application/yaml.
- Include a YAML payload that specifies a subtype with a ScriptEngineManager and a URLClassLoader pointing to an attacker-controlled JAR.
- The server deserializes the YAML, triggering the ScriptEngineManager constructor, which loads the remote JAR and executes code.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program reads data from a user, it should not automatically create objects of any type the user specifies. Here, the YAML parser was allowed to create arbitrary Java objects, and some of those objects can run code from a remote server. This let an attacker run their own commands on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.