[SERVLET_SPEC-23] Help prevent infinite loops Created: 07/Oct/11  Updated: 04/Jan/12  Resolved: 04/Jan/12

Status: Closed
Project: servlet-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: markt_asf Assignee: Shing Wai Chan
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


It is possible to create an infinite loop within an application if a wrapper is passed to its own ServletRequestWrapper.setRequest() method. The same problem can occur with ServletResponseWrapper and the HTTP variants.

It would be helpful if the spec required that this was not permitted. The check should probably go further and check for loops (A wraps B wraps C wraps A).

Comment by Shing Wai Chan [ 04/Jan/12 ]

The issue has been discussed in Servlet 3.1 expert group.
Adding the check for infinite loop will help in debugging.
The check should not be complicated or too costly as each corresponding vertex has only one outgoing edge and also in general there is not too many vertex in the corresponding graph.
However, there is a concern that this will introduce an overhead in checking.
So, the spec will not include this check in the spec.

Generated at Thu Nov 26 08:32:25 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.