Skip to content

Commit

Permalink
FolderEdit: HTTP response splitting defense.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbien committed Aug 27, 2021
1 parent b438911 commit ea8abe1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// TODO: make this work @AllowedMethods({"execute","save"})
public class FolderEdit extends UIAction implements ServletResponseAware {

private static Log log = LogFactory.getLog(FolderEdit.class);
private static final Log log = LogFactory.getLog(FolderEdit.class);

// bean for managing form data
private FolderBean bean = new FolderBean();
Expand Down Expand Up @@ -127,7 +127,10 @@ public String save() {
addMessage("folderForm.updated");
}

httpServletResponse.addHeader("folderId", folderId );
// HTTP response splitting defense
String sanetizedFolderID = folderId.replace("\n", "").replace("\r", "");

httpServletResponse.addHeader("folderId", sanetizedFolderID);

return SUCCESS;

Expand Down

0 comments on commit ea8abe1

Please sign in to comment.