May 03, 2019

What is the Serialization



직렬화(Serialization)

The process of converting data of a specific structure, such as an object, into data of a form that can be restored later.

객체 등 특정 구조의 데이터를, 이후 복원할 수 있는 형태의 데이터로 전환하는 과정.

Deserialization is the opposite. The process of restoring serialized data.

역직렬화(Deserialization)는 그 반대. 직렬화된 데이터를 복원하는 과정.

Like the name serialization, usually serialized data is represented by a single line regardless of the length.

직렬화라는 이름에 걸맞게, 보통 직렬화된 데이터는 아무리 길어도 1줄로 표현된다.

마셜링(Marshaling) = 직렬화(Serialization)
디마셜링(Demarshaling) = 역직렬화(Deserialization)

Serialization, however, does not generate data in an existing way, so security flaws are identified.

그러나 직렬화는 기존의 방식으로 데이터를 생성하는 것이 아니기에, 이로 인한 보안상의 결함이 식별되기도 한다.

The reason for using serialization is to store or transfer the data outside the system.

직렬화를 하는 이유는 해당 데이터를 시스템 외부에 저장하거나 전송하기 위해서이다.

Deserialization, on the other hand, is used to load data that is stored or transmitted outside the system and then used after recovery.

역직렬화는 이와는 반대로, 시스템 외부에 저장되거나 전송된 데이터를 받아와 복구 후 사용하기 위해서다.

Flaws can occur with the trusted data within the system. If untrusted data is inflowed, the probability of occurrence of flaws increases.

신뢰할 수 있는 시스템 내부의 데이터만 가지고도 결함은 발생하기 마련인데, 신뢰할 수 없는 데이터가 유입된다면 결함 발생 확률은 당연히 증가하게 된다.

It is typical to transmit serialized data including a malicious code. Since this malicious code is restored at the time of deserialization (restoration), a system vulnerable to the malicious code, such as using an old library, may be exposed to an attack.

직렬화된 데이터에 악성코드를 심어 전달하는 것이 대표적인데, 역직렬화(복원) 시 이 악성코드도 함께 복원되기 때문에, 구버전의 라이브러리르 사용하는 등 해당 악성코드에 취약한 시스템의 경우 공격에 노출될 수 있다.