github-advanced-security[bot] commented on code in PR #2907:
URL: https://github.com/apache/shiro/pull/2907#discussion_r4217292402


##########
support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitResponse.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.shiro.ee.filters;
+
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponseWrapper;
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Consumer;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.SneakyThrows;
+import lombok.experimental.Delegate;
+import org.omnifaces.servlet.BufferedHttpServletResponse;
+
+/**
+ * Captures a replay's status, headers, cookies and body instead of committing 
them to the browser.
+ * Nothing reaches the browser response until {@link #applyTo} is called for a 
successful replay,
+ * so view-state GETs, failed attempts and Faces error handling (which resets 
the response)
+ * cannot disturb what the login request has already written, such as session 
cookies.
+ */
+final class FormResubmitResponse extends BufferedHttpServletResponse {
+    private static final String SET_COOKIE = "Set-Cookie";
+    private static final String LOCATION = "Location";
+    private final List<Deferred> deferred = new ArrayList<>();
+    private final @Delegate(types = Captured.class) HttpServletResponse 
recorder;

Review Comment:
   ## CodeQL / URL redirection from remote source
   
   Untrusted URL redirection depends on a [user-provided value](1).
   
   [Show more 
details](https://github.com/apache/shiro/security/code-scanning/53)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to