Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden the IsURL check #512

Merged
merged 1 commit into from
Dec 1, 2017
Merged

Harden the IsURL check #512

merged 1 commit into from
Dec 1, 2017

Conversation

shrinandj
Copy link
Contributor

The IsURL check simply called url.ParseRequestURI and relied on whether it errors
or not to detect whether the given string is a url or not. Turns out that
url.ParseRequestURI does not error out if the given string is a complete
filesystem path /path/to/file.

This commit hardens the IsURL check. It checks whether the returned URL object
by url.ParseRequestURI() has an actual Host component or not. If not, isURL returns
false.

Testing Done:

  • argo submit failed with a full-path prior to this change. Worked after.

  • argo submit succeeded with a url before and after.

Refs #509.

The IsURL check simply called url.ParseRequestURI and relied on whether it errors
or not to detect whether the given string is a url or not. Turns out that
url.ParseRequestURI does not error out if the given string is a complete
filesystem path /path/to/file.

This commit hardens the IsURL check. It checks whether the returned URL object
by url.ParseRequestURI() has an actual Host component or not. If not, isURL returns
false.

Refs argoproj#509.
@shrinandj shrinandj merged commit eed54f5 into argoproj:master Dec 1, 2017
@shrinandj shrinandj deleted the fix-509 branch December 1, 2017 06:38
icecoffee531 pushed a commit to icecoffee531/argo-workflows that referenced this pull request Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants