🔍 CVE-2021-29428

8.8
CVSS Score
HIGH
2021-04-13
2026-10-08 22:17
✅ 완료

🇰🇷 한글 설명

Gradle 7.0 미만 버전의 Unix 계열 시스템에서 임시 디렉토리가 개방된 권한으로 생성되어 발생합니다. 공격자가 임시 디렉토리 내의 파일을 삭제하고 재생성함으로써 로컬 권한 상승을 유도할 수 있습니다. 이 취약점은 Kotlin DSL을 사용한 사전 컴파일된 스크립트 플러그인 및 ProjectBuilder/TestKit을 사용하는 Gradle 플러그인 테스트에 영향을 미칩니다.

💡 쉬운 설명

컴퓨터의 임시 보관함이 누구나 파일을 넣고 뺄 수 있을 정도로 보안이 취약하게 설정된 문제입니다. 해커가 이 보관함에 가짜 파일을 몰래 넣어두어 사용자의 권한을 뺏을 수 있습니다.

🇺🇸 원문 (English)

In Gradle before version 7.0, on Unix-like systems, the system temporary directory can be created with open permissions that allow multiple users to create and delete files within it. Gradle builds could be vulnerable to a local privilege escalation from an attacker quickly deleting and recreating files in the system temporary directory. This vulnerability impacted builds using precompiled script plugins written in Kotlin DSL and tests for Gradle plugins written using ProjectBuilder or TestKit. If you are on Windows or modern versions of macOS, you are not vulnerable. If you are on a Unix-like operating system with the "sticky" bit set on your system temporary directory, you are not vulnerable. The problem has been patched and released with Gradle 7.0. As a workaround, on Unix-like operating systems, ensure that the "sticky" bit is set. This only allows the original user (or root) to delete a file. If you are unable to change the permissions of the system temporary directory, you can move the Java temporary directory by setting the System Property `java.io.tmpdir`. The new path needs to limit permissions to the build user only. For additional details refer to the referenced GitHub Security Advisory.

📍 영향받는 시스템

Gradle 7.0 미만 버전 (Unix-like OS 환경)

⚔️ 공격 벡터

로컬 사용자가 시스템 임시 디렉토리 내의 파일을 빠르게 삭제하고 재생성하여 권한을 탈취하는 방식

🛡️ 대응 방법

Gradle을 7.0 이상 버전으로 업데이트하거나, Unix 시스템의 임시 디렉토리에 'sticky bit'를 설정합니다.

🔧 검증 코드

명령어 결과에 Gradle 7.0 미만 버전이 출력되면 취약한 상태입니다.

Shell / Script
gradle -v 2>/dev/null | grep -E 'Gradle [0-6]\.'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Git