Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Erlang External Term Format
Cyber Security

Erlang External Term Format

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Cyber Security

Erlang External Term Format is the binary encoding used to serialise Erlang terms for storage or transport. It represents atoms, numbers, lists, maps, tuples and PIDs in a structured byte stream, and decoders must not trust untrusted input because malformed data can trigger unsafe deserialisation or resource exhaustion.

What the format is for

Erlang External Term Format is the wire and storage representation Erlang uses to move structured terms between processes, nodes, and persistent systems. Its design preserves native data types such as atoms, tuples, maps, and lists, which makes it efficient for Erlang ecosystems but also means receivers must treat every incoming blob as untrusted until it has been validated.

Because the format is intended to be decoded automatically, the security boundary sits at the parser. If a decoder assumes the payload is well formed, malformed or oversized input can push the runtime into unsafe deserialisation paths, excessive allocation, or other failure modes that are easy to miss in testing but expensive in production.

How the encoding works

The format is a binary serialisation scheme, not a text convention, so the reader needs matching encoder and decoder logic rather than manual inspection. It represents Erlang values as tagged binary structures, which lets the receiver reconstruct rich language objects without guessing their shape from a generic encoding such as JSON or XML.

That expressiveness is the point of the format, but it also creates coupling to the runtime’s exact term model. If a producer emits data the consumer does not expect, the decoder may still try to interpret it as a legitimate term, which is why strict bounds, type checks, and schema expectations matter even when the data originates inside the same application estate.

Why untrusted input is dangerous

The main danger is that deserialisation can become a trust boundary violation. A malicious payload can exploit parser assumptions, trigger large memory allocations, or force the application to spend disproportionate CPU and memory processing a crafted structure. In practice, the risk is not just corrupted output, it is instability, denial of service, or unsafe object reconstruction.

This is especially important when the format is used across services, queues, or administrative interfaces, because the receiver may accept data from places that are not subject to the same trust or validation rules as local code. The safest mental model is that any external term stream can be attacker-controlled unless it has been authenticated, bounded, and validated before decoding.

Safe use in applications

Using this format safely means treating decoding as a security-sensitive operation, not a convenience function. Applications should define exactly which term shapes are acceptable, reject unexpected structures early, and put hard limits on size, depth, and resource consumption before the full payload is materialised.

It also helps to narrow where the format is accepted. Many systems can avoid exposing a general-purpose decoder at external edges by using a safer higher-level protocol for untrusted clients, while keeping Erlang term exchange for controlled internal communication. Where the format is unavoidable, the decoder should run with defensive defaults and clear failure handling so malformed input cannot cascade into broader service failure.

Security review and operational control points

From a security review perspective, the key questions are where the bytes come from, who can send them, and what happens if the decoder rejects or mishandles them. The format itself is neutral, but the application’s exposure depends on whether it is accepting local, trusted traffic or remote, adversary-controlled input.

Operationally, teams should monitor decoding failures, allocation spikes, and any path that turns external binary data into executable logic or privileged state changes. That is the point at which a serialisation bug becomes a broader application security issue rather than just a data-format problem.

Risk and Threat Considerations

The security risk is not the existence of the format, it is the possibility that a decoder will process attacker-supplied bytes as if they were already trustworthy Erlang terms. That can produce denial of service, parser crashes, resource exhaustion, or unsafe deserialisation behaviour if the application accepts arbitrary input paths.

Failure mechanism: A crafted payload abuses parser assumptions, oversized structures, or recursion and allocation behaviour during decoding, which can exhaust memory or drive the runtime into invalid state transitions.

Impact: The result can be service interruption, application instability, or a broader compromise path if decoded terms influence privileged logic, internal messages, or subsequent deserialisation steps.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5, OWASP ASVS and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationCovers validating untrusted serialized input before parsing or processing.
SI-4 — System MonitoringSupports detecting abnormal decoder failures or resource spikes from hostile payloads.
Recommendation — Validate external term payloads before decoding and reject malformed or oversized inputs. Monitor decode failures and resource anomalies to spot abuse of term parsing paths.
ISO/IEC 27001:2022A.8.24 — Use of cryptographyRelates indirectly where serialized terms need integrity protection in transit or at rest.
Recommendation — Protect serialized term transport with integrity controls where untrusted modification is a concern.
OWASP ASVSV5 — File HandlingCovers safe handling of binary input blobs and parser robustness before content is trusted.
Recommendation — Apply strict size and structure checks before accepting binary payloads for decoding.
CIS Controls v8CIS-8 — Audit Log ManagementSupports logging and review of decoding errors and suspicious input patterns.
Recommendation — Log and review repeated deserialization failures to detect probing or abuse.

Practitioner Guidance

Why practitioners should care: The format is efficient for trusted Erlang systems, but that same efficiency becomes a liability when it is exposed to untrusted senders. The practical question is not whether the format works, but whether every decode point is protected by input validation, size limits, and a clear trust boundary.

What to watch for: Review any endpoint, queue, or inter-service channel that accepts external term data and confirm that malformed inputs fail safely. If the data can arrive from outside a tightly controlled Erlang trust domain, treat the decoder as a high-risk parsing surface rather than a routine utility.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org