Skip to content

Commit

Permalink
Merge pull request #912 from grelca/allow-host-with-port
Browse files Browse the repository at this point in the history
allow Host header with explicit :80 included
  • Loading branch information
mtibben authored Apr 12, 2022
2 parents c4fa012 + 2aac403 commit be9b43d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/ec2server.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func withSecurityChecks(next *http.ServeMux) http.HandlerFunc {
// Check that the request is to 169.254.169.254
// Without this it's possible for an attacker to mount a DNS rebinding attack
// See https://github.com/99designs/aws-vault/issues/578
if r.Host != ec2MetadataEndpointIP {
if r.Host != ec2MetadataEndpointIP && r.Host != ec2MetadataEndpointAddr {
http.Error(w, fmt.Sprintf("Access denied for host '%s'", r.Host), http.StatusUnauthorized)
return
}
Expand Down

0 comments on commit be9b43d

Please sign in to comment.