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

    Null Dereference

    ABSTRACT

    程序可能會間接引用一個 Null 指針,從而引起NullException

    EXPLANATION

    空指針錯誤通常是由于違反了一個或者多個程序員的假設而造成的。

    大部分空指針問題只會引起一般的軟件可靠性問題,但如果攻擊者能夠故意觸發空指針間接引用,該攻擊者就有可能利用引發的異常繞過安全邏輯,或致使應用程序泄漏調試信息,這些調試信息對于規劃隨后的攻擊具有利用價值。

    例 1:在下面的代碼中,程序員假定系統始終會定義一個名為 cmd 的屬性。如果攻擊者能夠控制程序環境以使“cmd”變成未定義的屬性,那么程序會在嘗試調用 Trim() 方法時拋出一個 Null 指針異常。


    string cmd = null;
    ...
    cmd = Environment.GetEnvironmentVariable("cmd");
    cmd = cmd.Trim();

    REFERENCES

    [1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A9 Application Denial of Service

    [2] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP6080 CAT II

    [3] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP6080 CAT II

    [4] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 476

    [5] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.9


    Copyright 2013 Fortify Software - All rights reserved.
    (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
    desc.controlflow.dotnet.null_dereference

    97av