Very rare requests claim they are from 127.0.0.1

Christopher Schultz <[email protected]> Sat, 2 May 2026 11:27:36 -0400
Newsgroups gmane.comp.jakarta.tomcat.user
Message-ID <[email protected]>
All,

I've got an odd situation where some requests arriving in my application 
are claiming to come from 127.0.0.1 as the remote IP address.

I'm calling HttpServletRequest.getRemoteAddr and storing it in the 
user's session. I'm an admin, so I can see this attribute in users' 
sessions and very rarely I'm seeing that it's set to 127.0.0.1.

My setup is:

AWS ALB -> httpd [mod_jk] -> [stunnel] -> Tomcat [AjpNioProtocol]

This does not require high load. All httpd and Tomcat instances are 
configured identically. And this happens very rarely, but enough that I 
have noticed it and I'd like to understand what might be happening.

An interview with ChatGPT yielded this comment:

"
AJP is not resilient to partial/ambiguous reads across a tunneled TCP
stream. If anything about framing or connection reuse gets even slightly 
out of sync, Tomcat will still process the request—but silently fall 
back to 127.0.0.1.
"

Honestly, I think that ChatGPT has grabbed on to the idea that "httpd 
and Tomcat are fine, so it must be stunnel" which seems odd to me, but 
I'm wondering about its comment.

My expectation is that if "something is wrong" then mod_jk will kill the 
request. Or maybe Tomcat will. Or both.

I see no correlation with errors in my mod_jk.log file (which has very 
few if any errors).

Any suggestions for what might be happening? I can't reproduce this 
myself but I control everything in the stack except for the AWS ALB 
(which I can configure, but obviously, I can't directly-instrument in 
the way that I could, say, httpd, Tomcat, or my own application).

-chris