취약점 데이터베이스GHSA-v59p-pxfc-8xvf

GHSA-v59p-pxfc-8xvf: 
Rust 취약점 분석 및 완화

Summary

In the zip crate (<= 9.0.3), AES password verification in src/aes.rs:187 uses Rust's standard slice inequality operator (!=) instead of constant-time comparison. While constant_time_eq is already a declared dependency in Cargo.toml and is properly utilized elsewhere in the crate for HMAC verification (line 319), its omission during the password verification check creates an observable timing side-channel. An attacker able to measure response latencies or execution times can exploit this short-circuiting comparison to deduce valid password verification bytes, significantly reducing the search space required to decrypt encrypted ZIP entries.

Details

Architectural Root Cause

In WinZip AES encryption, the key derivation process derives an encryption key, an authentication key, and a 2-byte password verification value (pwd_verify) using PBKDF2 with HMAC-SHA1. In src/aes.rs:L186-L190:

// the last 2 bytes should equal the password verification value
if pwd_verification_value != pwd_verify {
    // wrong password
    return Err(ZipError::InvalidPassword);
}

The operator != on byte slices (&[u8]) short-circuits immediately upon encountering the first non-matching byte:

  • If the first byte does not match, the comparison returns false after inspecting only byte 0.
  • If the first byte matches but the second byte differs, the comparison inspects both bytes before returning false. In contrast, lines 318-321 of the exact same file (src/aes.rs) demonstrate that constant-time comparison was intended and implemented for HMAC authentication:
// use constant time comparison to mitigate timing attacks
if !constant_time_eq(computed_auth_code, &read_auth_code) {
    return Err(auth_error());
}

Omitting constant_time_eq at line 187 breaks cryptographic defense-in-depth and exposes password verification to byte-by-byte timing discrepancy attacks.

Remediation

Update src/aes.rs:187 to use constant_time_eq:

use constant_time_eq::constant_time_eq;
// the last 2 bytes should equal the password verification value (constant-time)
if !constant_time_eq(&pwd_verification_value, pwd_verify) {
    // wrong password
    return Err(ZipError::InvalidPassword);
}

Proof of concept

The following unit test demonstrates the vulnerability and verifies that constant_time_eq eliminates the short-circuiting discrepancy:

use constant_time_eq::constant_time_eq;
#[test]
fn test_aes_password_verification_constant_time() {
    let expected = [0xAA, 0xBB];
    let mismatch_first_byte = [0x00, 0xBB];
    let mismatch_second_byte = [0xAA, 0x00];
    let matching = [0xAA, 0xBB];
    // Standard inequality short-circuits on byte 0 for mismatch_first_byte,
    // but inspects byte 1 for mismatch_second_byte.
    assert_ne!(mismatch_first_byte, expected);
    assert_ne!(mismatch_second_byte, expected);
    // Constant-time verification guarantees fixed-duration comparison:
    assert!(!constant_time_eq(&mismatch_first_byte, &expected));
    assert!(!constant_time_eq(&mismatch_second_byte, &expected));
    assert!(constant_time_eq(&matching, &expected));
}

Impact

Vulnerability Class: Observable Timing Discrepancy (CWE-208) / Covert Timing Channel (CWE-385). Who is Impacted:

  • Applications and web services that decrypt password-protected ZIP archives based on user input or API requests.
  • Multi-tenant cloud or containerized environments where co-located adversaries can monitor execution latency or cache timing.
  • High-security ingestion pipelines relying on AES encryption confidentiality.

소스: NVD

관련 Rust 취약점:

CVE ID

심각도

점수

기술

구성 요소 이름

CISA KEV 악용

수정 사항이 있습니다

출판일

GHSA-jghc-wgvq-4r28HIGH8.1
  • Rust logoRust
  • auth-framework
아니요네Oct 31, 2026
GHSA-v59p-pxfc-8xvfHIGH7.5
  • Rust logoRust
  • zip
아니요네Oct 31, 2026
GHSA-2fwm-pm8w-697gHIGH7.5
  • Rust logoRust
  • zip
아니요네Oct 31, 2026
GHSA-5rrw-whjq-pmhhMEDIUM해당 없음
  • Rust logoRust
  • actix-files
아니요네Oct 31, 2026
GHSA-j2mc-vg6q-w75pHIGH해당 없음
  • Rust logoRust
  • webbrowser
아니요네Oct 31, 2026

무료 취약점 평가

클라우드 보안 포세를 벤치마킹하세요

9개 보안 영역에서 클라우드 보안 관행을 평가하여 위험 수준을 벤치마킹하고 방어의 허점을 파악하세요.

요청 평가

추가 Wiz 리소스

맞춤형 데모를 받아보세요

맞춤형 데모 신청하기

"내가 본 최고의 사용자 경험은 클라우드 워크로드에 대한 완전한 가시성을 제공합니다."
데이비드 에슬릭CISO
"Wiz는 클라우드 환경에서 무슨 일이 일어나고 있는지 볼 수 있는 단일 창을 제공합니다."
아담 플레처최고 보안 책임자(CSO)
"우리는 Wiz가 무언가를 중요한 것으로 식별하면 실제로 중요하다는 것을 알고 있습니다."
그렉 포니아토프스키위협 및 취약성 관리 책임자