我們在我們的spring webapp中添加了一個篩選器,它檢查所有傳入的請求是否有可能導致XSS漏洞的任何事情。然而,當它試圖寫入日誌,我們可以得到以下堆棧跟蹤:ESAPI在嘗試記錄警告時拋出org.owasp.esapi.errors.ConfigurationException
com.blah.blah.web.controllers.ExceptionLoggingController - ERROR: Exception: code=500,uri=/post.html,servlet=dispatch,class=org.owasp.esapi.errors.ConfigurationException,from=1.2.3.4,message=Request processing failed; nested exception is org.owasp.esapi.errors.ConfigurationException: java.lang.IllegalArgumentException: Classname cannot be null or empty. HTTPUtilities type name cannot be null or empty.
org.owasp.esapi.errors.ConfigurationException: java.lang.IllegalArgumentException: Classname cannot be null or empty. HTTPUtilities type name cannot be null or empty.
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:105)
at org.owasp.esapi.ESAPI.httpUtilities(ESAPI.java:121)
at org.owasp.esapi.ESAPI.currentRequest(ESAPI.java:70)
at org.owasp.esapi.reference.JavaLogFactory$JavaLogger.log(JavaLogFactory.java:308)
at org.owasp.esapi.reference.JavaLogFactory$JavaLogger.warning(JavaLogFactory.java:242)
at org.owasp.esapi.reference.DefaultEncoder.canonicalize(DefaultEncoder.java:181)
at org.owasp.esapi.reference.DefaultEncoder.canonicalize(DefaultEncoder.java:120)
at com.blah.blah.web.MyFilter.removeXSS(MyFilter.java:26)
我在classpath ESAPI.properties,這似乎是工作,不然,那確實有配置的「失蹤」類:
ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities
DefaultHTTPUtilities也位於類路徑中。
也許ESAPI.properties位於多個位置。您是否可以刪除您知道正在運行的屬性,並查看它是否檢查您的更改是否由ESAPI庫提取。 – randominstanceOfLivingThing
你可以在本地機器上運行應用程序嗎? – avgvstvs