Join our Newsletter — 33% off our NHI Course
Home› FAQ› Cyber Security› What do application teams get wrong about unsafe…
Cyber Security

What do application teams get wrong about unsafe deserialisation in frameworks?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 12, 2026 Domain: Cyber Security

They often treat it as a narrow parsing defect instead of a mechanism that can reshape runtime objects and trigger behaviour. The mistake is assuming the parser is neutral. In reality, any decoder that expands properties, reconstructs complex objects, or hooks into callbacks can become the entry point for code execution.

How unsafe deserialisation goes wrong in practice

Application teams most often miss that deserialisation is not just a data-format step. It is a trust boundary where incoming bytes can be turned into live objects, and those objects may carry construction logic, side effects, or gadget references that alter runtime behaviour. Once you allow polymorphic binding, automatic type resolution, or callback execution, the decoder itself becomes part of the attack surface.

The practical failure mode is treating the framework as a neutral translator. In reality, the risk rises when the framework can instantiate unexpected classes, populate nested properties, or invoke methods during object hydration. That is why unsafe deserialisation sits close to code execution, object injection, and broader application logic abuse rather than simple parsing bugs.

In web and API stacks, the issue is especially visible where request bodies, session state, cache entries, or inter-service messages are deserialised automatically. The OWASP ASVS and OWASP Web Security Testing Guide both reinforce the idea that input handling must be explicit, constrained, and verified, because the dangerous part is not only malformed data, but untrusted data that becomes executable structure.

Why the parser is not the only problem

Unsafe deserialisation is dangerous because many frameworks do more than reconstruct a plain object graph. They may honour type metadata, resolve subclasses, apply converters, or trigger lifecycle hooks that were never intended to run on attacker-controlled input. If the application assumes “deserialise first, validate later,” the validation step may arrive too late to prevent object creation side effects.

This is why gadget chains matter. An attacker does not need a direct “run code” primitive if the framework can stitch together a sequence of ordinary library behaviours that ends in file access, command execution, request forgery, or privilege-relevant state changes. The security problem is therefore the combination of framework features, reachable classes, and trusted execution context, not the serializer alone.

That same mechanism explains why this issue often survives code review. The code may look like routine data handling, but the deserialiser is implicitly making decisions about object shape, class selection, and object initialisation. In mature appsec testing, this is one reason teams compare their implementation to the controls and test cases in OWASP Top 10 and use NIST SP 800-53 Rev 5 Security and Privacy Controls to anchor secure configuration, input handling, and system integrity expectations.

What teams should change in design and review

Teams should start by asking whether deserialisation is truly required at all. If a simpler format or explicit schema mapping will do, that is usually the safer choice. If deserialisation is unavoidable, the decoder should be tightly constrained to known types, disallowed from implicit polymorphism unless there is a strong reason, and separated from code paths that can reach privileged functionality.

Review should focus on the full object lifecycle, not just the parser call site. That means checking whether a payload can influence constructors, setters, annotations, custom binders, adapters, event hooks, or downstream business objects in ways that are not obvious from the immediate call. The question is not “does the parser reject bad syntax,” but “can untrusted input shape runtime behaviour before the application regains control?”

In practice, the safest implementations pair strict allowlisting with explicit type binding and aggressive minimisation of what the deserialiser is allowed to create. When the application must accept objects from external sources, teams should treat the deserialisation boundary as a high-risk trust boundary and test it like one, including error handling, fallback logic, and any libraries that extend the framework’s default object model.

Risk and Threat Considerations

Unsafe deserialisation becomes high impact when the target framework can materialise attacker-influenced objects in a privileged runtime. The main exposure is not malformed input, it is object creation with behaviours that the application did not intend to expose to untrusted data.

Failure mechanism: A decoder accepts attacker-controlled type information, expands nested properties, or invokes lifecycle callbacks, allowing a crafted payload to reach dangerous library behaviour or execution paths.

Impact: Outcomes can include code execution, logic abuse, denial of service, data access, or movement into higher-privilege application functions, especially where deserialisation occurs before validation or isolation.

Standards & Framework Alignment

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

OWASP API Security Top 10 addresses the attack and risk surface, while OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV2 — Validation and Business LogicUnsafe deserialisation turns untrusted input into runtime objects.
V15 — Secure Coding and ArchitectureFramework design choices determine whether deserialisation can trigger behaviour.
Recommendation — Constrain object binding and validate inputs before any business logic runs. Prefer explicit type mapping and remove unsafe automatic object construction.
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationDeserialisation is an input-handling boundary that must reject unsafe structure.
SI-7 — Software, Firmware, and Information IntegrityUnchecked object reconstruction can subvert runtime integrity.
Recommendation — Validate and constrain incoming data before it reaches object creation paths. Protect runtime integrity by preventing untrusted data from altering execution flow.
OWASP API Security Top 10API8 — Security MisconfigurationUnsafe framework defaults often expose deserialisation and type-resolution risks.
Recommendation — Disable dangerous defaults and lock down deserialisation configuration.

Practitioner Guidance

What to prioritise: Identify every deserialisation boundary in the application, then separate harmless data binding from any path that can instantiate rich objects or invoke callbacks. Prioritise the flows that accept data from users, other services, queues, or stored blobs that may be attacker-influenced.

What to verify: Verify that the framework cannot resolve arbitrary types, that allowlists are enforced at the binding layer, and that no deserialised object can directly reach privileged operations without a subsequent explicit decision point. Also verify what happens on parse failure, because unsafe fallback handling can be just as dangerous as successful parsing.

Practitioner takeaway: The safest mental model is that deserialisation is a code-bearing trust boundary, not a formatting convenience, so the control objective is to prevent untrusted input from creating unexpected objects or behaviours in the first place.

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 October 12, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org