Repository navigation
v3.0.1
v3.0.1 — reflected names only the shell it proved
A single patch release, and it narrows what RCEKit will call executed.
What was wrong
reflected built one probe shape whose expected value was the arithmetic result
and nothing else: a bare expr a + b, sent at --probe-depth full and matched
digit-fenced. Anything that evaluates arithmetic satisfied it — and an
expression evaluator is not a shell.
Groovy is the case that showed it. On a plain Gremlin endpoint it reads
expr 548286 + 675041 as the command expression expr(548286 + 675041):
it computes the sum, fails to resolve the method, and echoes the result in its
error. The run then printed this, against a target where no command ran:
[detect] EXECUTED (3):
[reflected/unix/raw] ; expr 548286 + 675041
(target computed '1223327' (random operands, absent from control))
The tier was never wrong. The target really did compute a value reflection
cannot forge, and --methods eval reaches executed on such an endpoint
honestly. What was wrong is the class: a finding filed under
reflected/<environment> asserts that a shell of that family ran the input. In
a client report, a correct proof under the wrong class is worse than a miss.
What changed
The shape is retired. Every remaining reflected probe requires the target to
place RCEKit's random tags around the value it computed — which an expression
evaluator handed the payload cannot do.
Measured on Apache HugeGraph 1.2.0 with every shape mapped
(--confirm-depth every):
| Target | tag-bracketed shapes | the retired shape |
|---|---|---|
| the plain Gremlin endpoint — Groovy | 0 of 36 | 3 of 6 |
the same build's ProcessBuilder body — a real sh -c |
4 | 1 |
So the shape was never the only proof where a shell exists. A controlled
before/after against one executing sink: 1158 probes → 1114, with
executed=32 both times. 44 fewer requests per injection point, zero
confirmations lost.
It was removed rather than repaired because expr has no portable string
concatenation: bracketing its result in a tag means reintroducing the $( or
the echo keyword the shape existed to avoid. Reading Groovy's error text was
considered and rejected — deciding a verdict from response content is not a
pattern this project will take on.
What this costs
A sink that filters $(, backticks and awk at once is now out of
reflected's reach. It remains reachable through time, oob and file, and
docs/reference.md says so.
--probe-depth quick never sent the shape, so a quick run is unchanged.
One second-order effect to know about if you use --max-length. The retired
shape was also the shortest probe reflected built, so the shortest is now 41
characters rather than about 20. A --max-length below 41 leaves the method no
probe at all. That fails loudly rather than quietly:
[detect] sent 0 probes (0 result(s)): none
[!] No probes were built, so NOTHING WAS TESTED — this is not a negative result.
[!] Every probe was longer than --max-length 40.
How it is held
Two guards sweep every environment, context and probe depth: no probe's
expected value may be the arithmetic alone, and none may match digit-fenced. A
new benchmark case, hugegraph-gremlin-reflected-class, runs the same request
against the same endpoint as the eval case and differs only in the method,
requiring reflected to come back negative.
All three were run against the retired shape put back, and all three fail on it
— the bench control reporting executed=30.
python tests/bench/runner.py --all is 10/10 green in 55m48s at 3.0.1.
That run is the gate that matters here: the risk this change carries is a false
negative on a genuine shell, and none appeared — Webmin's reflected and
file, Struts2's eval, OpenTSDB's oob, Tomcat's write and HugeGraph's
ProcessBuilder body all still reach executed.
Unit suite: 934 tests, offline, no dependencies.
Upgrading
pipx upgrade rcekit # or: pip install -U rcekitNothing to change in how you invoke it. If a past run reported executed from
reflected against an endpoint you believed was an expression evaluator rather
than a shell, that finding is worth re-running — --methods eval is the one
that answers for it.