🇰🇷 한글 설명
@conventional-changelog/git-client 라이브러리의 getTags() API가 사용자 입력을 검증하지 않아 argument injection 취약점이 발생합니다. 공격자는 git log 명령어에 --output= 옵션을 주입하여 임의의 파일을 덮어쓸 수 있습니다. 버전 2.0.0에서 패치되었습니다.
💡 쉬운 설명
Conventional Changelog 라이브러리가 사용자 입력을 검증하지 않아 공격자가 숨겨진 명령어를 실행할 수 있습니다. 이를 통해 서버의 파일을 원하는 대로 덮어쓸 수 있습니다.
🇺🇸 원문 (English)
Conventional Changelog generates changelogs and release notes from a project's commit messages and metadata. Prior to version 2.0.0, @conventional-changelog/git-client has an argument injection vulnerability. This vulnerability manifests with the library's getTags() API, which allows extra parameters to be passed to the git log command. In another API by this library, getRawCommits(), there are secure practices taken to ensure that the extra parameter path is unable to inject an argument by ending the git log command with the special shell syntax --. However, the library does not follow the same practice for getTags() as it does not attempt to sanitize for user input, validate the given params, or restrict them to an allow list. Nor does it properly pass command-line flags to the git binary using the double-dash POSIX characters (--) to communicate the end of options. Thus, allowing users to exploit an argument injection vulnerability in Git due to the --output= command-line option that results with overwriting arbitrary files. This issue has been patched in version 2.0.0.
📍 영향받는 시스템
@conventional-changelog/git-client 버전 2.0.0 미만
⚔️ 공격 벡터
getTags() API의 params 매개변수에 git 옵션을 주입하여 --output=<filepath> 로 임의 파일 덮어쓰기
🛡️ 대응 방법
@conventional-changelog/git-client를 2.0.0 이상으로 업그레이드
🔧 검증 코드
설치된 버전이 2.0.0 이상이면 취약점이 패치된 상태입니다
npm list @conventional-changelog/git-client 2>/dev/null | grep -oP '@conventional-changelog/git-client@\K[\d.]+' | head -1