GHSL-2025-035_GHSL-2025-037: Command injection and Remote Code Execution (RCE) in MetaSpore
MetaSpore's recommendation service has a command injection in model downloading that lets an attacker overwrite arbitrary files and steal AWS tokens, plus exposed Spring Boot Actuator endpoints and an unauthenticated Consul instance that can lead to remote code execution.
Originally disclosed on GitHub Security Lab
MetaSpore’s recommendation service contains several high impact security vulnerabilities. A command injection vulnerability in model downloading allows to overwrite arbitrary local files and to steal AWS tokens.
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
Likely the application concatenates untrusted input into a shell command and exposes sensitive management endpoints and services without authentication.
Impact
An attacker could overwrite files, steal AWS tokens, read sensitive memory and configuration, and potentially achieve remote code execution via Consul.
What the attacker needed
Network access to the service; no authentication required
How it was found
- Send a POST request to /invocations/ with operator loadmodel and a crafted dirPath containing extra AWS CLI options.
- The server runs the aws s3 sync command with the injected options, redirecting the request to an external endpoint.
- Access the exposed Spring Actuator heapdump endpoint without credentials to download a memory snapshot.
- Send an unauthenticated PUT request to the Consul key/value store to set a malicious spring.application.name property.
- Restart the recommendation service so it fetches the property from Consul and evaluates it as a SpEL expression, executing 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.
The service builds a shell command from user input without cleaning it, so an attacker can add extra options to redirect the download and write files anywhere. Also, some monitoring endpoints and a configuration service are left open without a password, letting anyone read secrets or even run code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.