Improperly configured permissions in Sealos
Description
Improper RBAC configuration in Sealos prior to 4.2.1-rc4 allows attackers to gain cluster control, compromising the entire Kubernetes cluster.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Improper RBAC configuration in Sealos prior to 4.2.1-rc4 allows attackers to gain cluster control, compromising the entire Kubernetes cluster.
Sealos, an open-source cloud operating system built on Kubernetes, suffers from an improper role-based access control (RBAC) configuration in versions prior to 4.2.1-rc4 [1]. This misconfiguration allows an attacker to obtain cluster control permissions, effectively taking over the entire cluster [4].
The vulnerability can be exploited without any special prerequisites; an attacker with network access to the Sealos management plane can leverage the flawed RBAC rules to escalate privileges. No prior authentication or user interaction is required [4].
Upon successful exploitation, an attacker gains full control over the Sealos cluster, including the ability to manage hundreds of pods and other Kubernetes resources. This leads to a complete compromise of confidentiality, integrity, and availability [1][4].
The issue is fixed in version 4.2.1-rc4, with the commit merging the patch [3]. Users are urged to upgrade immediately, as no workarounds exist [1][4].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/labring/sealosGo | < 4.2.1-rc4 | 4.2.1-rc4 |
Affected products
2Patches
14cdf52e55666Merge pull request from GHSA-74j8-w7f9-pp62
2 files changed · +107 −0
controllers/user/controllers/namespace_controller.go+99 −0 added@@ -0,0 +1,99 @@ +/* +Copyright 2022 labring. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package controllers + +import ( + "context" + "github.com/go-logr/logr" + "github.com/labring/sealos/controllers/user/controllers/helper" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/tools/record" + "k8s.io/client-go/util/retry" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/predicate" + "strings" +) + +// NamespaceReconciler reconciles a Namespace object +type NamespaceReconciler struct { + Logger logr.Logger + Recorder record.EventRecorder + *runtime.Scheme + client.Client +} + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// TODO(user): Modify the Reconcile function to compare the state specified by +// the User object against the actual cluster state, and then +// perform operations to make the cluster state reflect the state specified by +// the user. +// +// For more details, check Reconcile and its Result here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile +func (r *NamespaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + r.Logger.V(1).Info("start reconcile for ns") + ns := &v1.Namespace{} + if err := r.Get(ctx, req.NamespacedName, ns); err != nil { + return ctrl.Result{}, client.IgnoreNotFound(err) + } + + if strings.HasPrefix(ns.Name, "ns-") { + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + change, err := controllerutil.CreateOrUpdate(ctx, r.Client, ns, func() error { + if ns.Labels == nil { + ns.Labels = map[string]string{} + } + ns.Labels = helper.SetPodSecurity(ns.Labels) + return nil + }) + if err != nil { + return err + } + r.Logger.V(1).Info("create or update ns", "change", change, "ns", ns.Name) + return nil + }) + if err != nil { + r.Logger.Error(err, "create or update ns error", "ns", ns.Name) + return ctrl.Result{}, err + } + } + + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *NamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error { + const controllerName = "namespace_controller" + if r.Client == nil { + r.Client = mgr.GetClient() + } + r.Logger = ctrl.Log.WithName(controllerName) + if r.Recorder == nil { + r.Recorder = mgr.GetEventRecorderFor(controllerName) + } + r.Scheme = mgr.GetScheme() + r.Logger.V(1).Info("init reconcile controller namespace") + return ctrl.NewControllerManagedBy(mgr). + For(&v1.Namespace{}, builder.WithPredicates( + predicate.Or(predicate.AnnotationChangedPredicate{}, predicate.LabelChangedPredicate{}))). + Complete(r) +}
controllers/user/main.go+8 −0 modified@@ -108,6 +108,14 @@ func main() { os.Exit(1) } + if err = (&controllers.NamespaceReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "Namespace") + os.Exit(1) + } + //if err = (&controllers.UserExpirationReconciler{ // Client: mgr.GetClient(), // Scheme: mgr.GetScheme(),
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/advisories/GHSA-74j8-w7f9-pp62ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-33190ghsaADVISORY
- github.com/labring/sealos/commit/4cdf52e55666864e5f90ed502e9fc13e18985b7bghsax_refsource_MISCWEB
- github.com/labring/sealos/security/advisories/GHSA-74j8-w7f9-pp62ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.