界: Environment

このセクションには、ソース コード以外のものでも、作成中の製品のセキュリティにとって重要なものがすべて含まれています。この分野が対象とする問題は、ソース コードに直接関係しないため、この分野の他の部分と分けました。

J2EE Misconfiguration: Insufficient Session ID Length

Abstract
ブルートフォース セッション推測攻撃を防ぐために、セッション識別子は少なくとも 128 ビット長である必要があります。
Explanation
WebLogic デプロイメント ディスクリプターでは、少なくとも 24 バイトのセッション識別子の長さを指定する必要があります。セッション識別子を短くすると、アプリケーションがブルートフォース セッション推測攻撃を受けやすくなります。攻撃者が認証されたユーザーのセッション識別子を推測できる場合、そのユーザーのセッションを乗っ取ることができます。この説明の残りの部分では、24 バイトのセッション ID のバックオブエンベロープ正当化について詳しく説明します。

セッション ID は、62 文字の英数字の擬似乱数が選択されて構成されます。つまり、文字列が真にランダムな方法で構成されているとしたら、各バイトから最大 6 ビットのエントロピが生じることになります。

有効なセッション識別子を推測するために必要な秒数は、次の式で予測できます:

(2^B+1) / (2*A*S)

ここで:

- B は、セッション識別子のエントロピーのビット数です。

- A は、攻撃者が 1 秒間に試行する可能性のある推測の数です。

- S は、有効であり、いつでも推測できる、有効なセッション ID の数です。

セッション識別子のエントロピーのビット数は、常にセッション識別子の合計ビット数よりも少なくなります。たとえば、セッション ID が昇順で提供された場合、ID の長さに関係なく、セッション ID にはゼロ ビットに近いエントロピーがあります。セッション識別子が多くの乱数を使用して生成されていると仮定すると、セッション識別子のエントロピーのビット数は、セッション識別子の合計ビット数の半分であると推定されます。現実的な識別子の長さについて、これは可能ですが、おそらく楽観的です。

攻撃者が数百または数千のドローン コンピューターでボットネットを使用する場合、1 秒間に数万の推測を試みる可能性があると想定するのが妥当です。対象となる Web サイトが大規模で、人気がある場合、大量の推測がしばらくの間見過ごされる可能性があります。

推測が可能な、有効なセッション識別子の数の下限は、任意の時点でサイトでアクティブなユーザーの数です。ただし、ユーザーがログアウトせずにセッションを放棄した場合は、この数が増えます(これは、非アクティブなセッションのタイムアウトを短くする理由の 1 つです)。

64 ビットのセッション識別子を使用し、32 ビットのエントロピーを想定します。大規模な Web サイトの場合、攻撃者が 1 秒あたり 1,000 回の推測を試みる可能性があり、任意の時点で 10,000 個の有効なセッション識別子があると想定します。これらの想定では、攻撃者が有効なセッション識別子の推測に成功するまでの時間は 4 分未満と推測されます。

次に、64 ビットのエントロピーを提供する 128 ビットのセッション識別子を想定します。非常に大規模な Web サイトで、攻撃者が 1 秒あたり 10,000 回の推測を試みる可能性があり、100,000 個の有効なセッション識別子があると想定します。これらの想定では、攻撃者が有効なセッション識別子の推測に成功するまでの時間は 292 年を超えると推測されます。

ビットからバイトへと逆方向に作業すると、セッション識別子は 128/6 である必要があり、これにより約 21 バイトが生成されます。さらに、経験的テストでは、セッション識別子の最初の 3 バイトがランダムに生成されていないように見えることが示されています。つまり、目的の 64 ビットのエントロピーを実現するには、24 バイトの長さのセッション識別子を使用するように WebLogic を設定する必要があります。
References
[1] Standards Mapping - Common Weakness Enumeration CWE ID 6
[2] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001941, CCI-001942
[3] Standards Mapping - FIPS200 IA
[4] Standards Mapping - General Data Protection Regulation (GDPR) Access Violation
[5] Standards Mapping - NIST Special Publication 800-53 Revision 4 IA-2 Identification and Authentication (Organizational Users) (P1), SC-23 Session Authenticity (P1)
[6] Standards Mapping - NIST Special Publication 800-53 Revision 5 IA-2 Identification and Authentication (Organizational Users), SC-23 Session Authenticity
[7] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[8] Standards Mapping - OWASP Application Security Verification Standard 4.0 14.1.3 Build (L2 L3)
[9] Standards Mapping - OWASP Mobile 2014 M9 Improper Session Handling
[10] Standards Mapping - OWASP Top 10 2004 A3 Broken Authentication and Session Management
[11] Standards Mapping - OWASP Top 10 2007 A7 Broken Authentication and Session Management
[12] Standards Mapping - OWASP Top 10 2010 A3 Broken Authentication and Session Management
[13] Standards Mapping - OWASP Top 10 2013 A2 Broken Authentication and Session Management
[14] Standards Mapping - OWASP Top 10 2017 A2 Broken Authentication
[15] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.3
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.5.7
[18] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.8
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.10
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.10
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.10
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.10
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[24] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[25] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[26] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection
[27] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection
[28] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3405 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3405 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3405 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3405 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3405 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3405 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3405 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[36] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[37] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[38] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[39] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[40] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[41] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[42] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[43] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[44] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[45] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[46] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[47] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[48] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[49] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II
[50] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-001620 CAT II, APSC-DV-001630 CAT II, APSC-DV-002290 CAT II
[51] Standards Mapping - Web Application Security Consortium Version 2.00 Insufficient Authentication (WASC-01)
[52] Standards Mapping - Web Application Security Consortium 24 + 2 Insufficient Authentication
desc.config.java.j2ee_misconfiguration_insufficient_session_id_length