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
Questions
Which of the following is NOT recommended for securing Web Applications against malicious users?
- Filtering data with a default deny regular expression
- Running the application with the least privilege necessary
- Client side data validation
- Retrieving data from database using pre-compiled stored procedures
Phishing attacks are successful when
- The web server is not patched
- The attack entices a user to perform a certain action
- Users do not patch their machines
- Users share email accounts
How to stop forceful browsing?
- Check authorization on each page
- Name files with un-guessable names
- Place all accessible files in the same directory
- ACL's on the web root
Extra parameters which are currently not used in the application
- Is necessary to check some functionalities during the testing and production support
- May lead to security breaches
- Do not consume significant bandwidth and so can be allowed in the application
- Is necessary in case the application needs a future addition
How long does a request scope exist?
- The length of the User's Session
- The length of a single HTTP response
- The length of a single HTTP request
- Until the server is rebooted
Which of the following best describes the difference between white-box testing and black-box testing?
- White-box testing is performed by an independent programmer team
- Black-box testing uses the bottom-up approach
- Black-box testing involves the business units
- White-box testing examines the program internal logical structures
Scanning underlying source code with a database of regular expressions to quickly identify suspicious code, application inputs, outputs etc primarily relates to ..
- Grey-box testing
- Black-box testing
- White-box testing
- None of these
What is the difference between network vulnerability assessment and a penetration test?
- A penetration test enumerates resources, and a vulnerability assessment enumerates vulnerabilities
- They are one and the same
- A penetration test identifies running services, and vulnerability assessments provide a more in-depth understanding of vulnerabilities
- A penetration test exploits vulnerabilities, and a vulnerability assessment finds vulnerabilities
What is the method signature for hashing password?
- String hashPassword(String password)
- String hashPassword(String password, String accountName)
- String hashpassword(String password)
- None of the above
What is the return type of the verifyPasswordStrength() method in the security API?
- Boolean
- String
- Integer
- void
What is the return type of the isAuthorizedForData() method in the security API?
- String
- boolean
- Integer
- void
What is the return type of the getCSRFToken() method?
- Integer
- Byte
- String
- BigInteger
What kind of exception does the method login(HttpServletRequest request, HttpServletResponse response) throw?
- LoginException
- EnterpriseSecurityException
- SecurityException
- IntrusionException
Which are the default scripting codecs supported by the security API
- JavaScript
- VBScript
- Both of the above
- None of the above
Which are the default codecs supported to help encode characters to be safely used on OS command shells
- Unix Codec
- Windows Codec
- Unix and Windows Codec
- Linux Codec
The security API supports codecs for SQL Strings of which of the following databases ?
- Oracle
- MySQL
- Both of the above
- Oracle, MySQL, Sybase, DB2
What is the functionality of the seal() method ?
- Creates a seal that binds a set of data and includes an expiration timestamp
- Encodes the data
- Hashes the data
- Scrambles the data
What method is provided within the security API to prevent caching by browsers and proxies?
- void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response)
- void setNoCacheHeaders(javax.servlet.http.HttpServletRequest request)
- boolean setNoCacheHeader(javax.servlet.http.HttpServletResponse response)
- void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
Which method among the below could be used as a defense against Cross Site Request Forgery?
- encryptHiddenField(java.lang.String value)
- addCSRFToken(final java.lang.String href)
- verifySecureComm(javax.servlet.http.HttpServletRequest request)
- setSafeContentType(javax.servlet.http.HttpServletResponse response)
Which set of security API methods could be used as the best defense against Cross Site Scripting?
- Input Validation and OutPut Encoding
- Authentication and Authorization
- Data Protection and Cryptography
- HTTP and Communication Security