<dd id="sga4y"><optgroup id="sga4y"></optgroup></dd>
<nav id="sga4y"><code id="sga4y"></code></nav>
  • <optgroup id="sga4y"></optgroup>

    Unsafe Mobile Code: Database Access

    ABSTRACT

    在不可信賴的環境中執行 JDBC 數據庫操作的 Applet 會危及數據庫憑證安全。

    EXPLANATION

    默認情況下,允許 Java Applet 將數據庫連接打開回它們從其下載的服務器。在可信賴的環境中,這是可接受的;然而,在不可信賴的環境中,攻擊者可能會使用 Applet 查找數據庫憑證,并最終獲得對數據庫的直接訪問。


    例 1:以下代碼顯示在 applet 中使用的硬編碼的數據庫密碼。


    public class CustomerServiceApplet extends JApplet
    {
    public void paint(Graphics g)
    {
    ...
    conn = DriverManager.getConnection ("jdbc:mysql://db.example.com/customerDB", "csr", "p4ssw0rd");
    ...


    具有硬編碼的 JDBC 憑證的 Applet 用戶可以容易地找到憑證,因為 Applet 代碼已下載到客戶端。此外,如果通過未加密的通道建立數據庫連接,那么能夠在網絡上截取信息流的任何人也可以獲得這些憑證。最后,允許用戶直接連接到數據庫會暴露可公開訪問的數據庫服務器,這使得攻擊者能夠將該數據庫作為直接網絡攻擊的目標。

    REFERENCES

    [1] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 305

    [2] JDBC Guide:Getting Started - Security Considerations Sun Microsystems, Inc.


    Copyright 2013 Fortify Software - All rights reserved.
    (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
    desc.structural.java.unsafe_mobile_code_database_access

    97av