🔍 CVE-2024-24821

8.8
CVSS Score
HIGH
2024-02-09
2026-06-17 07:14
✅ 완료

🇰🇷 한글 설명

PHP 의존성 관리 도구인 Composer에서 로컬 작업 디렉토리 내의 파일을 실행 권한을 가진 사용자의 컨텍스트로 포함시키는 취약점이 발견되었습니다. 공격자가 디렉토리 내 파일을 조작할 경우 임의 코드 실행을 통한 로컬 권한 상승이나 측면 이동이 가능합니다. 이 문제는 Composer 2.7.0 및 2.2.23 버전에서 해결되었습니다.

💡 쉬운 설명

Composer를 실행할 때 해커가 몰래 바꿔치기한 파일이 함께 실행되어 컴퓨터의 권한을 탈취할 수 있는 문제입니다. 특히 관리자 권한(sudo)으로 Composer를 실행할 때 매우 위험합니다.

🇺🇸 원문 (English)

Composer is a dependency Manager for the PHP language. In affected versions several files within the local working directory are included during the invocation of Composer and in the context of the executing user. As such, under certain conditions arbitrary code execution may lead to local privilege escalation, provide lateral user movement or malicious code execution when Composer is invoked within a directory with tampered files. All Composer CLI commands are affected, including composer.phar's self-update. The following scenarios are of high risk: Composer being run with sudo, Pipelines which may execute Composer on untrusted projects, Shared environments with developers who run Composer individually on the same project. This vulnerability has been addressed in versions 2.7.0 and 2.2.23. It is advised that the patched versions are applied at the earliest convenience. Where not possible, the following should be addressed: Remove all sudo composer privileges for all users to mitigate root privilege escalation, and avoid running Composer within an untrusted directory, or if needed, verify that the contents of `vendor/composer/InstalledVersions.php` and `vendor/composer/installed.php` do not include untrusted code. A reset can also be done on these files by the following:```sh rm vendor/composer/installed.php vendor/composer/InstalledVersions.php composer install --no-scripts --no-plugins ```

📍 영향받는 시스템

Composer 2.7.0 및 2.2.23 미만 버전

⚔️ 공격 벡터

신뢰할 수 없는 디렉토리에서 Composer 명령어를 실행하거나 조작된 파일을 포함한 프로젝트를 처리할 때 발생

🛡️ 대응 방법

Composer를 2.7.0 또는 2.2.23 이상의 최신 버전으로 업데이트하고, Composer 실행 시 sudo 사용을 금지합니다.

🔧 검증 코드

출력된 버전이 2.7.0 이상 또는 2.2.23 이상인지 확인하여 패치 여부를 판단합니다.

Shell / Script
composer --version | grep -E '2\.(7\.[0-9]*|2\.[2]\.(2[3-9]|[3-9][0-9]))|3\.'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

💻 영향받는 소프트웨어

Sudo