Are you prepared to block software attacks? Complete the quiz below to find out.
What authentication strategy is best fit for a Java EE multi-user application which contains a public section and a restricted area?
Which of the options below best describes how to identify a user's role?
String role=request.getParameter("role");
String uid=request.getParameter("id"); String role = Database.getRole(uid);
String role=document.cookie.indexOf('isAdmin')!=-1
String role=(String)session.getAttribute("role");
What is the best method to avoid Authorization Bypass issues?
What is the best way to store user passwords in a database?
Which of the following hashing algorithms is NOT out-dated?
Which communication protocol would you select for your server configuration ?
You are implementing a TLS client, but your test server has a self-signed certificate and the connection fails.
The following snippets represent an account lockout mechanism. Which of the following choices has a vulnerability?
short tries=(short)session.getAttribute("tries"); tries++; isLockedOut=tries>5; session.setAttribute("tries",tries);
short tries=(short)session.getAttribute("tries"); tries++; isLockedOut=tries>5 || tries<0; session.setAttribute("tries",tries);
short tries=(short)session.getAttribute("tries"); if(tries<MAX_SHORT) tries++; isLockedOut=tries>5; session.setAttribute("tries",tries);
Which of the following statements about account lockout is against security best practices?
Which is the best way to ensure the integrity of software updates?
Which of the snippets below has a security issue?
response.sendRedirect("http://google.com");
response.sendRedirect(request.getParameter("redirect"));
response.sendRedirect(UrlResourceManager.get(request.getParameter("pageId")));
Which of the following is the most effective defense against XSS?
Which of the following HTTP response headers prevents "Inclusion of Functionality from Untrusted Control Sphere" and increases the attack complexity for XSS.
X-XSS-Protection: 1; mode=block
Content-Security-Policy: script-src ‘self’
X-Frame-Options:deny
Strict-Transport-Security: max-age=31536000
Which is the most effective protection against Cross-Site Request Forgery?
Which of the following extensions is considered dangerous during a file upload to a Java EE application?
Which of the following best prevents path traversal?
Can XML files be used to "steal" data from system where the application is running?
The support team has created a maintenance bash script that they have provided to many customers. There are requests to productize the script, so customers no longer have to SSH into the boxes. Which approach should you take?
Your application needs to run an operation with elevated privileges. Which approach should you take?
You must implement a feature that allows users to download server logs. What is the best way to implement it?
Which of the statements below protects from SQL Injection?
query="SELECT * FROM users WHERE ou='"+request.getParameter("ou")+"' ORDER BY name "+request.getParameter("sort")
query="SELECT * FROM users WHERE ou='?' ORDER BY name ?"
query="SELECT * FROM users WHERE ou='" +request.getParameter("ou").replace("\"","")+"' ORDER BY name " +request.getParameter("sort").replace("\"","")
query="SELECT * FROM users WHERE ou='%s' ORDER BY name %s"
Which of the following functions is considered safer?
Which of the following snippets is a format string injection vulnerability?
gets(a); printf("Value %s is invalid!",a);
Runtime.getRuntime().exec("%s",a);
gets(a); printf("Value is invalid:"); printf(a);
query=String.format("SELECT * FROM users WHERE id='%s'",a)
How can you best protect against buffer overflow?
Which is the best way to prevent Deserialization attacks?