Insecure Deserialization → RCE
文章讨论了不安全反序列化的风险及其可能导致的远程代码执行(RCE)。通过序列化将对象转换为存储或传输格式(如Python的pickle),攻击者可篡改序列化数据(如修改角色),导致权限提升或系统漏洞。 2025-12-30 08:44:59 Author: infosecwriteups.com(查看原文) 阅读量:7 收藏

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--bug_bounty
如有侵权请联系:admin#unsafe.sh