Angular includes built-in CSRF/XSRF protection using double-submit cookie pattern. Automatically adds XSRF-TOKEN cookie to requests. Configure through HttpClientXsrfModule. Server must support token validation.
CSP restricts resource loading, prevents attacks. Configure through meta tags or HTTP headers. Affects script execution, style loading, image sources. Consider inline styles/scripts restrictions.
Authentication through JWT tokens, session management. Implement auth guards, interceptors for token handling. Secure token storage, implement refresh mechanism. Consider OAuth integration.
Secure storage using encryption, HttpOnly cookies. Consider localStorage limitations, session storage. Implement secure token management. Important for sensitive data protection.
Secure transmission through HTTPS, proper encryption. Implement token-based authentication, secure headers. Consider data minimization, transport security. Important for data protection.
Form security through validation, CSRF protection. Implement proper error handling, input sanitization. Consider client/server validation, secure submission. Important for user input.
Service worker security through proper scope, HTTPS requirement. Implement secure caching, request handling. Consider update mechanism, cache poisoning prevention.
API security through proper authentication, rate limiting. Implement input validation, error handling. Consider API versioning, documentation security.
Security hardening through configuration, best practices. Implement security headers, proper permissions. Consider environment security, deployment practices.
Route security through guards, proper navigation. Validate route parameters, implement access control. Consider deep linking security, route resolvers. Important for navigation security.
Interceptors add security headers, handle tokens. Implement authentication, request/response transformation. Consider error handling, retry logic. Important for API security.
DOM-based XSS occurs through client-side JavaScript. Prevent through proper sanitization, avoiding dangerous APIs. Use Angular's built-in protections, validate user input. Consider template security.
Same-Origin Policy restricts resource access between origins. Affects AJAX requests, cookies, DOM access. Configure CORS for cross-origin requests. Important for application security.
Secure state through proper storage, access control. Implement encryption for sensitive data, clear on logout. Consider state persistence, security implications.
PWA security through HTTPS requirement, secure manifests. Implement proper caching strategies, update mechanisms. Consider offline security, service worker security.
Security headers through server configuration, interceptors. Implement HSTS, CSP, X-Frame-Options. Consider browser compatibility, header requirements. Important for transport security.
WebSocket security through authentication, message validation. Implement secure connection, proper error handling. Consider connection timeout, protocol security.
Secure sessions through proper timeout, token rotation. Implement session validation, concurrent session handling. Consider session fixation prevention.
Security testing through penetration testing, vulnerability scanning. Implement security unit tests, integration tests. Consider OWASP guidelines, security requirements.
XSS attacks inject malicious scripts. Angular prevents by default through automatic sanitization of HTML, style bindings. Use DomSanitizer for trusted content, avoid bypass methods. Implement Content Security Policy (CSP).
Sanitization Service prevents XSS by sanitizing values. Handles HTML, styles, URLs, resource URLs. Use bypassSecurityTrustHtml for trusted content. Important for dynamic content rendering.
RBAC through guards, directives, services. Check user roles, permissions. Implement hierarchical roles, component visibility. Important for access management.
Secure uploads through proper validation, type checking. Implement size limits, scan for malware. Consider storage location, access control. Important for upload security.
OAuth implementation through authentication libraries, proper flow. Handle token management, user sessions. Consider security best practices, implementation standards.