容易猜測的 Web SQL 數據庫名稱可導致未經授權的人竊取數據和破壞數據庫。
HTML5 的一項功能是在客戶端 SQL 數據庫存儲數據。數據庫名稱是開始寫入數據庫或從數據庫讀取所需的重要信息。因此,數據庫名稱必須是每位用戶特有的唯一字符串。如果數據庫名稱很容易被猜出,未經授權的人(例如其他用戶)可能會竊取敏感數據或損壞數據庫條目。
例:以下代碼使用了容易被猜出的數據庫名稱:
...
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
...
'mydb' 的人都能夠訪問它。
[1] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A7 Insecure Cryptographic Storage
[2] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A8 Insecure Cryptographic Storage
[3] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A8 Insecure Storage
[4] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3150.2 CAT II
[5] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3150.2 CAT II
[6] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 330
[7] HTML5 Security Cheatsheet
[8] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Information Leakage
[9] Standards Mapping - FIPS200 - (FISMA) MP
[10] Standards Mapping - SANS Top 25 2009 - (SANS 2009) Porous Defenses - CWE ID 330
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.3.1.3, Requirement 6.5.8
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.3
[13] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.8