# TypeScript Unconstrained Generic Type Parameters - ID: typescript-generic-constraint-bypass - Severity: MEDIUM - CWE: CWE-704 (CWE-704) - Languages: TypeScript - Frameworks: typescript ## Description Unconstrained generics ( or ) allow any type to pass through, causing runtime errors and type confusion when accessing properties that do not exist. ## Detection Message Generic type parameter '{param}' lacks constraints. Add 'extends' constraint to ensure type safety. ## Remediation Add type constraints using extends to ensure required properties exist. ```typescript interface Identifiable { id: number; } function processData(data: T): number { return data.id; } ``` Learn more: https://shoulder.dev/learn/typescript/cwe-704/generic-constraint-bypass ## Documentation [object Object] ## Related Rules - **tRPC Type Safety Bypass with Any** [MEDIUM]: - **TypeScript Strict Mode Disabled** [HIGH]: - **Unsafe 'any' Type in Security-Sensitive Context** [HIGH]: - **TypeScript Unsafe Type Guard** [HIGH]: