<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 想飛就飛 閱讀(2194) 評論(0)  編輯  收藏


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


    網站導航:
     

    公告


    導航

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

    統計

    常用鏈接

    留言簿(13)

    我參與的團隊

    隨筆分類(69)

    隨筆檔案(68)

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 久久精品国产亚洲AV不卡| 国产国产人免费人成免费视频| 色偷偷噜噜噜亚洲男人| 青娱乐在线视频免费观看| 国语成本人片免费av无码| 免费大学生国产在线观看p| 久久被窝电影亚洲爽爽爽| 中文字幕手机在线免费看电影 | 成人无码精品1区2区3区免费看 | 国产一精品一av一免费爽爽| 人妻视频一区二区三区免费| 国产精品亚洲片在线va| 国内自产拍自a免费毛片| 日本亚洲欧美色视频在线播放| 国产三级电影免费观看| 亚洲综合激情视频| 一区二区三区在线免费观看视频| 免费视频专区一国产盗摄| 亚洲乱码在线卡一卡二卡新区| 午夜视频在线观看免费完整版| 毛片亚洲AV无码精品国产午夜 | 成人午夜18免费看| 久久精品国产亚洲AV网站| 国产亚洲精品精品精品| 99久久免费精品视频| 亚洲国产精品综合一区在线| 成人免费无码大片A毛片抽搐色欲| 亚洲aⅴ天堂av天堂无码麻豆| 免费在线观看中文字幕| 久久精品免费一区二区三区| 亚洲伊人久久精品| 精品熟女少妇av免费久久| 久久精品国产精品亚洲艾草网美妙| 日韩免费高清播放器| 亚洲三级视频在线| 亚洲国产精品自产在线播放 | 一个人晚上在线观看的免费视频| 中文字幕一精品亚洲无线一区 | 成人免费视频国产| 在线涩涩免费观看国产精品 | 婷婷国产偷v国产偷v亚洲|