这段代码:
InternetAddress[] myAdrs = getAdrs(message.getToAddresses());
for (int i = 0; i < myAdrs.length; i++) {
String s = myAdrs[i].getAddress();
s = s.replace("\r","").replace("\n","").replace("%0A","").replace("%0a","").replace("%0D","").replace("%0d","");
InternetAddress adr = new InternetAddress( s, false );
// --> Improper Neutralization of CRLF Sequences ('CRLF Injection') (CWE ID 93)
lMessage.addRecipient(Message.RecipientType.TO, adr);
}
仍然给我 CWE ID 93 虽然我用 s=s.replace(\r.... 删除了 s 中的任何不需要的字符串。这个缺陷?我错过了什么?任何提示将不胜感激!