🇰🇷 한글 설명
Rekor 소프트웨어의 특정 버전에서 APK 파일의 서명 및 제어 gzip 멤버를 압축 해제할 때 해제될 데이터의 총 크기를 제한하지 않는 취약점이 발견되었습니다. 공격자가 압축률이 매우 높은 특수하게 제작된 gzip 스트림을 전송하면, 서버는 이를 처리하는 과정에서 메모리를 과도하게 점유하여 서비스 거부(DoS) 상태에 빠지거나 프로세스가 강제 종료될 수 있습니다.
💡 쉬운 설명
압축된 파일의 크기는 작지만 압축을 풀면 엄청나게 커지는 '압축 폭탄'을 서버에 보내는 공격입니다. 이로 인해 서버의 메모리가 가득 차서 서비스가 멈추거나 꺼질 수 있습니다.
🇺🇸 원문 (English)
Rekor is a software supply chain transparency log. Starting in version 0.3.0 and prior to version 1.5.2, the `Package.Unmarshal()` function in `pkg/types/alpine/apk.go` decompresses the signature and control gzip members of an APK file into in-memory buffers without bounding the total decompressed size. The existing `max_apk_metadata_size` check (default 1MB) is only applied to individual tar entry header sizes after decompression completes, so it does not prevent a decompression bomb from consuming unbounded heap memory. An attacker can craft a gzip stream that compresses at a ~1000:1 ratio (e.g., 2MB compressed zeros → 2GB decompressed). When submitted as spec.package.content in an Alpine `ProposedEntry`, the server decompresses the full payload into memory during request processing, triggering a fatal Go runtime out-of-memory error or OS OOM-kill that cannot be caught by the server's recover() middleware. This is reachable via two unauthenticated endpoints, `POST /api/v1/log/entries (createLogEntry)` and `POST /api/v1/log/entries/retrieve (searchLogQuery)`. Both invoke `V001Entry.Canonicalize()` → `fetchExternalEntities()` → `apk.Unmarshal(packageData)`, which performs the unbounded decompression. Version 1.5.2 patches the issue. There is no effective workaround. Setting `max_request_body_size` reduces but does not eliminate exposure due to the ~1000:1 compression ratio (a 1MB body limit still allows ~1GB heap allocation). Setting `max_apk_metadata_size` has no effect on this vulnerability since the check is applied after decompression.
📍 영향받는 시스템
Rekor version 0.3.0 to 1.5.1
⚔️ 공격 벡터
인증되지 않은 사용자가 API 엔드포인트를 통해 압축률이 매우 높은 APK 파일을 포함한 요청을 전송
🛡️ 대응 방법
Rekor 버전을 1.5.2 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 1.5.2 미만(0.x.x 또는 1.5.0, 1.5.1 등)이면 취약한 상태입니다.
rekor --version 2>/dev/null | grep -E '1\[\.\]5\.[2-9]|0\.[0-9]\.' || echo 'Version check failed'