Security
8 min read
3297 views

HTTP Request Smuggling: 二つの言語を操りセキュリティを回避 🗣️

IT
InstaTunnel Team
Published by our engineering team
HTTP Request Smuggling: 二つの言語を操りセキュリティを回避 🗣️

HTTP request smugglingは、現代のアプリケーションインフラにおける最も高度で危険なウェブセキュリティ脆弱性の一つです。この攻撃手法は、ウェブプロキシとバックエンドサーバー間のHTTPリクエストの終了位置についての基本的な認識のズレを突き、攻撃者が悪意のあるリクエストを注入し、セキュリティコントロールを回避したり、キャッシュを汚染したり、正規のユーザーセッションを乗っ取ったりします。

基礎理解:HTTPがリクエスト境界を定義する仕組み

HTTP request smugglingを理解するには、まずHTTPリクエストがどのように長さを伝えるかを理解する必要があります。HTTPプロトコルは、リクエスト本文の終了位置を指定するために主に二つの仕組みを提供しています:Content-LengthヘッダーとTransfer-Encodingヘッダーです。

Content-Lengthヘッダーは、メッセージ本文のサイズをバイト単位で明示します。例えば、「Content-Length: 15」と記載されていると、受信サーバーはヘッダーに続く正確に15バイトのデータを読み取ります。

一方、Transfer-Encodingヘッダー、特に「chunked」に設定されている場合は、メッセージ本文が複数のチャンクに分割され、それぞれのサイズが16進数で前置きされます。チャンクサイズがゼロの場合は、メッセージの終端を示します。

HTTP仕様によると、両方のヘッダーが同じリクエストに存在する場合、サーバーはこれを拒否するか、Transfer-Encodingを優先すべきとされています。しかし、実運用ではこれらの標準から逸脱する実装も多く、これが脆弱性の原因となっています。

コア脆弱性:システム間の認識のズレ

HTTP request smugglingの脆弱性は、フロントエンドサーバー(ロードバランサー、リバースプロキシ、CDNなど)とバックエンドアプリケーションサーバーが同じHTTPリクエストを異なる解釈をする場合に発生します。現代のウェブアーキテクチャは複数のHTTP処理コンポーネントを連結しており、それぞれが独立してリクエストを解析する必要があります。

フロントエンドとバックエンドがリクエスト境界について意見が異なると、攻撃者は曖昧なリクエストを作成し、フロントエンドには一つの完全なリクエストとして見えつつ、バックエンドには二つの別々のリクエストとして解釈される状態を作り出せます。この非同期状態を利用し、悪意のある内容をセキュリティをすり抜けて「すり抜け」させることが可能です。

2025年3月には、AkamaiのインフラにおいてOPTIONSリクエストとExpectヘッダー、古い行折りたたみ技術を利用したrequest smugglingの脆弱性が発見されました。同様に、2025年4月にはCloudflareがPingoraプロキシの脆弱性を修正し、攻撃者がリクエストヘッダーやURLを書き換えることを可能にしていました。

攻撃のバリエーション:すり抜けの異なる言語

セキュリティ研究者は、HTTP request smugglingの主要なバリアントをいくつか特定しています。それぞれが異なるパースのズレを突いています:

CL.TE (Content-LengthからTransfer-Encodingへ)

このバリアントでは、フロントエンドはContent-Lengthヘッダーを基にリクエストを処理し、バックエンドはTransfer-Encodingを優先します。攻撃者は両方のヘッダーを含むリクエストを送信し、フロントエンドは一つの完全なリクエストとみなしますが、バックエンドは最初の部分だけを一つのリクエストと解釈し、残りを次のリクエストの開始とします。

TE.CL (Transfer-EncodingからContent-Lengthへ)

この攻撃は逆のシナリオです。フロントエンドはTransfer-Encodingを処理し、バックエンドはContent-Lengthに依存します。攻撃者は短いチャンクを宣言し、フロントエンドはそれを完全とみなしますが、追加の内容を含めることで、バックエンドはそれを別のリクエストと解釈します。

TE.TE (Transfer-Encodingの難読化)

両サーバーがTransfer-Encodingをサポートしていますが、攻撃者はスペースや大文字化、隠し文字などの難読化技術を使い、一方のサーバーに無視させることができます。これによりパースの不整合を引き起こします。

TE.0とCL.0 (ゼロ長バリアント)

2024年の研究では、バックエンドがTransfer-EncodingまたはContent-Lengthを完全に無視し、メッセージ本文の長さをゼロとみなす新たなバリアントが発見されました。これらはGoogle Cloudのウェブサイト数千に影響を与えるTE.0の脆弱性も含まれます。

破壊的な攻撃シナリオ

セキュリティコントロールの回避

HTTP request smugglingは、フロントエンドのセキュリティ対策を回避するのに優れています。多くの組織はアクセス制御や認証チェック、セキュリティスキャンを境界レベルで実施していますが、攻撃者はリクエストをすり抜けさせ、信頼されたフロントエンドインフラからのものと見せかけることが可能です。

例えば、管理機能をlocalhostからのリクエストに限定しているアプリケーションに対し、Hostヘッダーを改ざんしたリクエストをすり抜けさせ、バックエンドにローカルからのリクエストと誤認させることができます。

キャッシュ汚染攻撃

ウェブキャッシュは応答を保存し、パフォーマンス向上とサーバ負荷軽減に役立ちますが、HTTP request smugglingを利用してキャッシュを汚染し、悪意のあるコンテンツを配信させることも可能です。

典型的なキャッシュ汚染では、攻撃者はサーバーに予期しないコンテンツ(例:悪意のあるリダイレクト)を返すリクエストをすり抜けさせます。フロントエンドのキャッシュがこれを正規のリソースと誤認識すると、汚染されたレスポンスを保存します。その結果、そのJavaScriptファイルをリクエストするすべてのユーザーに悪意のある内容が配信され、クロスサイトスクリプティング攻撃に繋がる可能性があります。

キャッシュ汚染の影響は個々のユーザーを超え、キャッシュが期限切れになるか管理者が手動で無効化するまで、広範囲に悪意のあるコンテンツが拡散します。これにより、サービス拒否攻撃やペイロードの広範な配布手段となります。

リクエストの乗っ取りと資格情報窃盗

HTTP request smugglingの最も危険な応用の一つは、他のユーザーのリクエスト(セッションCookieや認証情報を含む)を捕捉することです。これは、現代のHTTPインフラにおけるコネクション再利用の仕組みを突いています。

多くのウェブシステムは、パフォーマンス向上のためにフロントエンドプロキシとバックエンドサーバー間で持続的な接続を維持しています。攻撃者が部分的なリクエストをすり抜けさせると、そのリクエストはバックエンドにキューイングされ、次に到着した正規のリクエストに「本文」として追加されます。

攻撃者はこのすり抜けたリクエストに、フォームフィールドを仕込むことで、その内容を後から取得し、他のユーザーのリクエストを完全に再現します。これにより、セッショントークンや認証ヘッダー、敏感なフォームデータを窃取し、攻撃者が任意のユーザーになりすますことが可能となります。

実世界の影響と最新の発見

セキュリティコミュニティは、主要なインフラコンポーネントにおけるHTTP request smugglingの脆弱性を継続的に発見しています。2024年には、gunicornやwebrickなどのウェブサーバーにおいても脆弱性が見つかっています。

Google Cloudの発見では、GoogleのLoad Balancerを利用する数千のウェブサイトが新たなTE.0バリアントに脆弱であることが判明し、Googleが以前にこの問題を修正していたことが確認され、報奨金8,500ドルが支払われました。

これらの事例は、HTTP request smugglingの脆弱性がアプリケーションコードではなくインフラに影響することを示しています。複数の組織が、プロキシやロードバランサー、CDNのパースの不整合により同時に脆弱になるケースが多いです。

検出と防止策

セキュリティ専門家向け

HTTP request smugglingの検出には、タイミングを利用した特殊なテスト技術が必要です。攻撃者は曖昧なリクエストを作成し、応答遅延を測定します。サーバーがタイムアウトや異常な遅延を示す場合、追加データを待っている可能性があります。

Burp SuiteのHTTP Request Smuggler拡張などの自動ツールを使えば、プローブリクエストを送信し、応答パターンを分析して脆弱性を検出できます。ただし、手動によるテストも新たなバリアントを見つけるために重要です。

開発者・運用チーム向け

HTTP request smugglingを防ぐには、システム間のパースの不整合を解消する必要があります:

リクエスト処理の正規化: すべてのインフラコンポーネントがHTTPヘッダーを一貫して解釈するよう設定します。これは最も効果的ですが、ハードウェアロードバランサーやソフトウェアアプリケーションサーバーが混在する環境では難しい場合があります。

HTTP/1.1の機能を無効化: Transfer-Encodingや持続的接続が不要な場合は無効にし、攻撃の対象を減らします。ただし、パフォーマンスに影響を与える可能性もあります。

HTTP/2のエンドツーエンド利用: HTTP/2はバイナリフレーミングを採用しており、HTTP/1.1の曖昧さを排除します。フロントエンドとバックエンドが両方ともHTTP/2のみで通信すれば、従来のすり抜け技術はほぼ無効化されます。

厳格なリクエスト検証: Content-LengthとTransfer-Encodingの両方を含むリクエストや、不審なヘッダー形式のリクエストを拒否する設定を行います。

コネクション再利用の無効化: 技術的に可能なら、バックエンドが異なるクライアント間でコネクションを再利用しない設定にすることで、リクエスト乗っ取りを防げますが、パフォーマンスは犠牲になります。

進化する脅威の状況

HTTP request smugglingの研究は継続的に進展しており、新しいバリアントや技術が次々に発見されています。2024年のTE.0の発見は、攻撃対象の表面が未だ完全に把握されていないことを示しています。

複雑化するウェブアーキテクチャ、複数層のプロキシやCDN、セキュリティ機器の存在は、多くのパースの不整合を生み出しています。マイクロサービスやサーバーレスの採用により、HTTP処理コンポーネントの数は増加し、攻撃の可能性も拡大しています。

クラウドプロバイダーは特に重要なターゲットとなっており、一つの脆弱性が多くの顧客アプリに影響を及ぼすため、研究の価値は高まっています。

結論

HTTP request smugglingは、プロトコルの曖昧さと実装の多様性から生じるセキュリティ課題の一例です。システム間の微妙な認識のズレを突くことで、攻撃者は高度なセキュリティ対策をも回避可能にします。

これらの脆弱性の発見と悪用には高度な技術が必要なため、従来はあまり注目されませんでしたが、セキュリティ研究者James Kettleは「至る所にあり、非常に未研究だ」と指摘しています。主要クラウドプラットフォームでの最近の高プロファイルな発見は、その指摘を裏付けています。

組織は、HTTP request smugglingの脆弱性はインフラ側に存在しやすいことを認識し、運用・セキュリティチームが検出と対策を担う必要があります。新しいインフラ導入や既存の更新後には、特にこれらの脆弱性に対する定期的なセキュリティ評価を行うことが重要です。

ウェブアーキテクチャの進化に伴い、セキュリティコミュニティはパースの不整合やプロトコルの曖昧さに対して警戒を続ける必要があります。次の大きなHTTP request smugglingのバリアントは、すでに存在し、研究者がその仕組みを解明するのを待っています。

Continue from this article into the most relevant product guides and workflows.

Related Topics

#HTTP request smuggling, HTTP request smuggling attack, request smuggling vulnerability, HTTP security vulnerability, web application security, CL.TE attack, TE.CL attack, TE.TE smuggling, Content-Length header attack, Transfer-Encoding attack, cache poisoning attack, HTTP desynchronization, proxy security vulnerability, backend server attack, reverse proxy security, how HTTP request smuggling works, prevent HTTP request smuggling, detect request smuggling attacks, HTTP request smuggling examples, HTTP request smuggling tutorial, bypass web application firewall, HTTP protocol security issues, request smuggling vs desync attack, HTTP/1.1 security vulnerabilities, web server parsing vulnerabilities, HTTP header manipulation, chunked transfer encoding, HTTP connection reuse, persistent connection attacks, HTTP parsing inconsistency, load balancer security, CDN security vulnerability, web proxy exploitation, HTTP protocol ambiguity, request boundary confusion, session hijacking attack, credential theft technique, cache poisoning method, security control bypass, request queue poisoning, HTTP response splitting, web cache deception, frontend backend desync, Burp Suite smuggling, HTTP smuggling detection, Cloudflare vulnerability, Akamai security, Google Cloud security, web server hardening, proxy configuration security, HTTP/2 migration security, penetration testing techniques, web security assessment, vulnerability research, OWASP security testing, application security testing, infrastructure security, DevSecOps security, red team techniques, web application firewall bypass, PCI DSS compliance, security best practices, cyber security threat, zero-day vulnerability, CVE HTTP smuggling, security patch management, infrastructure hardening, malicious request injection, HTTP protocol exploitation, web infrastructure attack, application layer security, network protocol vulnerability, server misconfiguration, web traffic manipulation, request parsing error, connection pooling attack, middleware vulnerability, what is HTTP request smuggling, how does request smuggling work, how to prevent HTTP smuggling attacks, what causes request smuggling vulnerabilities, how to detect HTTP smuggling, is my website vulnerable to request smuggling, what are CL.TE and TE.CL attacks, how dangerous is HTTP request smuggling, can WAF prevent request smuggling, what is cache poisoning via smuggling, OWASP Top 10, web security vulnerabilities 2025, latest cybersecurity threats, critical web vulnerabilities, advanced hacking techniques, enterprise security threats, cloud security issues, modern web attacks, secure coding practices, HTTP implementation security, web framework security, API security best practices, microservices security, threat detection, incident response, security monitoring, vulnerability management, security operations, server configuration, proxy setup security, load balancer configuration, CDN security settings, Cross-Site Scripting, SQL Injection, CSRF, SSRF, XXE, insecure deserialization, security misconfiguration, API security, cybersecurity, application security, infosec, appsec, web security, network security, cloud security, devsecops, bug bounty, ethical hacking, cyber defense, security operations, information security, data security, threat intelligence, security engineering, security awareness, vulnerability assessment, security testing, red teaming, blue teaming, security research, penetration testing, web application penetration testing, OWASP testing, security controls, access control bypass, authentication bypass, authorization bypass, HTTP smuggling mitigation, request smuggling defense, web server security best practices, proxy security configuration, load balancer hardening, CDN security hardening, HTTP/2 security, protocol security, network layer attack, application layer attack, man in the middle attack, request interception, response manipulation, cache manipulation, session management attack, token theft, cookie theft, header injection, HTTP header smuggling, request splitting, desync attack, queue poisoning, connection hijacking, request hijacking, response queue poisoning, timing attack, side channel attack, infrastructure attack, cloud infrastructure security, serverless security, container security, Kubernetes security, Docker security, microservices architecture security, API gateway security, service mesh security, reverse proxy hardening, forward proxy security, transparent proxy security, SSL/TLS termination security, load balancing security, traffic routing security, request routing attack, URL manipulation, path traversal via smuggling, virtual host confusion, host header attack, HTTP method tampering, protocol downgrade attack, HTTP smuggling tools, security testing tools, Burp Suite extensions, OWASP ZAP, web security scanner, vulnerability scanner, automated security testing, manual penetration testing, security code review, threat modeling, risk assessment, security compliance, regulatory compliance, security audit, security monitoring tools, intrusion detection, intrusion prevention, web application firewall, WAF bypass techniques, security information and event management, SIEM, security orchestration, incident response automation, threat hunting, security analytics, log analysis, anomaly detection, behavioral analysis, attack detection, exploit detection, payload detection, malicious traffic detection, security baseline, hardening guidelines, CIS benchmarks, security frameworks, NIST cybersecurity framework, ISO 27001, security governance, security policy, security standards, best practices documentation, security training, security awareness training, developer security training, secure development lifecycle, security by design, shift left security, continuous security, security automation, security pipeline, CI/CD security, deployment security, production security, runtime security, application runtime protection, web application firewall rules, custom WAF rules, security rule tuning, false positive reduction, attack signature, threat signature, security patterns, attack patterns, exploit patterns, vulnerability patterns, security intelligence, threat intelligence feeds, indicator of compromise, tactics techniques procedures, attack vectors, threat actors, advanced persistent threat, nation state attack, cybercrime, ransomware, data breach, security incident, data exfiltration, privilege escalation, lateral movement, persistence mechanism, command and control, backdoor, web shell, remote code execution, arbitrary code execution, denial of service, distributed denial of service, resource exhaustion, application DoS, HTTP flood, slowloris attack, slow HTTP attack, keep alive attack

Keep building with InstaTunnel

Read the docs for implementation details or compare plans before you ship.

Share this article

More InstaTunnel Insights

Discover more tutorials, tips, and updates to help you build better with localhost tunneling.

Browse All Articles