Skip to content

Commit

Permalink
Avoid protocol relative redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf authored and cesarhernandezgt committed Sep 5, 2023
1 parent bc91f18 commit 98e7b1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions java/org/apache/catalina/authenticator/FormAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,12 @@ protected String savedRequestURL(Session session) {
sb.append('?');
sb.append(saved.getQueryString());
}

// Avoid protocol relative redirects
while (sb.length() > 1 && sb.charAt(1) == '/') {
sb.deleteCharAt(0);
}

return sb.toString();
}
}
3 changes: 3 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
<update>
Update to Commons Daemon 1.3.2. (markt)
</update>
<fix>
Avoid protocol relative redirects in FORM authentication. (markt)
</fix>
</changelog>
</subsection>
</section>
Expand Down

0 comments on commit 98e7b1c

Please sign in to comment.