🔍 CVE-2026-57236

8.2
CVSS Score
HIGH
2026-06-25
2026-10-25 23:10
✅ 완료

🇰🇷 한글 설명

Nokogiri(Ruby용 XML/HTML 라이브러리)에서 1.19.4 이전 버전은 Document#encoding= 호출 시 잘못된 인코딩 값(문자열이 아닌 값 또는 널 바이트 포함)이 주어지면, 기존 인코딩 문자열을 해제한 뒤 예외를 발생시킵니다. 이로 인해 문서가 해제된 메모리를 참조하게 되며, 이후 Document#encoding 호출 시 잘못된 메모리를 읽어 세그먼트 오류가 발생하거나 해제된 바이트가 Ruby 문자열로 유출될 수 있습니다. CRuby(libxml2) 구현에만 영향을 미치며 JRuby는 영향을 받지 않습니다.

💡 쉬운 설명

Nokogiri 라이브러리에서 잘못된 인코딩 값을 설정하면 이미 지워진 메모리를 다시 읽게 되는 결함입니다. 이로 인해 프로그램이 비정상 종료되거나 메모리에 남아 있던 데이터가 노출될 수 있습니다.

🇺🇸 원문 (English)

Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, calling Document#encoding= with an invalid encoding (e.g., a non-string, or a string containing a null byte) raises an exception, but only after freeing the document's current encoding string without replacing it. The document is left referencing freed memory, so the next call to Document#encoding reads invalid memory, which can cause a segfault or leak freed bytes into a Ruby String. Affects the CRuby (libxml2) implementation only; JRuby is not affected. This vulnerability is fixed in 1.19.4.

📍 영향받는 시스템

Nokogiri 1.19.4 미만 버전을 CRuby(libxml2) 환경에서 사용하는 Ruby 애플리케이션 (JRuby 제외)

⚔️ 공격 벡터

공격자가 잘못된 인코딩 값을 전달할 수 있는 입력 경로를 통해 Document#encoding= 호출을 유도하여 메모리 손상 또는 정보 유출을 일으킴

🛡️ 대응 방법

Nokogiri를 1.19.4 이상으로 업데이트 (bundle update nokogiri 또는 gem install nokogiri -v 1.19.4)

🔧 검증 코드

출력된 버전이 1.19.4 미만이면 취약하므로 1.19.4 이상으로 업데이트가 필요하며, 1.19.4 이상이면 조치가 완료된 상태입니다.

Shell / Script
gem list nokogiri 2>/dev/null | grep nokogiri

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

💻 영향받는 소프트웨어

Magento Open Source