Impact
This vulnerability allows an attacker to perform arbitrary actions on behalf of the victim via the API, such as creating, modifying, and deleting Kubernetes resources. Due to the improper filtering of URL protocols in the repository page, an attacker can achieve cross-site scripting with permission to edit the repository.
In ui/src/app/shared/components/urls.ts
, the following code exists to parse the repository URL.
|
export function repoUrl(url: string): string { |
|
try { |
|
const parsed = GitUrlParse(url); |
|
|
|
if (!supportedSource(parsed)) { |
|
return null; |
|
} |
|
|
|
return `${protocol(parsed.protocol)}://${parsed.resource}/${parsed.owner}/${parsed.name}`; |
|
} catch { |
|
return null; |
|
} |
|
} |
Since this code doesn't validate the protocol of repository URLs, it's possible to inject javascript:
URLs here.
|
const href = repoUrl(url); |
|
const content = children || url; |
|
return href !== null ? <a href={href}>{content}</a> : <span>{content}</span>; |
As the return value of this function is used in the href
attribute of the a
tag, it's possible to achieve cross-site scripting by using javascript:
URLs.
Browsers may return the proper hostname for javascript:
URLs, allowing exploitation of this vulnerability.
Patches
A patch for this vulnerability has been released in the following Argo CD versions:
The patch incorporates a way to validate the URL being passed in. Returning null
if the validation fails.
Workarounds
There are no workarounds other than depending on the browser to filter the URL.
Credits
Disclosed by @Ry0taK RyotaK.
For more information
Open an issue in the Argo CD issue tracker or discussions
Join us on Slack in channel #argo-cd
Impact
This vulnerability allows an attacker to perform arbitrary actions on behalf of the victim via the API, such as creating, modifying, and deleting Kubernetes resources. Due to the improper filtering of URL protocols in the repository page, an attacker can achieve cross-site scripting with permission to edit the repository.
In
ui/src/app/shared/components/urls.ts
, the following code exists to parse the repository URL.argo-cd/ui/src/app/shared/components/urls.ts
Lines 14 to 26 in 0ae5882
Since this code doesn't validate the protocol of repository URLs, it's possible to inject
javascript:
URLs here.argo-cd/ui/src/app/shared/components/repo.tsx
Lines 5 to 7 in 0ae5882
As the return value of this function is used in the
href
attribute of thea
tag, it's possible to achieve cross-site scripting by usingjavascript:
URLs.Browsers may return the proper hostname for
javascript:
URLs, allowing exploitation of this vulnerability.Patches
A patch for this vulnerability has been released in the following Argo CD versions:
The patch incorporates a way to validate the URL being passed in. Returning
null
if the validation fails.Workarounds
There are no workarounds other than depending on the browser to filter the URL.
Credits
Disclosed by @Ry0taK RyotaK.
For more information
Open an issue in the Argo CD issue tracker or discussions
Join us on Slack in channel #argo-cd