🇰🇷 한글 설명
Apache MINA SSHD의 sshd-git 구성 요소에서 입력값 검증이 부적절하게 이루어지는 취약점이 발견되었습니다. GitPgmCommandFactory를 사용하는 서버의 경우, 인증된 사용자가 git archive의 --output 옵션 등을 악용하여 서버의 임의 위치에 파일을 작성할 수 있습니다.
💡 쉬운 설명
SSH를 통해 접속한 사용자가 서버의 허가되지 않은 위치에 마음대로 파일을 저장할 수 있는 보안 결함입니다. 이로 인해 서버의 중요한 파일이 변조되거나 시스템이 위험에 처할 수 있습니다.
🇺🇸 원문 (English)
Improper input validation in sshd-git in Apache MINA SSHD. Apache MINA SSHD is a Java library for client-side and server-side SSH.
Component org.apache.sshd:sshd-git provides though its GitPgmCommandFactory a way to configure an Apache MINA SSHD server such that SSH clients can remotely execute git commands via the JGit library on git repositories stored on the server.
This GitPgmCommandFactory allowed a user authenticated via SSH to run any JGit command available, including commands that could write files at arbitrary places such as git archive with the --output option.
Affected are SSH servers implemented with Apache MINA SSHD and using the GitPgmCommandFactory. If the GitPgmCommandFactory is not configured on the server, the server is not affected.
It is recommended to upgrade affected servers to Apache MINA SSHD 2.19.0 or 3.0.0-M5, which fix this issue.
The issue is fixed by restricting the available commands to a small whitelist of uncritical commands (such as git log). git archive is also allowed, but its --output argument is ignored and the archive is always sent through the SSH channel to the client.
📍 영향받는 시스템
GitPgmCommandFactory를 사용하는 Apache MINA SSHD 기반 SSH 서버
⚔️ 공격 벡터
SSH로 인증된 사용자가 JGit 명령어를 실행하여 임의의 경로에 파일을 쓰는 방식
🛡️ 대응 방법
Apache MINA SSHD를 2.19.0 또는 3.0.0-M5 이상의 버전으로 업그레이드하십시오.
🔧 검증 코드
출력된 라이브러리 버전이 2.19.0 또는 3.0.0-M5 미만인지 확인합니다.
mvn dependency:tree | grep 'org.apache.sshd:sshd-git'