0
我使用“查找安全错误”插件FindBugs的:https://find-sec-bugs.github.io/如何删除“污点”为FindBugs的“查找安全错误”
很多探测器都使用“污点分析”,以提高他们的警告。
有没有关于如何从值中删除“污点”的任何文档?
我找不到这方面有任何文档在其网站上,我一直在围绕他们的源代码戳,不能弄明白:
- src/main/java/com/h3xstream/findsecbugs/taintanalysis
- src/main/resources/taint-config
- 参见 0:this wiki page "Injection detection"
将刀具从像码识别一个可能的注射错误
import javax.ws.rs.core.Response;
import org.apache.http.client.methods.HttpGet;
public Response get(String x, String y) throws IOException {
String url = String.format("%s/%s",
x,
y);
HttpGet request = new HttpGet(url); // HERE
...
}
我有固定的这个错误让我满意的有:
import javax.ws.rs.core.Response;
import org.apache.http.client.methods.HttpGet;
import static com.google.common.net.UrlEscapers.urlPathSegmentEscaper;
public Response get(String x, String y) throws IOException {
String url = String.format("%s/%s",
urlPathSegmentEscaper().escape(x),
urlPathSegmentEscaper().escape(y));
HttpGet request = new HttpGet(url);
...
}
...但工具仍是萎靡不振的一个可能的错误。我相信这是因为它不承认“com.google.common.net.UrlEscapers.urlPathSegmentEscaper()
”在这里消除污点。
我该如何说服它呢? 如果我不能,那么我可以在这里使用什么消毒技术,该工具可以识别?