🇰🇷 한글 설명
PHP용 Redis/Valkey 클라이언트인 Predis의 특정 버전에서 파이프라인 처리 시 RESP 버퍼를 잘못 파싱하는 취약점이 발견되었습니다. 공격자가 CRLF 시퀀스가 포함된 키나 값을 제어할 경우, 이를 추가 명령어로 해석하게 하여 클러스터 내 데이터 삭제나 변조, 노드 중단 등을 유발할 수 있습니다.
💡 쉬운 설명
데이터를 한꺼번에 보내는 기능에서 데이터 구분자를 잘못 처리하여 발생하는 문제입니다. 해커가 특수 문자를 섞어 보내면 시스템이 이를 별도의 명령어로 착각하여 중요한 데이터를 지우거나 훔칠 수 있습니다.
🇺🇸 원문 (English)
Predis is a flexible and feature-complete Redis and Valkey client for PHP. From version 3.0.0-RC1 until version 3.3.0, pipeline handling on aggregate cluster and replication connections reparses an already serialized RESP buffer in AbstractAggregateConnection::write() by splitting it with explode("\r\n") instead of honoring RESP length prefixes. Attacker-controlled keys or values containing CRLF sequences can therefore be interpreted by Command::deserializeCommand() as additional commands. On cluster connections, ClusterStrategy::getFakeKey() can route injected keyless commands using the literal fake key value "key", permitting operations such as shard-wide cache deletion, targeted data modification, data reads, or node disruption. On replication connections, malformed reparsing can throw an uncaught exception and repeatedly terminate affected requests. Only pipeline() reaches this vulnerable path; transaction() and MULTI are not affected. This issue is fixed in version 3.3.0.
📍 영향받는 시스템
Predis version 3.0.0-RC1 ~ 3.3.0
⚔️ 공격 벡터
공격자가 제어 가능한 키 또는 값에 CRLF(
) 시퀀스를 삽입하여 파이프라인 명령어를 주입
🛡️ 대응 방법
Predis 라이브러리를 버전 3.3.0 이상으로 업데이트
🔧 검증 코드
출력된 버전이 3.3.0 미만(3.0.0-RC1 포함)인지 확인
composer show predis/predis | grep 'versions'