# Insecure Deserialization

Serialization is the process of converting an in-memory data structure into a stream of binary data, typically for the purpose of sending it across a network socket. On the receiving end of this, Deserialization is the process in which that data stream is rebuilt into a data structure.

Vulnerabilities arise on the deserialization end for some server-side languages like Ruby on Rails. The serialization library for ROR allows a newly created data structure to execute code. This feature, if not mitigated, will allow an attacker to inject commands into the data section of a request if the file is to be deserialized.&#x20;

{% hint style="danger" %}
The proper mitigation for such attacks is to ensure any serialization library in use has flags set to disallow code execution. Then also to map out all serialization libraries in use in your organization and to monitor the threat advisory boards for new vulnerabilities against those libraries.&#x20;
{% endhint %}

{% hint style="success" %}
Coming Soon!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.hackbook.io/web-application-hacking/web-techniques/insecure-deserialization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
