Michael Lubas, 2026-08-03
Security firm Safeguard.sh published an Elixir guide last month (July 2026) that tells developers to defend against untrusted deserialization with the following:
# SAFE -- refuse unsafe constructs, and never create new atoms
term = :erlang.binary_to_term(untrusted, [:safe])
That is a remote code execution (RCE) vector, labeled SAFE, in an AI generated SEO spam post titled “Elixir and Phoenix Security Best Practices: BEAM Footguns and the Hex Supply Chain” from security startup Safeguard.sh. Archived August 3, 2026
Author Disclosure: I am the founder of Paraxial.io, a cybersecurity company focused on the Elixir ecosystem.
When a human or AI Googles “Elixir Phoenix Security Best Practices 2026”, the above article is the first result, before the official documentation:
You don’t need Elixir experience or deep security knowledge to understand this article, just enough programming experience to remember:
Remote code execution means an attacker sends data to your web application and your server runs their code. The $425 million Equifax breach was an RCE in an Apache Struts application. Remember:
Attacker HTTP request -> vulnerable web server
Attacker now has a shell on your web server
It’s not quite SSH (do some research on RCE reverse shells if you want the details), but it is the worst case scenario in terms of web application vulnerabilities.
The Phoenix framework’s official documentation warns against this exact mistake, because I wrote it.
The Plug.Crypto documentation is where you find the safe version. And in August 2020, Peter Stöckli of Alphabot Security found this exact pattern in Paginator, an Elixir library, and it became CVE-2020-15150. A flight booking startup was running it in production on a public API.
I’ll inline my March 2024 Elixir Forum comment here:
For those coming from google,
NOT SAFE: :erlang.binary_to_term(user_input, [:safe])
SAFE: Plug.Crypto.non_executable_binary_to_term(user_input, [:safe])
This is extremely important if your application passes user input to binary_to_term. The $425 million Equifax breach happened due to an Apache Struts web app that was vulnerable to RCE. Java is to Struts what Ruby is to Rails and Elixir is to Phoenix.
Article with some more details about how this happened in the paginator library: Elixir/Phoenix Security: Remote Code Execution and Serialisation (A 2023 article where I go into deep detail on how the exploit works)
The short version: :safe blocks the creation of new atoms. It does not block anonymous functions. And in Elixir, the Enumerable protocol is implemented for functions of arity 2, which means an attacker’s function does not need to be invoked by your code. It only needs to reach Enum. A developer who believes they are decoding a list of user preferences, and calls Enum.map/2 on the result, has introduced a remote code execution (RCE) vulnerability.
non_executable_binary_to_term/2 stops the code execution (which is the most important part). [:safe] stops the atom exhaustion, which is a DoS.
One section of the AI SEO spam article is accurate: the coverage of CVE-2025-32433, the critical Erlang/OTP SSH vulnerability from April 2025. The patched OTP versions are correct. I know this is true because I wrote a guide for Elixir developers that became the canonical community document: What the Critical Erlang SSH Vulnerability Means for Elixir Developers.
Most AI SEO spam is at least approximately correct. Incomplete, padded, not written for a human, but not actively dangerous. The Safeguard post is wrong in a way that is comically irresponsible, it would fit into a satire about the negative externalities of AI, except it ranks as the top 2026 result and will likely be found and implemented by a human or AI coder. It is one of several thousand security articles on their blog, and the only one I can confirm has been read by someone who knows the subject. Major search providers, such as Google, do take steps to penalize AI generated SEO spam, especially dangerously misleading content, and hopefully by the time you read this article the results will be gone. In the meantime ensure you (or your AI agents) do not use Safeguard.sh for information on security risks in any context.
Paraxial.io is the only security platform built specifically for Elixir and Phoenix, helping developers and agents ship secure applications. Contact us today to get started.
Subscribe to stay up to date on new posts.