界: Encapsulation
封裝是要劃定清楚的界限。在網頁瀏覽器中,這可能意味著確保您的行動程式碼不會被其他行動程式碼濫用。在伺服器上,這可能意味著區分經過驗證的資料與未經驗證的資料、區分一個使用者的資料與另一個使用者的資料,或區分允許使用者查看的資料與不允許查看的資料。
HTML5: Easy-to-Guess Database Name
Abstract
易猜的 Web SQL 資料庫名稱可能會導致資料失竊以及資料庫被未授權的對象毀損。
Explanation
HTML5 的功能之一便是在用戶端 SQL 資料庫儲存資料的能力。開始從資料庫寫入和讀取時,最重要的資訊就是其名稱。因此,各使用者的資料庫名稱必須為唯一字串。如果資料庫名稱很容易猜中,那麼未授權的對象 (如其他使用者) 便可能偷取敏感資料或毀損資料庫項目。
範例:下列程式碼使用了易於猜中的資料庫名稱:
此程式碼將成功執行,但能夠猜到資料庫名稱為
範例:下列程式碼使用了易於猜中的資料庫名稱:
...
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
...
此程式碼將成功執行,但能夠猜到資料庫名稱為
'mydb'
的人都可以加以存取。References
[1] HTML5 Security Cheatsheet
[2] Standards Mapping - Common Weakness Enumeration CWE ID 330
[3] Standards Mapping - FIPS200 MP
[4] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[5] Standards Mapping - NIST Special Publication 800-53 Revision 4 SC-28 Protection of Information at Rest (P1)
[6] Standards Mapping - NIST Special Publication 800-53 Revision 5 SC-28 Protection of Information at Rest
[7] Standards Mapping - OWASP Mobile 2014 M5 Poor Authorization and Authentication
[8] Standards Mapping - OWASP Mobile 2024 M3 Insecure Authentication/Authorization
[9] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-AUTH-1
[10] Standards Mapping - OWASP Top 10 2004 A8 Insecure Storage
[11] Standards Mapping - OWASP Top 10 2007 A8 Insecure Cryptographic Storage
[12] Standards Mapping - OWASP Top 10 2010 A7 Insecure Cryptographic Storage
[13] Standards Mapping - OWASP Top 10 2013 A6 Sensitive Data Exposure
[14] Standards Mapping - OWASP Top 10 2017 A3 Sensitive Data Exposure
[15] Standards Mapping - OWASP Top 10 2021 A02 Cryptographic Failures
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.8
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.3, Requirement 6.5.8
[18] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.3
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.3
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.3
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.3
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.3
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[24] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 7 - Use of Cryptography
[25] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 7 - Use of Cryptography
[26] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 7 - Use of Cryptography
[27] Standards Mapping - SANS Top 25 2009 Porous Defenses - CWE ID 330
[28] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3150.2 CAT II
[29] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3150.2 CAT II
[30] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3150.2 CAT II
[31] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3150.2 CAT II
[32] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3150.2 CAT II
[33] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3150.2 CAT II
[34] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3150.2 CAT II
[35] Standards Mapping - Web Application Security Consortium Version 2.00 Predictable Resource Location (WASC-34)
[36] Standards Mapping - Web Application Security Consortium 24 + 2 Information Leakage
desc.structural.javascript.html5_easy_to_guess_database_name