This repository was archived by the owner on Dec 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
src/main/java/com/appirio/tech/core/service/identity/resource Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -1360,9 +1360,22 @@ protected boolean isValidStatusValue(String status) {
13601360
13611361 protected String getResetPasswordUrlPrefix (HttpServletRequest request ) {
13621362 String resetPasswordUrlPrefix = request .getParameter ("resetPasswordUrlPrefix" );
1363- if (resetPasswordUrlPrefix !=null )
1363+ if (resetPasswordUrlPrefix !=null ) {
1364+ // Sanitize / ensure domains other than topcoder.com or topcoder-dev.com can't be used.
1365+ int i = resetPasswordUrlPrefix .indexOf ("://" ) + 3 ;
1366+ String domainName = resetPasswordUrlPrefix .substring (i );
1367+ i = domainName .indexOf ("/" );
1368+ domainName = domainName .substring (0 , i );
1369+ i = domainName .lastIndexOf ("." );
1370+ i = domainName .lastIndexOf ("." , i - 1 );
1371+ domainName = domainName .substring (i + 1 );
1372+ if (!(domainName .equals ("topcoder.com" ) || domainName .equals ("topcoder-dev.com" ))) {
1373+ resetPasswordUrlPrefix = null ;
1374+ }
1375+
13641376 return resetPasswordUrlPrefix ;
1365-
1377+ }
1378+
13661379 String source = request .getParameter ("source" );
13671380 String domain = getDomain ()!=null ? getDomain () : "topcoder.com" ;
13681381 String template = "https://%s.%s/reset-password" ;
You can’t perform that action at this time.
0 commit comments