Apache SCXML Remote Code Execution
The Apache Commons SCXML reader loaded an SCXML document from any URL without validating the resource, so a remote file could be fetched and parsed. Because the engine evaluates Java Expression Language inside the document, an attacker could get code executed on the server.
State Chart XML (SCXML) is currently a Working Draft specification published by the World Wide Web Consortium (W3C). SCXML provides a generic state-machine based execution environment based on Harel State Tables.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the reader accepted an arbitrary URL as the SCXML source and then evaluated Java Expression Language contained in the fetched document without restricting either the source or the expressions.
Impact
An attacker who can supply the SCXML path could have arbitrary Java code executed on the server hosting the application.
What the attacker needed
Attacker-controlled SCXML file; application passes user input as scxmlPath
How it was found
- Pass a URL pointing to an attacker-controlled SCXML file as the scxmlPath parameter to the read method.
- The readInternal method resolves the URL and the getReader method opens an input stream from that remote resource.
- The fetched XML stream is returned and passed to setStateMachine, which initialises the state machine instance.
- The Java Expression Language inside the XML is executed by the getEvaluator method.
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 write-up has not been written yet. The Original tab links to the source.
SCXML is a way to describe a state machine in an XML file, and this Java library can load such a file from a web address. The library did not check where the file came from, and it runs small Java expressions written inside that file. So someone who controls the file's address can make the server run their code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.