인젝션 · 역직렬화Injection & deserialization

CWE-502 신뢰할 수 없는 데이터 역직렬화Deserialization of Untrusted Data

신뢰할 수 없는 바이트열을 객체로 복원하면서 의도치 않은 코드 경로가 실행되는 결함.Restoring objects from untrusted bytes triggers unintended code paths.

근본 원인 패턴Root-cause pattern

역직렬화 포맷이 타입/생성자 호출을 표현할 수 있어, 복원 과정 자체가 "가젯" 실행이 된다. ML 모델 파일(pickle 기반)도 같은 원리.The format can express types/constructor calls, so restoring runs "gadgets". Pickle-based ML model files share this.

전형적인 패치Typical fix

데이터 전용 포맷(JSON, safetensors), 타입 허용목록, 서명 검증.Data-only formats (JSON, safetensors), type allowlists, signature checks.

1 편posts

  1. CVE-2026-129514 Erlang term 요청 본문의 Struct 맵이 연쇄되어 Hex.pm 서버에서 원격 코드 실행으로 이어짐Struct Maps in Erlang Term Request Bodies Chain to Remote Code Execution in the Hex.pm Server hexpm (the hex.pm server) · CWE-502 신뢰할 수 없는 데이터 역직렬화Deserialization of Untrusted Data 고급Advanced 8.8

✎ CWE-502 퀴즈 풀기Quiz on CWE-502