Since version 7.0.8 of spring-core and the bug fix in commit 41cd687, MimeTypeUtils raises a StringIndexOutOfBoundsException instead of an InvalidMimeTypeException when parsing certain invalid mime types.
Attempting to parse "application/xml" (the quotes are part of the value) raises a StringIndexOutOfBoundsException and Spring returns a 500 internal server error.
I believe there is an unaccounted case where nextIndex = 0 in mimeType.charAt(nextIndex - 1) if the value starts with a double quote.
Since version 7.0.8 of
spring-coreand the bug fix in commit 41cd687,MimeTypeUtilsraises aStringIndexOutOfBoundsExceptioninstead of anInvalidMimeTypeExceptionwhen parsing certain invalid mime types.Attempting to parse
"application/xml"(the quotes are part of the value) raises aStringIndexOutOfBoundsExceptionand Spring returns a 500 internal server error.I believe there is an unaccounted case where
nextIndex = 0inmimeType.charAt(nextIndex - 1)if the value starts with a double quote.