ESAPI.securityConfiguration().setResourceDirectory(...) not considered anymore in loading of configuration via classloader #745
-
We set the directory for locating the ESAPI.properties within our resources in the following way.
Using ESAPI <= version 2.1 this perfectly worked fine. It does not work from ESAPI >= 2.2 on. Version 2.1 So the resource directory that is set by "ESAPI.securityConfiguration().setResourceDirectory(...);" is not considered anymore. To me this seems like a bug.(?) Why is it not possible anymore to locate the ESAPI,properties resource file by defining the resource directory? (Maybe you want to know why we do need this: our library has to work with different ESAPI releases, so we analyse which ESAPI version is loaded within the runtime environment and then decide if to use the one or the other ESAPI.properties file by setting the correpsonding direcotry.) Thanks + Regards! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
It does appear that uses of the reference From what I can tell from the workflow you've provided, the runtime is expecting your content to be located at We will most likely need to look at the commits around this work to determine if this was a deliberate change, or a bug that will need to be addressed. Possible Quickfix That should fall into the workflow for the " // try esapi folder (new directory)" in the block just above the resourceDirectory check in
|
Beta Was this translation helpful? Give feedback.
-
@nettermensch - I'm have not yet researched why we changed this, but if since we have accidentally made Please go ahead and create a GitHub issue for this. (If you wish, you can just create it with a Summary title and reference this discussion for details.) As for a temporary workaround, I might suggest setting the Note: We do not back-port bug fixes to previous minor versions (we just don't have the bandwidth), so we will only fix this in the latest version. So, if you are, as you said, trying to support different ESAPI releases in this manner, that's still going to be a problem, so setting the |
Beta Was this translation helpful? Give feedback.
-
FYI - I found the original commit for this , but that commit was fixed some years later. This commit however, was associated with PR #393 that was GitHub issue #316, which really seems to have nothing to do with this change or |
Beta Was this translation helpful? Give feedback.
@nettermensch - I'm have not yet researched why we changed this, but if since we have accidentally made
SecurityConfiguration.setResourceDirectory()
ineffective, I'd say that definitely is a bug because it is used in the (presumably rarely used)org.owasp.esapi.filters.ESAPIFilter
class, which means we broke that, too.Please go ahead and create a GitHub issue for this. (If you wish, you can just create it with a Summary title and reference this discussion for details.)
As for a temporary workaround, I might suggest setting the
System
property "org.owasp.esapi.resources" to the directory of interest. That ought to work for 2.2 and later. (Not as sure about 2.1.)Note: We do not back-port …