Multiple choice technology security

What is wrong in the below code? public void doPost(HttpServletRequest req, HttpServletResponse res) { try { String language = req.getParameter("language"); res.sendRedirect("/doc/"+language+”/index.html”); } catch (Exception e) { } }

  1. Request Redirection is vulnerable and not a good practice

  2. Exception is not logged

  3. Input parameter “language” is not validated

  4. Option 1 AND Option 2

  5. Option 1 AND Option 3

  6. Option 2 AND Option 3

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

The code is vulnerable because it uses an unvalidated input parameter ('language') directly in a 'sendRedirect' call, which can lead to Open Redirection attacks. Additionally, the exception is caught but not logged, making debugging and security auditing impossible.