🇰🇷 한글 설명
Nginx UI 2.3.8 이전 버전에서 초기 설치 후 10분 동안 인증 없이 /api/restore 엔드포인트가 노출됩니다. 공격자는 백업 아카이브를 업로드하여 애플리케이션 설정 파일과 데이터베이스를 덮어쓸 수 있고, 설정에 OS 명령을 주입하여 root 권한으로 실행시킬 수 있습니다.
💡 쉬운 설명
Nginx UI 웹 관리 도구의 초기 설치 단계에서 비밀번호 없이 파일 업로드가 가능한 취약점입니다. 공격자가 악의적인 설정 파일을 업로드하면 서버를 완전히 장악할 수 있습니다.
🇺🇸 원문 (English)
Nginx UI is a web user interface for the Nginx web server. Prior to version 2.3.8, nginx-ui exposes a backup restore endpoint (POST /api/restore) that is completely unauthenticated during the first 10 minutes after process startup on any fresh installation. An unauthenticated remote attacker can upload a crafted backup archive that overwrites the application's configuration file (app.ini) and SQLite database. Because the attacker controls the restored app.ini, they can inject an arbitrary OS command into the TestConfigCmd setting. After the application automatically restarts to apply the restored config, a single follow-up request triggers that command as the user running nginx-ui — typically root in Docker deployments. This issue has been patched in version 2.3.8.
📍 영향받는 시스템
Nginx UI 버전 2.3.8 미만 (특히 Docker 환경에서 root로 실행되는 경우)
⚔️ 공격 벡터
초기 설치 후 10분 내에 POST /api/restore 엔드포인트로 crafted backup archive를 업로드하여 config 및 database 덮어쓰기
🛡️ 대응 방법
Nginx UI를 2.3.8 이상으로 업그레이드
🔧 검증 코드
VULNERABLE이 반환되면 인증 없이 restore 엔드포인트에 접근 가능하며, 초기 10분 내에 실행하면 임의 코드 실행이 가능합니다.
curl -s -X POST http://target:8080/api/restore -F '[email protected]' -w '%{http_code}' 2>/dev/null | grep -q '200\|201' && echo 'VULNERABLE' || echo 'PATCHED'