The hst supports internal forwarding, see 
However, a forward can trigger the very same resolved sitemap item as the one that triggered the forward leading to recursion.
Thus for example we go from
homepage -> pagenotfound -> pagenotfound -> pagenotfound -> pagenotfound
For this, we should add simple short circuiting.
Note that I do not tend to currently prevent this kind of recursion since that is quite unlikely to happen and should be avoided in end project code to happen (since end projects trigger the forward typically)
homepage -> pagenotfound -> homepage ->pagenotfound -> homepage -> pagenotfound
During the endless recursion, also the hst session pool will exhaust since every forward takes a new session from the pool : This is because at the beginning of the pipeline processing, the InitializationValve reset the jcr session in the request context to null and only at the very end of the request, all jcr sessions are returned to the session pool (which is after all the recursions happened)