🇰🇷 한글 설명
node.js용 systeminformation 라이브러리 5.31.7 미만 버전에서 Linux 환경의 networkInterfaces() 함수가 OS 명령 주입 취약점에 노출됩니다. /etc/network/interfaces 파일 내의 특정 토큰을 검증 없이 쉘 명령에 포함시켜 실행하기 때문에, 악의적인 경로명이 포함될 경우 임의의 명령이 실행될 수 있습니다.
💡 쉬운 설명
컴퓨터의 네트워크 정보를 읽어오는 과정에서 파일 이름에 숨겨진 악성 명령어가 함께 실행될 수 있는 보안 결함입니다. 해커가 특수하게 조작된 설정 파일을 이용해 사용자의 컴퓨터에서 원하는 명령을 몰래 실행할 수 있습니다.
🇺🇸 원문 (English)
systeminformation is a System and OS information library for node.js. Prior to 5.31.7, networkInterfaces() on Linux is vulnerable to OS command injection through the Debian/Ubuntu interfaces(5) source directive because lib/network.js checkLinuxDCHPInterfaces() reads /etc/network/interfaces, extracts a source <path> token from file content, and interpolates it unquoted into cat ${file} 2> /dev/null | grep 'iface\|source' executed by execSync(cmd, util.execOptsLinux), allowing a path containing shell metacharacters to execute commands in any process that calls networkInterfaces(), including via getStaticData() and getAllData(). This issue is fixed in version 5.31.7.
📍 영향받는 시스템
systeminformation library versions prior to 5.31.7 (on Linux)
⚔️ 공격 벡터
Linux 시스템의 /etc/network/interfaces 파일 내 source 경로에 쉘 메타문자를 삽입하여 execSync를 통해 명령 실행
🛡️ 대응 방법
systeminformation 라이브러리를 5.31.7 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 5.31.7 미만이라면 해당 취약점에 노출된 상태입니다.
npm list systeminformation | grep -E 'systeminformation@([0-5]\.[0-3][0-1]\.[0-6]|<5\.31\.7)'