fix: Refuse to overwrite foreign objects from TrustStore reconciler#707
Open
dervoeti wants to merge 2 commits into
Open
fix: Refuse to overwrite foreign objects from TrustStore reconciler#707dervoeti wants to merge 2 commits into
dervoeti wants to merge 2 commits into
Conversation
b3fc25f to
5b555d9
Compare
5b555d9 to
940dde4
Compare
sweb
previously approved these changes
May 18, 2026
Member
sweb
left a comment
There was a problem hiding this comment.
lgtm - but I primarily did this to dive into the code base, so grains of salt - I also tried out the review skill on this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TLDR: Write access on
TrustStoreallows write access forConfigMaporSecretin the same namespaceThe TrustStore reconciler writes its output
ConfigMaporSecretusing theTrustStoreCR's own name and applies it via SSA withforce=true. Combined with the operator's cluster-wide write permissions onConfigMapsandSecrets, this lets any principal who can create aTrustStorein a namespace cause the operator to overwrite the contents of any pre-existing same-namedConfigMaporSecretin that namespace, stealing ownership and attaching a controllerOwnerReferencethat links the hijacked object to theTrustStoreCR for cascade delete.A good showcase is the auto-published
kube-root-ca.crtConfigMap:A tenant with
createontruststores.secrets.stackable.techin their namespace can create a TrustStore namedkube-root-ca.crt, overwrite the CA bundle every pod in the namespace uses to verify in-cluster TLS, and cascade-delete that ConfigMap by deleting the TrustStore. This allows a) MITM attacks (hard because you need to modify DNS resolution of the Pods) and b) potentially crashing existing Pods on restart becausekube-root-ca.crtis corrupted.The same applies to any
ConfigMaporSecretin the same namespace whose name the attacker can guess.Fix
Before applying, look up the existing target. If the object already exists and is not owned by the current
TrustStore, refuse the reconciliation.Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features tracker