CVE-2026-61794
Capsule: Malformed ForbiddenAnnotations.Regex can bypass Tenant validation and trigger namespace admission panic
Capsule is a multi-tenancy and policy-based framework for Kubernetes. From 0.13.0 until 0.13.7, the Tenant update validation in internal/webhook/tenant/validation/forbidden_annotations_regex.go compiles ForbiddenLabels.Regex for both the labels and annotations checks instead of validating ForbiddenAnnotations.Regex. An administrator who can update a Tenant can therefore persist a malformed ForbiddenAnnotations.Regex while leaving the labels expression valid. Namespace creation or update later passes the stored expression through pkg/api/forbidden_list.go, where regexp.MustCompile can panic during forbidden metadata validation and deny namespace operations for the affected tenant. This issue is fixed in version 0.13.7.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- High
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
6.8
Capsule: Malformed ForbiddenAnnotations.Regex can bypass Tenant validation and trigger namespace admission panic
Capsule is a multi-tenancy and policy-based framework for Kubernetes. From 0.13.0 until 0.13.7, the Tenant update validation in internal/webhook/tenant/validation/forbidden_annotations_regex.go compiles ForbiddenLabels.Regex for both the labels and annotations checks instead of validating ForbiddenAnnotations.Regex. An administrator who can update a Tenant can therefore persist a malformed ForbiddenAnnotations.Regex while leaving the labels expression valid. Namespace creation or update later passes the stored expression through pkg/api/forbidden_list.go, where regexp.MustCompile can panic during forbidden metadata validation and deny namespace operations for the affected tenant. This issue is fixed in version 0.13.7.
- Record
CVE-2026-61794- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:N/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
EUVDEUVD-2026-83055
6.8
Capsule is a multi-tenancy and policy-based framework for Kubernetes. From 0.13.0 until 0.13.7, the Tenant update validation in internal/webhook/tenant/validation/forbidden_annotations_regex.go compiles ForbiddenLabels.Regex for both the labels and annotations checks instead of validating ForbiddenAnnotations.Regex. An administrator who can update a Tenant can therefore persist a malformed ForbiddenAnnotations.Regex while leaving the labels expression valid. Namespace creation or update later passes the stored expression through pkg/api/forbidden_list.go, where regexp.MustCompile can panic during forbidden metadata validation and deny namespace operations for the affected tenant. This issue is fixed in version 0.13.7.
- Record
EUVD-2026-83055- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-gxjc-74v5-3vx3
4.9
Capsule: Malformed ForbiddenAnnotations.Regex can bypass Tenant validation and trigger namespace admission panic
Summary
A validation bug in internal/webhook/tenant/validation/forbidden_annotations_regex.go allows an invalid ForbiddenAnnotations.Regex value to bypass Tenant admission on update. The webhook compiles ForbiddenLabels.Regex for both labels and annotations, so a malformed annotations regex can be persisted. Once stored, namespace admission later evaluates the bad regex through pkg/api/forbidden_list.go, where regexp.MustCompile can panic and cause admission failure.
Details
In internal/webhook/tenant/validation/forbidden_annotations_regex.go, OnUpdate validates the new Tenant object, but the loop compiles tnt.Spec.NamespaceOptions.ForbiddenLabels.Regex for both labels and annotations. That means an invalid ForbiddenAnnotations.Regex is never validated if ForbiddenLabels.Regex is valid.
Relevant paths:
internal/webhook/tenant/validation/forbidden_annotations_regex.gointernal/webhook/namespace/validation/user_metadata.gopkg/api/forbidden_list.go
Namespace admission later calls api.ValidateForbidden(...), and ForbiddenListSpec.RegexMatch() uses regexp.MustCompile(in.Regex). If the malformed regex is present in the Tenant spec, any namespace request that reaches this check can panic or fail hard, causing denial of service for namespace operations in the affected tenant.
PoC
- Update a Tenant so that:
spec.namespaceOptions.forbiddenLabels.regexis validspec.namespaceOptions.forbiddenAnnotations.regexis malformed, for example:[invalid-regex(
- The Tenant update is accepted because the webhook compiles the labels regex for both fields.
- Create or update a Namespace that triggers forbidden metadata validation.
- The namespace admission path reaches
regexp.MustCompile(...)and panics.
package main
import (
"fmt"
"regexp"
)
type ForbiddenListSpec struct {
Regex string
}
type NamespaceOptions struct {
ForbiddenLabels ForbiddenListSpec
ForbiddenAnnotations ForbiddenListSpec
}
type Tenant struct {
NamespaceOptions *NamespaceOptions
}
func validateTenantUpdate(tnt *Tenant) error {
if tnt.NamespaceOptions == nil {
return nil
}
annotationsToCheck := map[string]string{
"labels": tnt.NamespaceOptions.ForbiddenLabels.Regex,
"annotations": tnt.NamespaceOptions.ForbiddenAnnotations.Regex,
}
for scope, annotation := range annotationsToCheck {
if _, err := regexp.Compile(tnt.NamespaceOptions.ForbiddenLabels.Regex); err != nil {
return fmt.Errorf("deny update: unable to compile %s regex for forbidden %s", annotation, scope)
}
}
return nil
}
func validateForbidden(metadata map[string]string, forbidden ForbiddenListSpec) error {
for key := range metadata {
if forbidden.Regex != "" {
if regexp.MustCompile(forbidden.Regex).MatchString(key) {
return fmt.Errorf("forbidden key matched: %s", key)
}
}
}
return nil
}
func main() {
oldTenant := &Tenant{
NamespaceOptions: &NamespaceOptions{
ForbiddenLabels: ForbiddenListSpec{Regex: `^[a-z0-9-]+$`},
ForbiddenAnnotations: ForbiddenListSpec{Regex: `^[a-z0-9-]+$`},
},
}
newTenant := &Tenant{
NamespaceOptions: &NamespaceOptions{
ForbiddenLabels: ForbiddenListSpec{Regex: `^[a-z0-9-]+$`},
ForbiddenAnnotations: ForbiddenListSpec{Regex: `[invalid-regex(`},
},
}
fmt.Println("=== Update step ===")
if err := validateTenantUpdate(newTenant); err != nil {
fmt.Printf("unexpected deny: %v\n", err)
} else {
fmt.Println("allowed: malformed ForbiddenAnnotations.Regex bypassed validation")
}
fmt.Println()
fmt.Println("=== Namespace step ===")
_ = oldTenant
defer func() {
if r := recover(); r != nil {
fmt.Printf("panic reproduced from ValidateForbidden: %v\n", r)
}
}()
_ = validateForbidden(map[string]string{"example": "value"}, ForbiddenListSpec{Regex: `[invalid-regex(`})
fmt.Println("no panic, unexpected")
}
Expected output:
=== Update step ===
allowed: malformed ForbiddenAnnotations.Regex bypassed…
- Record
GHSA-gxjc-74v5-3vx3- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
NVD
6.8
Capsule is a multi-tenancy and policy-based framework for Kubernetes. From 0.13.0 until 0.13.7, the Tenant update validation in internal/webhook/tenant/validation/forbidden_annotations_regex.go compiles ForbiddenLabels.Regex for both the labels and annotations checks instead of validating ForbiddenAnnotations.Regex. An administrator who can update a Tenant can therefore persist a malformed ForbiddenAnnotations.Regex while leaving the labels expression valid. Namespace creation or update later passes the stored expression through pkg/api/forbidden_list.go, where regexp.MustCompile can panic during forbidden metadata validation and deny namespace operations for the affected tenant. This issue is fixed in version 0.13.7.
- Record
CVE-2026-61794- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:N/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
OSV
6.8
Capsule: Malformed ForbiddenAnnotations.Regex can bypass Tenant validation and trigger namespace admission panic
Capsule is a multi-tenancy and policy-based framework for Kubernetes. From 0.13.0 until 0.13.7, the Tenant update validation in internal/webhook/tenant/validation/forbidden_annotations_regex.go compiles ForbiddenLabels.Regex for both the labels and annotations checks instead of validating ForbiddenAnnotations.Regex. An administrator who can update a Tenant can therefore persist a malformed ForbiddenAnnotations.Regex while leaving the labels expression valid. Namespace creation or update later passes the stored expression through pkg/api/forbidden_list.go, where regexp.MustCompile can panic during forbidden metadata validation and deny namespace operations for the affected tenant. This issue is fixed in version 0.13.7.
- Record
CVE-2026-61794- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:N/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
OSVGHSA-gxjc-74v5-3vx3
4.9
Capsule: Malformed ForbiddenAnnotations.Regex can bypass Tenant validation and trigger namespace admission panic
Summary
A validation bug in internal/webhook/tenant/validation/forbidden_annotations_regex.go allows an invalid ForbiddenAnnotations.Regex value to bypass Tenant admission on update. The webhook compiles ForbiddenLabels.Regex for both labels and annotations, so a malformed annotations regex can be persisted. Once stored, namespace admission later evaluates the bad regex through pkg/api/forbidden_list.go, where regexp.MustCompile can panic and cause admission failure.
Details
In internal/webhook/tenant/validation/forbidden_annotations_regex.go, OnUpdate validates the new Tenant object, but the loop compiles tnt.Spec.NamespaceOptions.ForbiddenLabels.Regex for both labels and annotations. That means an invalid ForbiddenAnnotations.Regex is never validated if ForbiddenLabels.Regex is valid.
Relevant paths:
internal/webhook/tenant/validation/forbidden_annotations_regex.gointernal/webhook/namespace/validation/user_metadata.gopkg/api/forbidden_list.go
Namespace admission later calls api.ValidateForbidden(...), and ForbiddenListSpec.RegexMatch() uses regexp.MustCompile(in.Regex). If the malformed regex is present in the Tenant spec, any namespace request that reaches this check can panic or fail hard, causing denial of service for namespace operations in the affected tenant.
PoC
- Update a Tenant so that:
spec.namespaceOptions.forbiddenLabels.regexis validspec.namespaceOptions.forbiddenAnnotations.regexis malformed, for example:[invalid-regex(
- The Tenant update is accepted because the webhook compiles the labels regex for both fields.
- Create or update a Namespace that triggers forbidden metadata validation.
- The namespace admission path reaches
regexp.MustCompile(...)and panics.
package main
import (
"fmt"
"regexp"
)
type ForbiddenListSpec struct {
Regex string
}
type NamespaceOptions struct {
ForbiddenLabels ForbiddenListSpec
ForbiddenAnnotations ForbiddenListSpec
}
type Tenant struct {
NamespaceOptions *NamespaceOptions
}
func validateTenantUpdate(tnt *Tenant) error {
if tnt.NamespaceOptions == nil {
return nil
}
annotationsToCheck := map[string]string{
"labels": tnt.NamespaceOptions.ForbiddenLabels.Regex,
"annotations": tnt.NamespaceOptions.ForbiddenAnnotations.Regex,
}
for scope, annotation := range annotationsToCheck {
if _, err := regexp.Compile(tnt.NamespaceOptions.ForbiddenLabels.Regex); err != nil {
return fmt.Errorf("deny update: unable to compile %s regex for forbidden %s", annotation, scope)
}
}
return nil
}
func validateForbidden(metadata map[string]string, forbidden ForbiddenListSpec) error {
for key := range metadata {
if forbidden.Regex != "" {
if regexp.MustCompile(forbidden.Regex).MatchString(key) {
return fmt.Errorf("forbidden key matched: %s", key)
}
}
}
return nil
}
func main() {
oldTenant := &Tenant{
NamespaceOptions: &NamespaceOptions{
ForbiddenLabels: ForbiddenListSpec{Regex: `^[a-z0-9-]+$`},
ForbiddenAnnotations: ForbiddenListSpec{Regex: `^[a-z0-9-]+$`},
},
}
newTenant := &Tenant{
NamespaceOptions: &NamespaceOptions{
ForbiddenLabels: ForbiddenListSpec{Regex: `^[a-z0-9-]+$`},
ForbiddenAnnotations: ForbiddenListSpec{Regex: `[invalid-regex(`},
},
}
fmt.Println("=== Update step ===")
if err := validateTenantUpdate(newTenant); err != nil {
fmt.Printf("unexpected deny: %v\n", err)
} else {
fmt.Println("allowed: malformed ForbiddenAnnotations.Regex bypassed validation")
}
fmt.Println()
fmt.Println("=== Namespace step ===")
_ = oldTenant
defer func() {
if r := recover(); r != nil {
fmt.Printf("panic reproduced from ValidateForbidden: %v\n", r)
}
}()
_ = validateForbidden(map[string]string{"example": "value"}, ForbiddenListSpec{Regex: `[invalid-regex(`})
fmt.Println("no panic, unexpected")
}
Expected output:
=== Update step ===
allowed: malformed ForbiddenAnnotations.Regex bypassed…
- Record
GHSA-gxjc-74v5-3vx3- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
OSVGO-2026-6521 No score
Capsule: Malformed ForbiddenAnnotations.Regex can bypass Tenant validation and trigger namespace admission panic in github.com/projectcapsule/capsule
Capsule: Malformed ForbiddenAnnotations.Regex can bypass Tenant validation and trigger namespace admission panic in github.com/projectcapsule/capsule
- Record
GO-2026-6521- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/projectcapsule/capsuleGo |
0.13.0 up to 0.13.7 | 0.13.7 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-61794 is a medium vulnerability (CVSS 6.8) in Projectcapsule Capsule, published September 18, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.59%, the 48th percentile. Fixed in github.com/projectcapsule/capsule 0.13.7.
References
github.com/projectcapsule/capsule/security/advisories/GHSA-gxjc-74v5-3vx3
github.com/projectcapsule/capsule/pull/1983
github.com/projectcapsule/capsule/commit/8d89d6865df6f41c7faa22fc9e807a57b01bfd0e
github.com/projectcapsule/capsule/releases/tag/v0.13.7
github.com/advisories/GHSA-gxjc-74v5-3vx3
github.com/CVEProject/cvelistV5/tree/main/cves/2026/61xxx/CVE-2026-61794.json
nvd.nist.gov/vuln/detail/CVE-2026-61794
github.com/projectcapsule/capsule
Left out here: the rest of 2 source descriptions. The JSON record has them.