8000 (CodeQL) Introduced protections against HTTP header injection / smuggling attacks by pixeebot-helm-test[bot] · Pull Request #5 · hintwatermelon/roller4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

(CodeQL) Introduced protections against HTTP header injection / smuggling attacks #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
8000
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public String save() {
// HTTP response splitting defense
String sanetizedFolderID = folderId.replace("\n", "").replace("\r", "");

httpServletResponse.addHeader("folderId", sanetizedFolderID);
httpServletResponse.addHeader("folderId", stripNewlines(sanetizedFolderID));

return SUCCESS;

Expand Down Expand Up @@ -172,4 +172,8 @@ public String getFolderId() {
public void setFolderId(String folderId) {
this.folderId = folderId;
}

private static String stripNewlines(final String s) {
return s.replaceAll("[\n\r]", "");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
}

response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
response.setHeader("Location", callback);
response.setHeader("Location", stripNewlines(callback));

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
}
}

Expand All @@ -164,4 +164,8 @@
realm += request.getLocalName();
OAuthServlet.handleException(response, e, realm, sendBody);
}

private static String stripNewlines(final String s) {
return s.replaceAll("[\n\r]", "");
}
}
0