此規則會偵測是否使用 WebLogic setAttribute 和 getAttribute 屬性來剖析 XML。 此規則會偵測 Java 程式碼。 個別規則會偵測是否使用啟用了此特性的 WebLogic weblogic.servlet.XMLParsingHelper。
範例:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", someObject)
範例:
String handler = "org.xml.sax.helpers.DefaultHandler";
request.setAttribute(handler, someObject);
範例:Document myDocument = request.getAttribute("org.w3c.dom.Document")
範例:
String handler = "org.w3c.dom.Document";
Document myDoc = request.getAttribute(handler);
範例:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", myHandler);
request.getAttribute("org.w3c.dom.Document");
將快速修正程式套用至上述行時,會刪除這些行。
附註:如果物件 myHandler 以後會用在程式碼中,請驗證是否採用其他方式起始設定了該物件。
範例:
Document myDocument = request.getAttribute("org.w3c.dom.Document");
套用快速修正程式時,會將上述程式碼變更成:
Document myDocument;
附註:如果物件 myDocument 以後會用在程式碼中,請驗證是否採用其他方式起始設定了該物件。