Insecure Deserialization is an attack where a manipulated object is injected into the context of the web application.
Insecure Deserialization is an attack where a manipulated object is injected into the context of the web application. If the application is vulnerable, the object is deserialized and executed, which can result in SQL Injection, Path Traversal, Application Denial of Service and Remote Code Execution.
In order to protect your web application from this type of vulnerability, you should never pass a serialized object, which can be manipulated by the user, to the deserialize function. Instead of unserialize you could use a secure data interchange like JSON if you need to pass serialized data between the user and the web application.
As an Example how a serialized PHP object looks like, see the code block below:
The insecure deserialization vulnerability could be triggered if a untrusted user is able to manipulate the object and can send it directly to the PHP unserialized function.