Skip to content

Commit

Permalink
fix(vendor): Remove excessive URL validation
Browse files Browse the repository at this point in the history
Fixes #1019
  • Loading branch information
mss committed Feb 5, 2025
1 parent 300ca0f commit 7b0c673
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions internal/exec/go_getter_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@ func ValidateURI(uri string) error {
if len(uri) > 2048 {
return fmt.Errorf("URI exceeds maximum length of 2048 characters")
}
// Add more validation as needed
// Validate URI format
if strings.Contains(uri, "..") {
return fmt.Errorf("URI cannot contain path traversal sequences")
}
if strings.Contains(uri, " ") {
return fmt.Errorf("URI cannot contain spaces")
}
// Validate characters
if strings.ContainsAny(uri, "<>|&;$") {
return fmt.Errorf("URI contains invalid characters")
}
// Validate scheme-specific format
if strings.HasPrefix(uri, "oci://") {
if !strings.Contains(uri[6:], "/") {
Expand Down

0 comments on commit 7b0c673

Please sign in to comment.