Advanced
Security-First Code Refactoring
Perform a deep security audit on a code snippet and refactor it for safety and performance.
📝 Содержимое промпта
Perform a comprehensive security audit of the provided code snippet. Identify vulnerabilities based on the OWASP Top 10 (e.g., Injection, Broken Authentication, XSS). For each vulnerability found, explain: 1) The exploit mechanism. 2) The potential impact. 3) The specific lines of code responsible. Then, provide a refactored version of the code that mitigates these risks while adhering to SOLID principles and optimizing runtime complexity. [Insert code snippet here]