🇰🇷 한글 설명
Apache Camel의 Spring Redis 컴포넌트에서 신뢰할 수 없는 데이터의 역직렬화 취약점이 발견되었습니다. 공격자가 Redis 채널에 악성 직렬화 데이터를 게시할 경우, 필터링되지 않은 Java 역직렬화 과정을 통해 임의의 코드가 실행될 수 있습니다.
💡 쉬운 설명
해커가 Redis라는 저장소에 조작된 데이터를 보내면, 프로그램이 이를 읽는 과정에서 해커가 원하는 명령을 자동으로 실행하게 되는 보안 약점입니다. 이를 통해 시스템의 제어권을 탈취당할 위험이 있습니다.
🇺🇸 원문 (English)
Deserialization of Untrusted Data vulnerability in Apache Camel Spring Redis component.
This issue affects Apache Camel: from 2.11.0 before 4.18.5, from 4.19.0 before 4.22.1.
RedisConfiguration.getSerializer lazily built a bare JdkSerializationRedisSerializer whenever no serializer option was configured, and that instance was used for every read the component performs. Spring's implementation delegates through DeserializingConverter to DefaultDeserializer, which reads the bytes with a ConfigurableObjectInputStream and installs no java.io.ObjectInputFilter on the stream, so an arbitrary serialized class graph was materialised and its readObject method executed. RedisConsumer.setBody applied that serializer to the raw bytes of every message published to the subscribed channels, before the Exchange was constructed and therefore before any route logic could inspect the message, so an actor able to issue PUBLISH on a subscribed channel reached the deserialization sink directly. The same default serializer backed the RedisTemplate built by RedisConfiguration.createDefaultTemplate, so the producer read commands GET, HGET, HGETALL and HVALS deserialized whatever was stored in the Redis keyspace, and SpringRedisIdempotentRepository shared that template. Configuring a custom redisTemplate did not close the consumer path, because RedisConsumer.setBody reads getSerializer directly rather than the serializer attached to the template, so a deployment that had wired a String serializer into its own template remained exposed on the consumer side unless it also set the serializer option. The component never constructed a java.io.ObjectInputStream itself, which is why earlier passes over the Camel codebase for unfiltered Java deserialization did not reach it. The behaviour dates back to the introduction of the component, first released in 2.11.0, and was unchanged until this fix.
Users are recommended to upgrade to version 4.23.0, which fixes the issue. If users are on the 4.22.x releases stream, then they are suggested to upgrade to 4.22.1. If users are on the 4.18.x releases stream, then they are suggested to upgrade to 4.18.5. The 4.14.x releases stream and earlier reached end of life before this issue was resolved and will not receive a fix, so deployments on those lines must move to a supported release. For deployments that cannot upgrade immediately, set the JVM-wide jdk.serialFilter system property, which the affected code path honours because it reads through a java.io.ObjectInputStream, for example -Djdk.serialFilter=!java.net.**;java.**;javax.**;org.apache.camel.**;!* ; or set the serializer endpoint option to a serializer that does not use Java serialization, such as StringRedisSerializer, noting that this must be set as the serializer option and not only on a custom redisTemplate. As defence in depth, require authentication on the Redis instance and restrict which clients may publish to the subscribed channels, and do not expose a Redis instance consumed by Camel to untrusted networks.
📍 영향받는 시스템
Apache Camel: 2.11.0 ~ 4.18.4, 4.19.0 ~ 4.22.0
⚔️ 공격 벡터
Redis 채널에 악성 직렬화된 객체를 PUBLISH 명령어로 전송하여 역직렬화 싱크에 직접 도달
🛡️ 대응 방법
Apache Camel을 4.23.0, 4.22.1 또는 4.18.5 이상 버전으로 업그레이드하거나, serializer 옵션을 StringRedisSerializer로 설정하십시오.
🔧 검증 코드
출력된 결과에서 camel-spring-redis의 버전을 확인하여 취약한 버전 범위에 해당하는지 체크합니다.
mvn dependency:tree | grep -E 'camel-spring-redis'