Kubernetes cluster token visible for all-level clusters
GitLab's group-level Kubernetes cluster integration displayed a 'Show' button that revealed the stored service token to any user who could view the cluster page. An attacker with access to that page could obtain the token and gain full access to the Kubernetes cluster.
GitLab
Originally disclosed on GitLab
- Fixed in 5 months
- Disclosed after 5 months
HackerOne report #702796 by xanbanx on 2019-09-27, assigned to @cmaxim:
Hi GitLab Security Team,
Summary
GitLab allows to add group-level Kubernetes clusters. This allows to add exisiting cluster by adding a cluster URL and a token. However, this token is not properly masked allowing everyone who can visit the cluster page to also get the Kubernetes cluster token. So everyone who is in possession of the token als get full access to the cluster.
Steps to reproduce
Tested on GitLab Enterprise Edition 12.3.0-pre 2d096e8234d
- Create a group and go to
https://example.gitlab.com/groups/<group-name>/-/clusters - Click on
Add existing Cluster - Fill in Kubernetes cluster name:
Test, API URL:https://foo.bar, Service Token:My Secret Tokenand save the page - Now scroll below to
Kubernetes cluster details. Here, you see the Service token being masked. However, you can reveal the the token by clicking onShowon the right side.
Now the Kubernetes token is leaked.
Impact
Kubernetes cluster token being leaked after entered to to GitLab. This allows anyone to visit the Cluster page to steal the cluster token.
What is the current bug behavior?
Kubernetes cluster token canc be revealed in Kubernetes integration.
What is the expected correct behavior?
Once the Kubernetes cluster token is entered, you cannot reveal it again, so remove the Show button.
Output of checks
This bug happens on GitLab.com
Best regards,
Xanbanx
Impact
See above.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application did not restrict the ability to reveal the stored token to authorised users only, and instead exposed a 'Show' button to all viewers.
Impact
Anyone who can visit the cluster page could steal the Kubernetes cluster token, gaining full access to the cluster.
What the attacker needed
Access to the group's cluster page
The fix
The 'Show' button should be removed so that once the token is entered, it cannot be revealed again.
How it was found
- Create a group and go to the group's clusters page.
- Click on 'Add existing Cluster'.
- Fill in the cluster name, API URL, and service token, then save.
- Scroll to 'Kubernetes cluster details' and click 'Show' to reveal the token.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A Kubernetes cluster token is like a password that lets someone control the cluster. GitLab stored this token but also showed a button to reveal it, so anyone who could see the page could steal the password. This is bad because the token gives full access to the cluster.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.