Web Application Security and Security API Fundamentals

Quiz covering web application security concepts including XSS/CSRF defense, security API methods, security testing methodologies, and common attack prevention strategies

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is NOT recommended for securing Web Applications against malicious users?

  1. Filtering data with a default deny regular expression
  2. Running the application with the least privilege necessary
  3. Client side data validation
  4. Retrieving data from database using pre-compiled stored procedures
Question 2 Multiple Choice (Single Answer)

Phishing attacks are successful when

  1. The web server is not patched
  2. The attack entices a user to perform a certain action
  3. Users do not patch their machines
  4. Users share email accounts
Question 3 Multiple Choice (Single Answer)

How to stop forceful browsing?

  1. Check authorization on each page
  2. Name files with un-guessable names
  3. Place all accessible files in the same directory
  4. ACL's on the web root
Question 4 Multiple Choice (Single Answer)

Extra parameters which are currently not used in the application

  1. Is necessary to check some functionalities during the testing and production support
  2. May lead to security breaches
  3. Do not consume significant bandwidth and so can be allowed in the application
  4. Is necessary in case the application needs a future addition
Question 5 Multiple Choice (Single Answer)

How long does a request scope exist?

  1. The length of the User's Session
  2. The length of a single HTTP response
  3. The length of a single HTTP request
  4. Until the server is rebooted
Question 6 Multiple Choice (Single Answer)

Which of the following best describes the difference between white-box testing and black-box testing?

  1. White-box testing is performed by an independent programmer team
  2. Black-box testing uses the bottom-up approach
  3. Black-box testing involves the business units
  4. White-box testing examines the program internal logical structures
Question 7 Multiple Choice (Single Answer)

Scanning underlying source code with a database of regular expressions to quickly identify suspicious code, application inputs, outputs etc primarily relates to ..

  1. Grey-box testing
  2. Black-box testing
  3. White-box testing
  4. None of these
Question 8 Multiple Choice (Single Answer)

What is the difference between network vulnerability assessment and a penetration test?

  1. A penetration test enumerates resources, and a vulnerability assessment enumerates vulnerabilities
  2. They are one and the same
  3. A penetration test identifies running services, and vulnerability assessments provide a more in-depth understanding of vulnerabilities
  4. A penetration test exploits vulnerabilities, and a vulnerability assessment finds vulnerabilities
Question 9 Multiple Choice (Single Answer)

What is the method signature for hashing password?

  1. String hashPassword(String password)
  2. String hashPassword(String password, String accountName)
  3. String hashpassword(String password)
  4. None of the above
Question 10 Multiple Choice (Single Answer)

What is the return type of the verifyPasswordStrength() method in the security API?

  1. Boolean
  2. String
  3. Integer
  4. void
Question 11 Multiple Choice (Single Answer)

What is the return type of the isAuthorizedForData() method in the security API?

  1. String
  2. boolean
  3. Integer
  4. void
Question 12 Multiple Choice (Single Answer)

What is the return type of the getCSRFToken() method?

  1. Integer
  2. Byte
  3. String
  4. BigInteger
Question 13 Multiple Choice (Single Answer)

What kind of exception does the method login(HttpServletRequest request, HttpServletResponse response) throw?

  1. LoginException
  2. EnterpriseSecurityException
  3. SecurityException
  4. IntrusionException
Question 14 Multiple Choice (Single Answer)

Which are the default scripting codecs supported by the security API

  1. JavaScript
  2. VBScript
  3. Both of the above
  4. None of the above
Question 15 Multiple Choice (Single Answer)

Which are the default codecs supported to help encode characters to be safely used on OS command shells

  1. Unix Codec
  2. Windows Codec
  3. Unix and Windows Codec
  4. Linux Codec
Question 16 Multiple Choice (Single Answer)

The security API supports codecs for SQL Strings of which of the following databases ?

  1. Oracle
  2. MySQL
  3. Both of the above
  4. Oracle, MySQL, Sybase, DB2
Question 17 Multiple Choice (Single Answer)

What is the functionality of the seal() method ?

  1. Creates a seal that binds a set of data and includes an expiration timestamp
  2. Encodes the data
  3. Hashes the data
  4. Scrambles the data
Question 18 Multiple Choice (Single Answer)

What method is provided within the security API to prevent caching by browsers and proxies?

  1. void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response)
  2. void setNoCacheHeaders(javax.servlet.http.HttpServletRequest request)
  3. boolean setNoCacheHeader(javax.servlet.http.HttpServletResponse response)
  4. void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
Question 19 Multiple Choice (Single Answer)

Which method among the below could be used as a defense against Cross Site Request Forgery?

  1. encryptHiddenField(java.lang.String value)
  2. addCSRFToken(final java.lang.String href)
  3. verifySecureComm(javax.servlet.http.HttpServletRequest request)
  4. setSafeContentType(javax.servlet.http.HttpServletResponse response)
Question 20 Multiple Choice (Single Answer)

Which set of security API methods could be used as the best defense against Cross Site Scripting?

  1. Input Validation and OutPut Encoding
  2. Authentication and Authorization
  3. Data Protection and Cryptography
  4. HTTP and Communication Security