Insecure Deserialization → RCE
文章讨论了不安全反序列化的风险及其可能导致远程代码执行的情况。通过示例展示了如何通过篡改序列化数据(如将用户角色从普通用户改为管理员)实现权限提升。 2025-12-30 08:44:59 Author: infosecwriteups.com(查看原文) 阅读量:4 收藏

In this blog, we will discuss insecure deserialization and how we can achieve RCE

Raj Prasad Kuiri

Press enter or click to view image in full size

First, what is “serialization”?

Serialization = converting an object into a format that can be:

  • > Stored
  • > Sent over a network
  • > Saved in cookies or sessions
Python → pickle

Java → Serializable

PHP → serialize()

.NET → BinaryFormatter

Example of Serialization data

Python (pickle) – Binary → Base64 (very common)

Original object

{"username": "alex", "role": "user"}

Serialized (pickle → Base64)

gASVJAAAAAAAAAB9lCiMBHVzZXKUjAVhZG1pbpSMBHJvbGWUjAR1c2VylHUu

This is stored in the cookies, and the reverse process is called deserialization.

How does insecure deserialization occur?

Serialization data
{"username": "alex", "role": "user"}

Modified Serialization data by attacker which is now insecure
{"username": "alex", "role": "admin"}

insecure deserialization data
gASVJwAAAAAAAAB9lCiMBHVzZXKUjANyYWqUjARyb2xllIwEdXNlcpR1Lg==

Which leads to privilage esclation from normaluser -> admin


文章来源: https://infosecwriteups.com/insecure-deserialization-rce-b457eed0e2f9?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh