Suppose you have the following filter chain:
Filter 1 ====> Filter 2 ====> Filter 3 ====> Our Custom Filter ====> Filter 4 ====> Filter 5
<====Filter 1<====Filter 2<==== Our Custom Filter <====Filter 3<====Filter 4 <==== Filter 5
We are injecting customized data structure ^
The problem is we don't see the injected data in the web browser when doing a "View Source".
So it is obvious to us that either filter 1 or 2 are removing the injected data. In reality there are a lot more filters (possibly 30 or more). We are trying to determine which filter is the culprit filter that removes our injected data.
Is there a way to write data to a HttpServletResponse that cannot be modified, and if a modification is attempted an exception is thrown in Java? This way it will reveal the culprit immediately.
Something like enabling zombies in Objective-C when you are trying to determine when code is trying to access an object that has already been released.
A few more details (in case you are interested):
The data structure we are injecting into the httpservletresponse is a JSON data structure surrounded by "script" tags because we use jQuery to parse it for a bunch of user-interface related things.
Interestingly enough, if we try to inject a random string like "hello stackoverflow" we can see this string when doing a "view source" in the web browser. So our hunch is whatever filter is stripping out our structure is likely looking for malicious scripts and pulls our stuff out.