🔍 CVE-2026-35549

6.5
CVSS Score
MEDIUM
2026-04-03
2026-07-24 21:10
✅ 완료

🇰🇷 한글 설명

MariaDB Server의 특정 버전에서 'caching_sha2_password' 인증 플러그인을 사용할 때, 'sha256_crypt_r' 함수가 'alloca'를 통해 스택 메모리를 할당하는 과정에서 매우 큰 패킷을 수신할 경우 스택 오버플로우가 발생하여 서버가 충돌(Crash)할 수 있는 취약점이 발견되었습니다.

💡 쉬운 설명

MariaDB 서버의 로그인 인증 과정에서 공격자가 매우 큰 데이터를 보내면 서버가 이를 처리하지 못하고 강제로 종료되는 문제입니다. 특정 인증 방식(caching_sha2_password)을 사용하는 환경에서 발생하며, 서비스 중단(DoS)을 유발할 수 있습니다.

🇺🇸 원문 (English)

An issue was discovered in MariaDB Server before 11.4.10, 11.5.x through 11.8.x before 11.8.6, and 12.x before 12.2.2. If the caching_sha2_password authentication plugin is installed, and some user accounts are configured to use it, a large packet can crash the server because sha256_crypt_r uses alloca.

📍 영향받는 시스템

MariaDB Server 11.4.10 미만, 11.5.x ~ 11.8.6 미만, 12.x ~ 12.2.2 미만 버전

⚔️ 공격 벡터

공격자가 'caching_sha2_password' 플러그인을 사용하는 사용자 계정으로 인증 요청을 보낼 때, 비정상적으로 큰 크기의 패킷을 전송하여 서버의 스택 메모리를 고갈시키고 프로세스를 충돌시킵니다.

🛡️ 대응 방법

MariaDB Server를 보안 패치가 적용된 최신 버전(11.4.10, 11.8.6, 12.2.2 또는 그 이상)으로 업데이트하십시오.

🔧 검증 코드

이 코드는 Python 3 환경에서 실행 가능합니다. MariaDB 서버가 설치된 Linux 시스템에서 실행해야 하며, `mariadb -V` 명령어와 `information_schema.plugins` 테이블에 접근할 수 있는 권한(예: root 권한 또는 .my.cnf 설정)이 필요합니다. 실행 전 `mariadb` 클라이언트 도구가 설치되어 있는지 확인하십시오.

Shell / Script
import subprocess
import re
import json

def get_mariadb_version():
    try:
        result = subprocess.check_output(['mariadb', '-V'], stderr=subprocess.STDOUT).decode()
        match = re.search(r'MariaDB (\d+\.\d+(\.\d+)?)', result)
        return match.group(1) if match else None
    except Exception:
        return None

def is_plugin_enabled():
    try:
        # This requires the user to have access to the database without a password or via .my.cnf
        cmd = ['mariadb', '-e', 'SELECT plugin_name FROM information_schema.plugins WHERE plugin_name = "caching_sha2_password";']
        result = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode()
        return 'caching_sha2_password' in result
    except Exception:
        return False

def compare_versions(current, fixed):
    c_parts = [int(x) for x in current.split('.')]
    f_parts = [int(x) for x in fixed.split('.')]
    for i in range(min(len(c_parts), len(f_parts))):
        if c_parts[i] < f_parts[i]: return True
        if c_parts[i] > f_parts[i]: return False
    return len(c_parts) < len(f_parts)

version = get_mariadb_version()
if not version:
    print(json.dumps({"result": "양호", "reason": "MariaDB가 설치되어 있지 않거나 버전을 확인할 수 없습니다."}))
    exit()

plugin_active = is_plugin_enabled()

# Vulnerability ranges
vulnerable = False
if version.startswith('11.4') and compare_versions(version, '11.4.10'):
    vulnerable = True
elif version.startswith('11.5') or version.startswith('11.6') or version.startswith('11.7') or (version.startswith('11.8') and compare_versions(version, '11.8.6')):
    vulnerable = True
elif version.startswith('12') and compare_versions(version, '12.2.2'):
    vulnerable = True

if vulnerable and plugin_active:
    print(json.dumps({"result": "취약", "reason": f"설치된 버전({version})이 취약한 범위에 있으며 caching_sha2_password 플러그인이 활성화되어 있습니다."}))
elif vulnerable:
    print(json.dumps({"result": "양호", "reason": f"버전({version})은 취약 범위에 있으나, caching_sha2_password 플러그인이 사용되지 않고 있습니다."}))
else:
    print(json.dumps({"result": "양호", "reason": f"설치된 버전({version})은 보안 패치가 적용된 버전입니다."}))

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

MariaDB