Properties.load () seems to happily load in binary garbage if it does not find an invalid \uxxxx
escape \uxxxx
. Is there a way to be more strict? I just looked through the docs for the text format of the property files and I am confused how to say that the .properties file is valid.
edit: where did I come from this: I realized if I pointed my application to a 10 MB binary so that it rejected it. The 10 MB file was rejected, but only because of the \uxxxx
.
I think I could create a filter on the input stream to limit some βnormalβ amount, such as 1 MB, and filter out any key / value pairs where the key does not match an acceptable pattern. But I was hoping that it might have some kind of minimal structure to reject heavily damaged files.
source share