I have recently seen a web application that, while using Authorization
header, accepted multiple Bearer
keywords followed by a valid JWT token. For example, all of the following headers would result in correct authentication:
Authorization: Bearer jwttokenhere...
Authorization: Bearer Bearer jwttokenhere...
Authorization: Bearer Bearer Bearer Bearer Bearer Bearer Bearer jwttokenhere...
and so on. My question is - if the backend accepts such headers, is there any security risk involved here or is it only a matter of how backend handles it? None of other combinations I tried worked (like using "test" as one on the Bearers, placing token inbetween etc.), but I may have missed something. The backend is Java+Spring and it is probably using org.springframework.security.oauth2 to handle JWT tokens.