Poisoned Pipeline / Techniques / T0265
Chain decoded request structs into a callback the server already trusts
A decoder that promises not to execute anything can still hand the
attacker a choice of code paths. In languages with open extension
points, a decoded value names its own class, and the error paths that
follow will dispatch to that class's implementations: a serialiser, an
error reporter or an inspect-style debugging protocol. Each hop needs
only one unchecked field, and each one can name the next.
hex.pm's custom parser for application/vnd.hex+erlang decoded request
bodies with Plug.Crypto.non_executable_binary_to_term/2. The function
rejected functions and new atoms but not maps, and an Elixir struct is
a map with a __struct__ key. On 23 November 2026 an unauthenticated
POST carrying a crafted struct reached the endpoint before routing and
authentication. Plug.MethodOverride called fetch/2 on the module
the struct named; the resulting UndefinedFunctionError sent the
request through inspect implementations chosen by the attacker
(Ecto.Query.DynamicExpr, whose binding field was enumerated without
a list check, then DBConnection.Stream, whose :log option was
taken from the request as a {module, function, args} tuple). The
error path applied that tuple with the log entry prepended, which ran
OS commands as the BEAM user on six web servers for thirteen minutes.
The chain uses only code the server already loads, so no new module is
installed and no signature is forged. The fix was to reject any term
containing a map with a __struct__ key (hexpm commit 379b0a2); the
same struct-in-input class was fixed in Ash 3.38.0 under
CVE-2026-124283.
Where this idea came from
From the hex.pm incident of 23 November 2026 (CVE-2026-129514), where a struct in an unauthenticated Erlang-term body was dispatched through Plug.MethodOverride, Ecto.Query.DynamicExpr's Inspect implementation and DBConnection.Stream's :log option into OS command execution on six servers. Distinct from T0237 (a dangerous call resolved by name) — every hop here is a legitimate protocol implementation reached with an attacker-chosen module name.
Mitigations
None linked yet.
Detections
None linked yet.