A quick workaround for this issue
Open /ubb/scripts/changeprefs.inc.php in an editor and replace the following line near at the end:
header("Location: $curl");
with:
if( substr( $curl, 0, 2 ) == "//" ) {
header("Location: $curl");
}
This will add an additional check for the curl parameter