Automating Security Research: AI Engine Exploits Complex Blind Code Injection
The 'expression' parameter of Titiler's point endpoint was evaluated by a Python expression engine, allowing an attacker to walk the object hierarchy and reach built-in functions. This could let an attacker run operating system commands on the server.
blog.ostorlab.co
Published on blog.ostorlab.co
Traditional vulnerability exploitation can consume days or even weeks of manual testing before achieving successful exploitation. Witnessing these same bugs being exploited within minutes by specialized AI systems is deeply disconcerting, particularly when these systems demonstrate different exploitation techniques…
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 endpoint passed user-supplied 'expression' input into a Python expression evaluator without restricting which objects and functions the expression could reach.
Impact
An attacker could potentially execute arbitrary commands on the server hosting the application.
What the attacker needed
Network access to the endpoint; a valid image url parameter
The fix
The expression input should be evaluated in a restricted sandbox that blocks access to the object hierarchy and built-in functions, or replaced with a safe expression parser.
How it was found
- Send a benign expression such as a simple multiplication and observe whether the server evaluates it.
- Send an expression that triggers an error to learn the feedback channel.
- Walk from a band variable to its class and base object to list subclasses.
- Filter subclasses to find one whose globals expose built-in functions.
- Use the reached built-ins to attempt reading a system file or running a command.
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.
The application took a piece of text from the URL and treated it as a Python expression to calculate, instead of just a value. Because Python objects can be walked from a simple value up to powerful built-in functions, an attacker could reach code that runs commands on the server. This is called code injection.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.