Просмотр исходного кода

Disallow urlencoded new lines in git protocol paths if there is a port (#13521) (#13525)

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
tags/v1.12.6
6543 3 лет назад
Родитель
Сommit
480efbdb96
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 3 добавлений и 0 удалений
  1. 3
    0
      modules/auth/repo_form.go

+ 3
- 0
modules/auth/repo_form.go Просмотреть файл

@@ -97,6 +97,9 @@ func (f MigrateRepoForm) ParseRemoteAddr(user *models.User) (string, error) {
u.User = url.UserPassword(f.AuthUsername, f.AuthPassword)
}
remoteAddr = u.String()
if u.Scheme == "git" && u.Port() != "" && (strings.Contains(remoteAddr, "%0d") || strings.Contains(remoteAddr, "%0a")) {
return "", models.ErrInvalidCloneAddr{IsURLError: true}
}
} else if !user.CanImportLocal() {
return "", models.ErrInvalidCloneAddr{IsPermissionDenied: true}
} else if !com.IsDir(remoteAddr) {

Загрузка…
Отмена
Сохранить