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
Fix PvCSI service account regex security vulnerability (SUP-VULN-0009)
The original regex ^system:serviceaccount.*-pvcsi$ was vulnerable to
colon injection attacks. A malicious user could create a service account
named 'evil-pvcsi' in their namespace and bypass webhook security checks
by having their username appear as:
system:serviceaccount:malicious-namespace:evil-pvcsi
This would match the regex and be treated as a trusted PvCSI service account.
Fixed by replacing the overly broad .* pattern with a more restrictive
regex that:
1. Uses [^:]+ for namespace (no colons allowed)
2. Explicitly allows legitimate service accounts:
- vsphere-csi-controller
- vsphere-csi-node
- pvcsi
- Any service account ending with -pvcsi (but no colons in name)
New regex: ^system:serviceaccount:[^:]+:(vsphere-csi-controller|vsphere-csi-node|pvcsi|[^:]*-pvcsi)$
This prevents colon injection while maintaining compatibility with
legitimate PvCSI service accounts.
Added comprehensive test coverage to prevent regression.
Security Impact: MEDIUM - Prevents authentication bypass for
CnsFileAccessConfig operations.
Signed-off-by: ab002488
0 commit comments