🇰🇷 한글 설명
Spring for Apache Kafka 3.0.9 및 2.9.10 이하 버전에서 특정 설정이 적용된 경우 역직렬화 공격이 발생할 수 있습니다. 공격자가 역직렬화 예외 레코드 헤더에 악성 직렬화 객체를 포함시켜 전송할 경우 시스템이 취약해질 수 있습니다.
💡 쉬운 설명
특정 설정이 켜져 있는 상태에서 신뢰할 수 없는 사용자가 가짜 데이터를 보내면, 프로그램이 데이터를 읽는 과정에서 해킹될 수 있는 문제입니다. 보안 장치인 ErrorHandlingDeserializer를 사용하지 않을 때 발생합니다.
🇺🇸 원문 (English)
In Spring for Apache Kafka 3.0.9 and earlier and versions 2.9.10 and earlier, a possible deserialization attack vector existed, but only if unusual configuration was applied. An attacker would have to construct a malicious serialized object in one of the deserialization exception record headers.
Specifically, an application is vulnerable when all of the following are true:
* The user does not configure an ErrorHandlingDeserializer for the key and/or value of the record
* The user explicitly sets container properties checkDeserExWhenKeyNull and/or checkDeserExWhenValueNull container properties to true.
* The user allows untrusted sources to publish to a Kafka topic
By default, these properties are false, and the container only attempts to deserialize the headers if an ErrorHandlingDeserializer is configured. The ErrorHandlingDeserializer prevents the vulnerability by removing any such malicious headers before processing the record.
📍 영향받는 시스템
Spring for Apache Kafka 3.0.9 이하 및 2.9.10 이하 버전
⚔️ 공격 벡터
신뢰할 수 없는 소스로부터 악성 직렬화 객체가 포함된 Kafka 레코드 헤더를 전송하여 역직렬화 유도
🛡️ 대응 방법
Spring for Apache Kafka를 최신 버전으로 업데이트하거나, ErrorHandlingDeserializer를 설정하여 악성 헤더를 제거해야 함
🔧 검증 코드
명령어 결과에 취약한 버전(3.0.9 또는 2.9.10 이하)이 나타나면 해당 프로젝트는 취약한 상태입니다.
mvn dependency:tree | grep -E 'spring-kafka' | grep -E '3.0.9|2.9.10'