🇰🇷 한글 설명
Linux 커널의 ecryptfs 모듈에서 parse_tag_3_packet 함수가 암호화된 키 크기를 검증하지 않아 발생하는 취약점입니다. 공격자가 비정상적으로 큰 키 크기를 전달할 경우, 메모리 경계를 벗어난 쓰기(Out-of-bounds write)가 발생하여 커널 구조체를 손상시킬 수 있습니다.
💡 쉬운 설명
암호화 키의 크기가 정해진 범위를 넘지 않는지 확인하는 절차가 빠져 있어 발생하는 문제입니다. 이를 통해 해커가 컴퓨터의 중요한 메모리 영역을 망가뜨리거나 시스템을 제어할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ecryptfs: reject oversized encrypted_key_size in parse_tag_3_packet
parse_tag_3_packet() set encrypted_key_size from the Tag 3 packet body
without bounding it against ECRYPTFS_MAX_KEY_BYTES (64). When
encrypted_key_size > 64, decrypt_passphrase_encrypted_session_key()
sets decrypted_key_size = encrypted_key_size and performs two
out-of-bounds writes:
1. crypto_skcipher_decrypt() writes encrypted_key_size bytes into
decrypted_key[64] via scatterlist, overflowing into the parent
ecryptfs_auth_tok struct.
2. memcpy(crypt_stat->key, decrypted_key, decrypted_key_size) writes
into crypt_stat->key[64], corrupting root_iv, keysig_list, and
mutexes in ecryptfs_crypt_stat.
Only AES-192 (cipher code 0x08) enables this because it sets
crypt_stat->key_size = 24 independently of encrypted_key_size,
allowing crypto_skcipher_setkey() to succeed while encrypted_key_size
exceeds ECRYPTFS_MAX_KEY_BYTES.
The PKI decryption path (parse_tag_65_packet) already validates
decrypted_key_size <= ECRYPTFS_MAX_KEY_BYTES; the passphrase path
omits this check.
Bound encrypted_key_size against ECRYPTFS_MAX_KEY_BYTES (64) rather
than ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES (512). The 64-byte limit also
protects the 512-byte encrypted_key[] buffer, so the former 512-byte
check is removed as redundant.
[tyhicks: Adjust the code comment to refer to macros representing the
buffer sizes rather than mentioning the buffer size values since they
may change in the future]
📍 영향받는 시스템
ecryptfs 모듈을 사용하는 Linux 커널 버전 (AES-192 사용 시 특히 취약)
⚔️ 공격 벡터
조작된 Tag 3 패킷을 통해 비정상적으로 큰 encrypted_key_size 값을 전달하여 메모리 오버플로우 유도
🛡️ 대응 방법
ecryptfs의 parse_tag_3_packet 함수에서 encrypted_key_size를 ECRYPTFS_MAX_KEY_BYTES(64)로 제한하도록 커널 업데이트 적용
🔧 검증 코드
현재 사용 중인 커널 버전을 확인하여 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.