Seemingly random calls to /error in Spring Boot

Viewed 113

I have a spring boot app deployed on an AWS EC2 instance. I've noticed in the logs some warnings which I've never seen locally:

05:16:45.271 [http-nio-8080-exec-4] WARN  o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not parse 'Accept' header [/]: Invalid mime type "/": does not contain subtype after '/']

These seem to occur at least a few times a day, at what seems to be random times. I added some extra logging and see these calls are coming from '/error'.

12:09:18.648 [http-nio-8080-exec-9] WARN  c.a.h.config.CustomExceptionResolver - Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not parse 'Accept' header [/]: Invalid mime type "/": does not contain subtype after '/'] for request: /error for user: null

Does anyone know where these calls are coming from, how I can track them down further or if it's just something to ignore? This service is publicly available so it could just be some random bot, but I would be interested to find out.

1 Answers

Nothing to worry about: Something - most likely a bot - has accessed your application with an invalid Accept header, and there's nothing much you can do about it. The good news is that you have nothing to worry about.

There are known security flaws in some http servers that enables an attacker to trigger some exploitable behaviour with a particularly crafted request; e.g. http header injection. That may be what the bot is trying to do, and your framework appears to have protected you from this attempt. All is well.

Related