<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)

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 成人精品国产亚洲欧洲| 色妞www精品视频免费看| 亚洲综合偷自成人网第页色 | 青青草原亚洲视频| 色噜噜狠狠色综合免费视频| 国内自产拍自a免费毛片| 五月婷婷亚洲综合| 亚洲av片在线观看| 国产一区在线观看免费| 99人中文字幕亚洲区| 亚洲精品久久无码| 18女人水真多免费高清毛片| 亚洲视频在线视频| 中国在线观看免费国语版| 亚洲av无码潮喷在线观看| 久久这里只精品99re免费| 亚洲Av综合色区无码专区桃色| 中国一级特黄的片子免费| 亚洲国产精品无码一线岛国| 国产午夜亚洲精品| 国产精品视频免费一区二区三区| 亚洲av永久无码精品秋霞电影秋| 免费人妻av无码专区| 亚洲色一区二区三区四区| 国产又大又粗又硬又长免费| 一级毛片**免费看试看20分钟| 久久电影网午夜鲁丝片免费| 亚洲精品视频观看| 久久久久成人片免费观看蜜芽| 综合自拍亚洲综合图不卡区| 一二三四在线播放免费观看中文版视频| 亚洲变态另类一区二区三区| 久久久久亚洲AV综合波多野结衣| 久久综合国产乱子伦精品免费| 亚洲伦理中文字幕| 91麻豆精品国产自产在线观看亚洲| 69视频免费观看l| 久久综合亚洲色HEZYO社区| 18禁成年无码免费网站无遮挡| av午夜福利一片免费看久久| 国产a v无码专区亚洲av|