Headline
CVE-2023-25163: Github App Private Key printed on auth failure · Issue #12309 · argoproj/argo-cd
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. All versions of Argo CD starting with v2.6.0-rc1 have an output sanitization bug which leaks repository access credentials in error messages. These error messages are visible to the user, and they are logged. The error message is visible when a user attempts to create or update an Application via the Argo CD API (and therefor the UI or CLI). The user must have applications, create
or applications, update
RBAC access to reach the code which may produce the error. The user is not guaranteed to be able to trigger the error message. They may attempt to spam the API with requests to trigger a rate limit error from the upstream repository. If the user has repositories, update
access, they may edit an existing repository to introduce a URL typo or otherwise force an error message. But if they have that level of access, they are probably intended to have access to the credentials anyway. A patch for this vulnerability has been released in version 2.6.1. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Checklist:
- I’ve searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- I’ve included steps to reproduce the bug.
- I’ve pasted the output of argocd version.
Describe the bug
When trying to create an application, I saw in both a popup in the frontend UI, and in the logs from the server:
time="2023-02-07T03:07:17Z" level=info msg="finished unary call with code InvalidArgument" error="rpc error: code = InvalidArgument desc = application spec for argocd-admin is invalid: InvalidSpecError: repository not accessible: repositories not accessible: &Repository{Repo:https://github.com/james-callahan/gitops,Username:,Password:,SSHPrivateKey:,ConnectionState:ConnectionState{Status:,Message:,ModifiedAt:<nil>,},InsecureIgnoreHostKey:false,Insecure:false,EnableLFS:false,TLSClientCertData:,TLSClientCertKey:,Type:,Name:,InheritedCreds:true,EnableOCI:false,GithubAppPrivateKey:-----BEGIN RSA PRIVATE KEY-----\nTHEACTUALPRIVATEKEY\n-----END RSA PRIVATE KEY-----\n,GithubAppId:12345,GithubAppInstallationId:12345,GitHubAppEnterpriseBaseURL:,Proxy:,Project:,GCPServiceAccountKey:,ForceHttpBasicAuth:false,}" grpc.code=InvalidArgument grpc.method=Update grpc.service=application.ApplicationService grpc.start_time="2023-02-07T03:07:17Z" grpc.time_ms=38.558 span.kind=server system=grpc
where THEACTUALPRIVATEKEY is the actual private key for my github app.
Expected behavior
secret fields shouldn’t be printed as part of error messages
Version
argocd-server: v2.6.0+acc554f
Related news
### Impact All versions of Argo CD starting with v2.6.0-rc1 have an output sanitization bug which leaks repository access credentials in error messages. These error messages are visible to the user, and they are logged. The error message is visible when a user attempts to create or update an Application via the Argo CD API (and therefor the UI or CLI). The user must have `applications, create` or `applications, update` RBAC access to reach the code which may produce the error. The user is not guaranteed to be able to trigger the error message. They may attempt to spam the API with requests to trigger a rate limit error from the upstream repository. If the user has `repositories, update` access, they may edit an existing repository to introduce a URL typo or otherwise force an error message. But if they have that level of access, they are probably intended to have access to the credentials anyway. ### Patches A patch for this vulnerability has been released in the following Argo C...