Tag: security

Questions Related to security

  1. Code is vulnerable as Resource is not released in the “finally” block

  2. Code is vulnerable as Resource is not released at all

  3. Code has no vulnerability

  4. Option 1 AND Option 2


Correct Option: A

Choose the correct answer: a. HTTP PUT & DELETE method can be disabled in web.xml from the below code: Disallowed Location /* PUT DELETE b. HTTP PUT & DELETE methods are disabled by default on many web server c. HTTP PUT & DELETE methods should not be disabled d. HTTP PUT & DELETE methods cannot be disabled

  1. a

  2. b

  3. c

  4. d

  5. Option 1 AND Option 2


Correct Option: E
  1. Security is handled at OS level by giving only read level privilege so no need to put an extra check here

  2. Only problem here is that fileName may not be syntactically incorrect so it should be validated before using it in the function

  3. This code can lead to information disclosure attack

  4. Java provides enough security by default for IO operations so this code is not vulnerable.


Correct Option: C
  1. Subject.doAs()

  2. AccessController.checkPermission()

  3. SecurityManager.checkAccess()

  4. None of the above


Correct Option: A
  1. The type safety mechanism in the Java language prevents the execution of malicious code

  2. Two classes with the same fully qualified name but which are defined by different instances of a class loader are NOT of the same type

  3. All signed classes are implicitly trusted and granted full access

  4. The principal role of a TrustManager is to determine if presented authentication credentials should be trusted

  5. Option 1 AND Option 4

  6. Option 2 AND Option 4


Correct Option: F