🔍 CVE-2024-24828

6.6
CVSS Score
MEDIUM
2024-02-09
2026-06-17 07:14
✅ 완료

🇰🇷 한글 설명

pkg 도구는 Node.js 프로젝트를 실행 파일로 번들링할 때 네이티브 코드를 예측 가능한 `/tmp/pkg/*` 경로에 저장합니다. 동일한 로컬 시스템을 사용하는 공격자가 이 경로의 파일을 악성 파일로 교체하여 사용자가 의도치 않게 실행하도록 유도할 수 있습니다.

💡 쉬운 설명

프로그램을 만드는 도구가 임시 파일을 저장하는 폴더를 누구나 접근할 수 있는 공용 공간에 만듭니다. 해커가 이 공간에 몰래 가짜 파일을 넣어두면 사용자가 진짜 프로그램인 줄 알고 실행할 위험이 있습니다.

🇺🇸 원문 (English)

pkg is tool design to bundle Node.js projects into an executables. Any native code packages built by `pkg` are written to a hardcoded directory. On unix systems, this is `/tmp/pkg/*` which is a shared directory for all users on the same local system. There is no uniqueness to the package names within this directory, they are predictable. An attacker who has access to the same local system has the ability to replace the genuine executables in the shared directory with malicious executables of the same name. A user may then run the malicious executable without realising it has been modified. This package is deprecated. Therefore, there will not be a patch provided for this vulnerability. To check if your executable build by pkg depends on native code and is vulnerable, run the executable and check if `/tmp/pkg/` was created. Users should transition to actively maintained alternatives. We would recommend investigating Node.js 21’s support for single executable applications. Given the decision to deprecate the pkg package, there are no official workarounds or remediations provided by our team. Users should prioritize migrating to other packages that offer similar functionality with enhanced security.

📍 영향받는 시스템

pkg 도구를 사용하여 네이티브 코드가 포함된 실행 파일을 생성한 모든 Unix 기반 시스템

⚔️ 공격 벡터

동일한 로컬 시스템에 접근 가능한 공격자가 예측 가능한 `/tmp/pkg/` 경로 내의 실행 파일을 악성 파일로 교체

🛡️ 대응 방법

해당 패키지는 지원이 중단되었으므로 Node.js 21의 Single Executable Applications(SEA) 등 유지보수가 활발한 대체 도구로 마이그레이션 권장

🔧 검증 코드

명령어 실행 결과로 파일 경로가 출력된다면 해당 실행 파일은 취약할 가능성이 높습니다.

Shell / Script
ls -d /tmp/pkg/* 2>/dev/null

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Node.js