🇰🇷 한글 설명
Cacti 1.3.x DEV 버전의 cmd_realtime.php에서 PHP의 register_argc_argv 옵션이 활성화될 때, 인증 없이 URL 파라미터를 통해 $poller_id를 조작하여 임의의 명령을 실행할 수 있는 명령 주입 취약점입니다. 이 옵션은 많은 환경(특히 공식 PHP Docker 이미지)에서 기본으로 활성화되어 있으며, 패치가 있었지만 이후 되돌려졌습니다.
💡 쉬운 설명
Cacti 모니터링 소프트웨어에서 누구나 인증 없이 서버 명령을 실행할 수 있는 심각한 보안 결함이 있습니다. 웹사이트 주소를 조작하기만 해도 해커가 서버를 완전히 제어할 수 있다는 뜻입니다.
🇺🇸 원문 (English)
Cacti provides an operational monitoring and fault management framework. A command injection vulnerability on the 1.3.x DEV branch allows any unauthenticated user to execute arbitrary command on the server when `register_argc_argv` option of PHP is `On`. In `cmd_realtime.php` line 119, the `$poller_id` used as part of the command execution is sourced from `$_SERVER['argv']`, which can be controlled by URL when `register_argc_argv` option of PHP is `On`. And this option is `On` by default in many environments such as the main PHP Docker image for PHP. Commit 53e8014d1f082034e0646edc6286cde3800c683d contains a patch for the issue, but this commit was reverted in commit 99633903cad0de5ace636249de16f77e57a3c8fc.
📍 영향받는 시스템
Cacti 1.3.x DEV branch (commit 99633903cad0de5ace636249de16f77e57a3c8fc 이후, commit 53e8014d1f082034e0646edc6286cde3800c683d 이전)
⚔️ 공격 벡터
register_argc_argv가 On인 PHP 환경에서 URL 파라미터를 조작하여 $_SERVER['argv']의 poller_id 값을 제어하여 cmd_realtime.php에 악의적인 명령 주입
🛡️ 대응 방법
Cacti를 최신 버전으로 즉시 업그레이드하거나 PHP의 register_argc_argv를 Off로 설정하고 cmd_realtime.php에 접근 제한 적용
🔧 검증 코드
cmd_realtime.php 파일이 발견되거나 cacti 패키지가 설치되어 있으면 버전을 확인하고, 1.3.x DEV 버전인 경우 즉시 업그레이드 필요. register_argc_argv 설정도 확인: php -r "echo ini_get('register_argc_argv')"로 Off 상태 확인
find /usr/share /var/www /home -name 'cmd_realtime.php' -type f 2>/dev/null || dpkg -l 2>/dev/null | grep -i cacti