界: Security Features

ソフトウェアのセキュリティは、セキュリティ ソフトウェアではありません。ここでは、認証、アクセス制御、機密性、暗号化、権限管理などのトピックについて説明します。

Authentication Bad Practice: Missing Check against Protection Space

Abstract
NSURLConnection 委任は、アプリケーションが特定の保護領域における認証チャレンジの処理方法を認識していることを最初に確認しないで、認証チャレンジを処理します。
Explanation
NSURLProtectionSpace オブジェクトはサーバーや、一般にレルムと呼ばれる、認証を必要とするサーバー上の領域を表します。
保護領域に対して認証が必要となる URL 接続を確立する場合は、認証を実行する必要がある NSURLConnectionDelegate.connection(_:didReceive:) メソッドをコールする直前に、NSURLConnectionDelegate.connection(_:canAuthenticateAgainstProtectionSpace:) メソッドが呼び出されます。こうすることにより、NSURLConnectionDelegate は保護領域に対して認証を行う前に、この領域を調べることができます。デリゲートは true を返すことにより、connection(_:didReceive:) に対する以降のコール内で行われる認証形式が処理可能なことを示します。デリゲートがこのメソッドを実装せず、保護領域でクライアント証明書認証またはサーバー信頼認証が使用される場合は、ユーザーのキーチェーンを使用して認証されますが、これが目的の動作ではない可能性があります。
References
[1] connection(_:canAuthenticateAgainstProtectionSpace:) API documentation Apple
[2] URLProtectionSpace API documentation Apple
[3] Standards Mapping - General Data Protection Regulation (GDPR) Access Violation
[4] Standards Mapping - OWASP API 2023 API2 Broken Authentication
[5] Standards Mapping - OWASP Mobile 2024 M3 Insecure Authentication/Authorization
[6] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-AUTH-1
desc.structural.objc.authentication_bad_practice_missing_check_against_protection_space
Abstract
NSURLConnection 委任は、アプリケーションが特定の保護領域における認証チャレンジの処理方法を認識していることを最初に確認しないで、認証チャレンジを処理します。
Explanation
NSURLProtectionSpace オブジェクトはサーバーや、一般にレルムと呼ばれる、認証を必要とするサーバー上の領域を表します。
保護領域に対して認証が必要となる URL 接続を確立する場合は、認証を実行する必要がある NSURLConnectionDelegate.connection(_:didReceive:) メソッドをコールする直前に、NSURLConnectionDelegate.connection(_:canAuthenticateAgainstProtectionSpace:) メソッドが呼び出されます。こうすることにより、NSURLConnectionDelegate は保護領域に対して認証を行う前に、この領域を調べることができます。デリゲートは true を返すことにより、connection(_:didReceive:) に対する以降のコール内で行われる認証形式が処理可能なことを示します。デリゲートがこのメソッドを実装せず、保護領域でクライアント証明書認証またはサーバー信頼認証が使用される場合は、ユーザーのキーチェーンを使用して認証されますが、これが目的の動作ではない可能性があります。
References
[1] connection(_:canAuthenticateAgainstProtectionSpace:) API documentation Apple
[2] URLProtectionSpace API documentation Apple
[3] Standards Mapping - General Data Protection Regulation (GDPR) Access Violation
[4] Standards Mapping - OWASP API 2023 API2 Broken Authentication
[5] Standards Mapping - OWASP Mobile 2024 M3 Insecure Authentication/Authorization
[6] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-AUTH-1
desc.structural.swift.authentication_bad_practice_missing_check_against_protection_space