<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    如何消除VeraCode檢測中的CRLF Injection Issue(CWE ID 117)

    Veracode是一個檢測應用程序是否存在安全漏洞的工具,更多細節請訪問http://www.veracode.com

    這里主要總結一下如何消除Veracode檢測結果中的CRLF(Carriage Return, Line Feed) Injection Issue(CWE ID 117)。

    首先,先看看VeraCode對CRLF Injection Issue的定義:
    The acronym CRLF stands for "Carriage Return, Line Feed" and refers to the sequence of characters used to denote the end of a line of text.  CRLF injection vulnerabilities occur when data enters an application from an untrusted source and is not properly validated before being used.  For example, if an attacker is able to inject a CRLF into a log file, he could append falsified log entries, thereby misleading administrators or cover traces of the attack.  If an attacker is able to inject CRLFs into an HTTP response header, he can use this ability to carry out other attacks such as cache poisoning.  CRLF vulnerabilities primarily affect data integrity.

    再看卡VeraCode對如何解決這個問題的建議:
    Apply robust input filtering for all user-supplied data, using centralized data validation routines when possible.  Use output filters to sanitize all output derived from user-supplied input, replacing non-alphanumeric characters with their HTML entity equivalents.

    舉例:
    log.debug("xxxxxxxxxxxxxx");
    //這里的xxxxx部分內容可能是從環境變量或者外部獲取的,所以Veracode認為存在CRLF的安全隱患。

    通過對現有系統的實踐證明,對于這類CRLF Injection Issue,消除時主要遵循以下原則:

    1)使用Character.isISOControl去除變量中的ctrl類控制符
    2) 驗證后返回新的字符串變量

      
    public static final String removeControlCharacter(String input)
        {
            
    if (input == null)
            {
                
    return "";
            }
            StringBuilder sb 
    = new StringBuilder();
            
    for (int i=0; i<input.codePointCount(0, input.length()); i++)
            {
                
    int codePoint = input.codePointAt(i);
                
    if(!Character.isISOControl(codePoint))
                {
                    sb.appendCodePoint(codePoint);
                }
            }
            
    return sb.toString();
        }
        
    修改后如下所示:
    log.debug(FileUtil.removeControlCharacter("xxxxxxxxxxxxxx"));

    posted on 2011-09-06 10:49 想飛就飛 閱讀(2187) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    公告


    導航

    <2011年9月>
    28293031123
    45678910
    11121314151617
    18192021222324
    2526272829301
    2345678

    統計

    常用鏈接

    留言簿(13)

    我參與的團隊

    隨筆分類(69)

    隨筆檔案(68)

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 全部免费毛片在线| 在线免费观看一级片| 亚洲日韩国产精品第一页一区| 亚洲综合精品成人| 成人在线免费观看| 亚洲精品伦理熟女国产一区二区| 免费观看黄网站在线播放| 亚洲一区中文字幕在线电影网 | 亚洲成av人影院| 野花香高清视频在线观看免费| 亚洲精品tv久久久久久久久 | 亚洲精品国产成人99久久| 无码AV片在线观看免费| 亚洲欧洲国产成人精品| 成人无遮挡毛片免费看| 国产偷国产偷亚洲高清在线 | 亚洲精品国产啊女成拍色拍| 亚洲香蕉免费有线视频| 日韩亚洲国产综合高清| 四虎AV永久在线精品免费观看| 全部一级一级毛片免费看| 亚洲日韩国产成网在线观看| 黄色片免费在线观看| 亚洲日韩乱码中文无码蜜桃 | 国产精品视频免费一区二区三区 | 久久免费精彩视频| 亚洲精品综合在线影院| 国产免费69成人精品视频| 国产一级高青免费| 亚洲人成网站在线观看播放青青| 在线免费观看国产视频| 久久免费国产精品| 亚洲婷婷第一狠人综合精品| 亚洲精品成人区在线观看| 免费国产黄网站在线观看可以下载| 久久久久久亚洲精品影院| 亚洲国产综合精品一区在线播放| 日韩在线永久免费播放| 国产亚洲日韩在线a不卡| 亚洲AV无码成人网站久久精品大| 成年女人色毛片免费看|