mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 06:21:11 +00:00 
			
		
		
		
	fix: don't allow credentials in migrate/push mirror URL
Do not allow credentials to be present in the URLs that are provided for migrations and push mirrors. They have to be given via the dedicated input fields. Give a error when this happens. There's nothing wrong with trying have the backend "correct" this, but would be a larger patch than necessary in the context of a security fix. This can be done in public.
This commit is contained in:
		
					parent
					
						
							
								d00200dc3e
							
						
					
				
			
			
				commit
				
					
						9f955b300b
					
				
			
		
					 7 changed files with 16 additions and 0 deletions
				
			
		|  | @ -283,6 +283,8 @@ func handleRemoteAddrError(ctx *context.APIContext, err error) { | |||
| 			} | ||||
| 		case addrErr.IsInvalidPath: | ||||
| 			ctx.Error(http.StatusUnprocessableEntity, "", "Invalid local path, it does not exist or not a directory.") | ||||
| 		case addrErr.HasCredentials: | ||||
| 			ctx.Error(http.StatusUnprocessableEntity, "", "The URL contains credentials.") | ||||
| 		default: | ||||
| 			ctx.Error(http.StatusInternalServerError, "ParseRemoteAddr", "Unknown error type (ErrInvalidCloneAddr): "+err.Error()) | ||||
| 		} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue