CVE-2023-50260 Wazuh's vulnerability in host_deny AR script allows arbitrary command execution
host_deny AR 스크립트에서의 Wazuh의 취약점은 임의의 명령 실행을 허용합니다.
설명
Wazuh is a free and open source platform used for threat prevention, detection, and response. A wrong validation in the `host_deny` script allows to write any string in the `hosts.deny` file, which can end in an arbitrary command execution on the target system. This vulnerability is part of the active response feature, which can automatically triggers actions in response to alerts. By default, active responses are limited to a set of pre defined executables. This is enforced by only allowing executables stored under `/var/ossec/active-response/bin` to be run as an active response. However, the `/var/ossec/active-response/bin/host_deny` can be exploited. `host_deny` is used to add IP address to the `/etc/hosts.deny` file to block incoming connections on a service level by using TCP wrappers. Attacker can inject arbitrary command into the `/etc/hosts.deny` file and execute arbitrary command by using the spawn directive. The active response can be triggered by writing events either to the local `execd` queue on server or to the `ar` queue which forwards the events to agents. So, it can leads to LPE on server as root and RCE on agent as root. This vulnerability is fixed in 4.7.2.
Wazuh는 위협 방지, 탐지 및 대응에 사용되는 무료 오픈 소스 플랫폼입니다. `host_deny` 스크립트의 잘못된 유효성 검사는 `hosts.deny` 파일에서 임의의 문자열을 작성할 수 있게 해주며, 이는 대상 시스템에서 임의의 명령 실행으로 끝날 수 있습니다. 이 취약점은 활성 응답 기능의 일부이며, 경고에 대한 응답으로 자동으로 동작을 트리거할 수 있습니다. 기본적으로 활성 응답은 미리 정의된 실행 파일 집합으로 제한됩니다. 이것은 `/var/ossec/active-response/bin' 아래에 저장된 실행파일이 활성 응답으로 실행되도록 하는 것에 의해서만 강제된다. 그러나 `/var/ossec/active-response/bin/host_deny`는 악용될 수 있다. `host_deny`는 TCP 래퍼를 사용하여 서비스 레벨에서 들어오는 연결을 차단하기 위해 `/etc/hosts.deny` 파일에 IP 주소를 추가하는 데 사용된다. 공격자는 `/etc/hosts.deny' 파일에 임의의 명령을 삽입하고 spawn 지시어를 사용하여 임의의 명령을 실행할 수 있다. 활성 응답은 이벤트를 서버의 로컬 `execd` 큐에 기록하거나 이벤트를 에이전트로 전달하는 `ar` 큐에 기록함으로써 트리거될 수 있다. 따라서 서버의 LPE는 루트로, RCE는 에이전트의 루트로 이어질 수 있습니다. 이 취약점은 4.7.2에서 수정되었습니다.
영향 받는 제품 제품 1개
-
해결 버전 있음
wazuh
wazuh
영향 받는 버전
- 4.2.0 이상 4.7.2 미만
해결 버전
- 4.7.2 이상