Open alwaysgoodtime opened 8 months ago
None
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
CRLFSanitize.java
✓ https://github.com/alwaysgoodtime/sweep-personal-test/commit/6b099e7046c680e45b5c7428e5701cbbdc3b6f52 Edit
Create CRLFSanitize.java with contents: * Create a new file named `CRLFSanitize.java` in the `src/main/java/org/secidea/controller` directory. * Add the following code to the `CRLFSanitize.java` file:
package org.secidea.controller;
public class CRLFSanitize {
public static String sanitize(String input) {
return input.replaceAll("\r\n", "");
}
}
CRLFInjection.java
:import org.secidea.controller.CRLFSanitize;
crlf
method in CRLFInjection.java
to use the CRLFSanitize
class to sanitize the user input before passing it to the response
object.public void crlf(HttpServletRequest request, HttpServletResponse response) {
String test1 = CRLFSanitize.sanitize(request.getParameter("test1"));
String test2 = CRLFSanitize.sanitize(request.getParameter("test2"));
String author = CRLFSanitize.sanitize(request.getParameter("test3"));
Cookie cookie = new Cookie("test3", author);
response.addCookie(cookie);
}
CRLFInjection.java
:import javax.servlet.http.Cookie;
CRLFInjection.java
:import javax.servlet.http.HttpServletRequest;
CRLFInjection.java
:import javax.servlet.http.HttpServletResponse;
CRLFSanitize.java
✓ Edit
Check CRLFSanitize.java with contents:
Ran GitHub Actions for 6b099e7046c680e45b5c7428e5701cbbdc3b6f52:
I have finished reviewing the code for completeness. I did not find errors for sweep/crlf_17f08
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
Details
请帮我修复crlf代码
Checklist
- [X] Create `CRLFSanitize.java` ✓ https://github.com/alwaysgoodtime/sweep-personal-test/commit/6b099e7046c680e45b5c7428e5701cbbdc3b6f52 [Edit](https://github.com/alwaysgoodtime/sweep-personal-test/edit/sweep/crlf_17f08/CRLFSanitize.java) - [X] Running GitHub Actions for `CRLFSanitize.java` ✓ [Edit](https://github.com/alwaysgoodtime/sweep-personal-test/edit/sweep/crlf_17f08/CRLFSanitize.java)