🇰🇷 한글 설명
Datadog Linux Host Agent 7.65.0~7.70.2 버전에서 /opt/datadog-agent/python-scripts/__pycache__ 디렉토리의 부족한 권한 설정으로 인해 로컬 공격자가 파일을 수정할 수 있습니다. 에이전트 업그레이드 시 공격자 코드가 실행되어 권한 상승이 가능합니다.
💡 쉬운 설명
Datadog 에이전트 설치 폴더의 권한이 잘못 설정되어 컴퓨터에 접근한 사람이 파일을 조작할 수 있습니다. 에이전트가 업데이트될 때 조작된 코드가 높은 권한으로 실행되어 피해가 발생합니다.
🇺🇸 원문 (English)
The Datadog Agent collects events and metrics from hosts and sends them to Datadog. A vulnerability within the Datadog Linux Host Agent versions 7.65.0 through 7.70.2 exists due to insufficient permissions being set on the `opt/datadog-agent/python-scripts/__pycache__` directory during installation. Code in this directory is only run by the Agent during Agent install/upgrades. This could allow an attacker with local access to modify files in this directory, which would then subsequently be run when the Agent is upgraded, resulting in local privilege escalation. This issue requires local access to the host and a valid low privilege account to be vulnerable. Note that this vulnerability only impacts the Linux Host Agent. Other variations of the Agent including the container, kubernetes, windows host and other agents are not impacted. Version 7.71.0 contains a patch for the issue.
📍 영향받는 시스템
Datadog Linux Host Agent 7.65.0 ~ 7.70.2 (7.71.0 이상은 패치됨)
⚔️ 공격 벡터
로컬 접근 권한이 있는 저권한 사용자가 __pycache__ 디렉토리의 Python 캐시 파일을 수정하고 에이전트 업그레이드 시 악의적 코드 실행
🛡️ 대응 방법
Datadog Agent를 7.71.0 이상으로 업그레이드 또는 /opt/datadog-agent/python-scripts/__pycache__ 디렉토리 권한을 제한(700)
🔧 검증 코드
첫 명령어에서 권한이 drwxr-xr-x 이상이면 취약, 두 번째에서 버전이 7.70.2 이하면 조치 필요
ls -ld /opt/datadog-agent/python-scripts/__pycache__ 2>/dev/null && /opt/datadog-agent/bin/agent/agent version 2>/dev/null | grep -E '^Agent'