Описание
Juju has unauthorized access to out-of-scope Kubernetes secrets
Summary
Grantee is able to update secret content using the secret-set tool due to broad Kubernetes access policy.
Implications are that it is possible, knowing a Kubernetes secret identifier (e.g. name), to patch without affecting the secret, revealing the value, or, patching while affecting the secrets value.
Details
When a Juju secret is "granted" to an app, that app should be able to read the secret content but not modify it, and should be able to only read secrets that have been granted to it.
Authorization of the secret-set hook tool / controller request is not performed correctly, which allows the grantee to update the secret content and to read or affect other secrets.
PoC
Tested:
- two applications in the same controller, same model: one owns the secret, another get a grant
- relation between them
- secret grant
- Linux AMD64, Canonical K8s, Juju 3.6.8 controller, Juju 3.6.9 CLI
Not tested:
- admin (user) secrets
- cross-model relations
- cross-controller relations
When the grantee attempts to update the the granted secret:
secret-setcommand logs an error, though returns OK return status- the secret value is updated
- new secret revision is not created
- new value is visible to both owner and grantee
Impact
- the application that owns the secret
- a third application, if a secret is granted to multiple parties
- any other application that has secrets in the same Kubernetes secret backend
Пакеты
github.com/juju/juju
>= 0.0.0-20221021155847-35c560704ee2, < 0.0.0-20260319091847-d06919eb03ec
0.0.0-20260319091847-d06919eb03ec
Связанные уязвимости
In Juju from version 3.0.0 through 3.6.18, the authorization of the "secret-set" tool is not performed correctly, which allows a grantee to update the secret content, and can lead to reading or updating other secrets. When the "secret-set" tool logs an error in an exploitation attempt, the secret is still updated contrary to expectations, and the new value is visible to both the owner and the grantee.
In Juju from version 3.0.0 through 3.6.18, the authorization of the "secret-set" tool is not performed correctly, which allows a grantee to update the secret content, and can lead to reading or updating other secrets. When the "secret-set" tool logs an error in an exploitation attempt, the secret is still updated contrary to expectations, and the new value is visible to both the owner and the grantee.
In Juju from version 3.0.0 through 3.6.18, the authorization of the "s ...