You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7ef33bb
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(external): reject path traversal in external cluster secret dump (#11045)
The external cluster name and the referenced TLS secret selectors
(`sslCert`, `sslKey`, `sslRootCert`) are joined into filesystem paths
under the external secrets directory (`/controller/external`) when the
instance manager dumps the connection material. None of these values
were validated, so a name or selector containing a path separator or a
`..` component could escape the intended directory and write into other
volumes mounted writable in the instance container.
This stays within the trust boundary of a principal who can already
create or update a Cluster (and therefore already controls the resulting
Pod and its volumes), so it is a hardening fix rather than a privilege
escalation. It is still a free-form string flowing into `filepath.Join`,
which we validate by policy regardless of who can reach it.
Reject these values both in the cluster validating webhook and in the
instance manager, which reads the spec directly and can bypass
admission. The password secret reference is intentionally left
unchecked, since it is only read from the API server and never joined
into a path. The name is only ever used as a string-equality lookup key,
so rejecting a path separator or a `..` component is non-breaking; no
positive allowlist is imposed on the pre-existing field.
Because the same validator runs at the start of the instance manager
reconcile loop through the admission guard, a Cluster that already has a
non-conforming external cluster name or secret selector persisted
(created before this fix, or through a webhook bypass) will have its
reconciliation stopped until the value is corrected. Such a
configuration could not have connected correctly before, since the value
would have resolved to an unintended path.
Reported by @r0binak.
Closes#11043
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
0 commit comments