# TypeScript Access Modifier Bypass - ID: typescript-access-modifier-bypass - Severity: HIGH - CWE: CWE-668 (CWE-668) - Languages: TypeScript - Frameworks: typescript ## Description TypeScript private/protected modifiers are compile-time only. Bracket notation and type assertions bypass them at runtime, exposing sensitive data like passwords and tokens. ## Detection Message Access modifier bypass detected using {technique}. Private/protected fields accessed through runtime mechanisms. ## Remediation Use ECMAScript private fields (#) for true runtime encapsulation. ```typescript class User { #password: string; constructor(password: string) { this.#password = password; } verifyPassword(input: string): boolean { return this.#password === input; } } ``` Learn more: https://shoulder.dev/learn/typescript/cwe-668/access-modifier-bypass ## Documentation [object Object] ## Related Rules - **HostPath Volume Mounted** [CRITICAL]: - **NodePort Service Exposes Application** [MEDIUM]: