🇰🇷 한글 설명
toml-node 5.0.1 미만 버전에서 toml.parse() 함수를 사용할 때 공격자가 제어하는 속성을 Object.prototype에 쓸 수 있는 취약점이 존재합니다. 이는 특정 키 경로 처리 과정에서 가드(guard)가 해제되고 소유권 확인 없이 프로토타입 체인에 접근할 수 있기 때문입니다. 이로 인해 프로세스 내 다른 객체들이 주입된 속성을 상속받을 수 있습니다.
💡 쉬운 설명
TOML 파일을 읽어들이는 과정에서 악의적인 데이터가 프로그램의 기본 설계도(프로토타입)를 오염시킬 수 있는 문제입니다. 이를 통해 해커가 프로그램의 동작 방식을 마음대로 바꾸거나 다른 데이터에 영향을 줄 수 있습니다.
🇺🇸 원문 (English)
toml-node is a TOML parser for Node.js and the browser. Prior to 5.0.1, toml.parse() can write attacker-controlled properties to Object.prototype because quoteDottedString() in lib/compiler.js produces the same bookkeeping string for distinct quoted key paths, allowing addTableArray() to clear another key's guard. The assign() path then descends through an unowned Date value without applying the owned-container check and can reach the prototype chain. Objects created elsewhere in the process can inherit the injected property. This issue is fixed in version 5.0.1.
📍 영향받는 시스템
toml-node 버전 5.0.1 미만
⚔️ 공격 벡터
조작된 TOML 데이터를 입력하여 Object.prototype에 임의의 속성을 주입하는 방식
🛡️ 대응 방법
toml-node 라이브러리를 5.0.1 버전 이상으로 업데이트하십시오.
🔧 검증 코드
명령어 결과에 [email protected] 미만 버전이 나타나면 취약한 상태입니다.
npm list toml-node | grep -E 'toml-node@([0-4]\.|5\.0\.0)'