🇰🇷 한글 설명
Forge(node-forge)는 JavaScript로 구현된 TLS 라이브러리입니다. 1.4.1 이전 버전에서는 PKCS#12 MAC 또는 PBE 반복 횟수로 0 이하의 값을 허용하여, pki.pbe.generatePkcs12Key()가 비밀번호와 솔트와 무관한 상수 키를 반환했습니다. 이로 인해 조작된 PKCS#12 입력이 비밀번호 기반 무결성 검사를 우회할 수 있으며, PBE 방식(3DES, RC2)에서는 암호화 키와 IV가 예측 가능해집니다.
💡 쉬운 설명
인증서 파일을 처리하는 Node.js 라이브러리의 결함으로, 공격자가 만든 특수한 인증서 파일이 비밀번호 검사를 통과할 수 있습니다. 이 경우 개인키 등 암호화된 데이터가 예측 가능한 키로 보호되어 노출될 위험이 있습니다.
🇺🇸 원문 (English)
Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, node-forge accepted a PKCS#12 MAC or PKCS#12 password-based encryption iteration count of zero or less. pki.pbe.generatePkcs12Key() then returned a constant key independent of the password and salt, allowing crafted PKCS#12 input processed by forge.pkcs12.pkcs12FromAsn1() to bypass password-based integrity checks. Predictable encryption keys and IVs also affected PKCS#12 PBE using pbeWithSHAAnd3-KeyTripleDES-CBC or pbewithSHAAnd40BitRC2-CBC, including shrouded key bags, encrypted SafeContents, and PKCS#8 ENCRYPTED PRIVATE KEY input processed independently by forge.pki.decryptPrivateKeyInfo(). PBES2/PBKDF2-encrypted content is unaffected. This issue is fixed in version 1.4.1.
📍 영향받는 시스템
node-forge 1.4.1 미만 버전을 사용하는 Node.js 애플리케이션 전반
⚔️ 공격 벡터
조작된 PKCS#12 또는 PBE 방식의 암호화 개인키 파일을 애플리케이션에 입력하여 비밀번호 검증을 우회하고 암호문을 복호화
🛡️ 대응 방법
node-forge를 1.4.1 이상으로 업그레이드 (npm update node-forge 또는 package.json 수정 후 재설치)
🔧 검증 코드
출력된 버전이 1.4.1 미만이면 취약하므로 1.4.1 이상으로 업그레이드가 필요하며, 출력이 없으면 해당 패키지가 설치되지 않은 것입니다.
npm ls node-forge 2>/dev/null | grep node-forge