Multiple choice technology security

try { 
    //code to do  IO operations 
    return var1; 
} Catch(Exception e) { 
    return var2; 
} finally{ 
    return var3; 
} 

From security view point problem with above code is

  1. It is returning a value in finally block

  2. It is catching Exception

  3. Both a & b

  4. Nothing is wrong

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Returning in a finally block is problematic because it discards any exception that was thrown in the try/catch blocks and overrides return values from both try and catch. This can hide security-relevant exceptions. Catching the generic Exception instead of specific exceptions is also a security anti-pattern that can mask error conditions.