Complete the code to identify the OWASP Top 10 risk related to broken authentication.
risk = "[1]" # OWASP Top 10 risk for broken authentication
The OWASP Top 10 risk related to broken authentication is A2-Broken Authentication.
Complete the code to select the OWASP Top 10 risk that involves attackers injecting malicious code.
risk = "[1]" # OWASP Top 10 risk for code injection attacks
The OWASP Top 10 risk for code injection attacks is A1-Injection.
Fix the error in the code to correctly assign the OWASP Top 10 risk for sensitive data exposure.
risk = "[1]" # OWASP Top 10 risk for sensitive data exposure
The correct OWASP Top 10 risk for sensitive data exposure is A3-Sensitive Data Exposure.
Fill both blanks to complete the code that creates a dictionary mapping OWASP risk codes to their descriptions.
owasp_risks = {"[1]": "Injection", "[2]": "Broken Authentication"}The dictionary keys for Injection and Broken Authentication are A1-Injection and A2-Broken Authentication respectively.
Fill all three blanks to complete the code that filters OWASP risks starting with 'A' and having a number less than 5.
filtered_risks = {risk: desc for risk, desc in risks.items() if risk[1] [2] and int(risk[1]) [3] 5}The code checks if the risk starts with 'A' (using .startswith('A')), then verifies the second character equals '1' (using ==), and finally checks if the integer value of the second character is less than 5 (using <).
Note: The second blank is best as '==' to check exact match, and the third blank is '<' to check less than 5.