Web Application Security! Hardest Trivia Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Searchlab
S
Searchlab
Community Contributor
Quizzes Created: 4 | Total Attempts: 4,836
| Attempts: 2,350 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. The most effective way of protecting against SQL injection is… 

Explanation

a] Blacklisting is a poor solution against SQL injection. It can be avoided in multiple ways, and can block valid user input if overused.
b] IDS can detect obvious SQL injection attempts, but it is possible for skilled attackers to avoid detection.
c] Whitelisting can be effective in general, but it overly restricts valid input. Many names have dashes and apostrophes in them, for example.
d] Use of prepared statements is generally accepted as the most effective way of protecting against SQL injection. The built-in escaping and validation will prohibit attackers from injecting a string into a numeric field, and quote data in string fields properly.
e] Adhering to the principle of least privilege is generally a good thing, but it only reduces the impact of a successful attack.

Submit
Please wait...
About This Quiz
Web Application Security! Hardest Trivia Quiz - Quiz

Web application security is a critical topic, and do you need to know more about this subject? Your computer security needs to tell the difference between legitimate and malicious traffic. Someone could come onto your site and worm their way into the site and also your computer. Taking this quiz... see morecan help you learn more about application security and how it makes your life easier. see less

Personalize your quiz and earn a certificate with your name on it!
2. Which is NOT true with respect to cross-site scripting (XSS) vulnerabilities?

Explanation

a] True; if there is a vulnerability in the JavaScript interpreter or in one of the browser plugins, an XSS attack can lead to client-side code execution.
b] True; an attacker can steal the user’s authentication data from cookies and use it to impersonate the user.
c] True; by definition, a reflected XSS vulnerability is triggered by the user actively following a link.
d] This is NOT true; there are browser plugins such as NoScript that can prevent running JavaScript from untrusted sites.
e] True, the payload may contain a HTTP request that is parametrized to exploit an XSS in another page on the same host. See the Samy MySpace worm for an example.

Submit
3. Which of the following statements is true with respect to handling file uploads and spam?

Explanation

a] True. However, robust file handling functions should be used – otherwise, malformed files may cause security problems on their own.
b] False. Depending on how the web server works, it may interpret attack.php.mp3 as a PHP script even though its extension is not .php.
c] False. MIME type is sent by the client, and can contain anything regardless of the file’s actual content.
d] False. A good CAPTCHA will require a non-trivial time and money investment from the spammer’s side to avoid.
e] False. These CAPTCHAs annoy users, and it is very possible that they’re more easily solved by programs than humans.

Submit
4. Which statement is true with respect to HTML5 security?

Explanation

A] False – the other domain needs to explicitly allow this
B] True
C] False – if the browser supports HTML5, the attacker can inject any kind of HTML5 tag into the page
D] False – it actually gives the attackers more opportunities for XSS attacks
E] False – Cross-site scripting attacks can read or modify Local Storage contents

Submit
5. If the current page has been downloaded from https://example.com/admin/index.jsp, what address may the JavaScripts running on the page can download data from?

Explanation

a] Incorrect – the domain does not match
b] Incorrect – the server will reject HTTP queries sent to the HTTPS port.
c] Incorrect – the server will reject HTTPS queries sent to the HTTP port.
d] Correct
e] Incorrect – the protocol is different between the two queries

Submit
6. A web application implements a SQL operation in the following way (pseudocode):   The application uses a MSSQL database running on a different machine from the web server. The database has one user (the built-in administrator account is not used). If an attacker can control the value of user and item, he can… 

Explanation

a] There is only one user, therefore there are no access control issues. The attacker can map out the database, and use UNION to read out any data from it.
b] Since the database is MSSQL, the attacker can use query stacking to perform multiple database manipulation actions in one query.
c] The attacker can use create a table and use BULK INSERT tablename FROM ‘file’ to store the file’s content in the database, then read it out with a SELECT later.
d] The attacker cannot use EXEC to run arbitrary code without administrative rights – which he does not have in this case
e] The web server is on another machine, and the attacker cannot affect it directly through the database server.

Submit
7. A web application implements a SQL operation in the following way (pseudocode): The application uses a MSSQL database running on a different machine from the web server. The database has one user (the built-in administrator account is not used).   An attacker could use the following parameters to get extra data from the database's contents:

Explanation

a] This gives the attacker a list of table names.
b] This does not give any extra information, since ‘1 or 1=1’ will be quoted.
c] This gives an attacker a list of databases.
d] This dumps the contents of the items table.
e] This does not give the attacker extra information directly, but the delay indicates a vulnerability – this query is useful for blind SQL injection.

Submit
8. If a web application includes a WYSIWYG editor, which of the approaches described below would NOT be appropriate for dealing with potential XSS in user input?

Explanation

a] Blacklisting is not a good approach, as there are many ways to circumvent and avoid such filters.
b] While this prevents cross-site scripting attacks, it also prevents users from submitting any kind of active content to the site.
c] This approach may be viable depending on the context, but it significantly restricts the scope of content users can submit – e.g. links.
d] This approach is generally accepted as the best compromise. However, the parameters of the special tags (e.g. URLs) must be validated in some way before conversion.
e] Depending on the language of the webapp, this may be a viable solution.

Submit
9. If the attacker can run JavaScript on the user's machine, he can expect to…

Explanation

a] True – the attacker can rewrite methods and change variables of other JavaScripts.
b] True – JavaScript clicks are equivalent to user clicks.
c] False – this is only possible if there is a bug in the browser that can be exploited through JavaScript.
d] False – a typical client-side breach cannot affect assets stored on the server.
e] True – JavaScript can relay keystrokes and e.g. send them to an iframe.

Submit
10. To prevent cross-site request forgery attacks in AJAX requests, you can…

Explanation

a]True – you could clear this garbage away when a “legitimate” AJAX request is made, and any injected JavaScript would hit the infinite loop or become inoperable when hitting the garbage part of the page.
b]False – this header only enforces the same origin policy in HTML5 XmlHttpRequests.
c]True – CSRF attacks can only be used in GET requests.
d]True – this ensures that XmlHttpRequests only come from the site that is supposed to perform the AJAX requests. Referrer checks cannot be easily bypassed without JavaScript capability on the side of the attacker.
e]False – changing the data format does not protect against CSRF.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Sep 28, 2012
    Quiz Created by
    Searchlab
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
The most effective way of protecting against SQL injection...
Which is NOT true with respect to cross-site scripting (XSS)...
Which of the following statements is true with respect to handling...
Which statement is true with respect to HTML5 security?
If the current page has been downloaded from...
A web application implements a SQL operation in the following way...
A web application implements a SQL operation in the following way...
If a web application includes a WYSIWYG editor, which of the...
If the attacker can run JavaScript on the user's machine, he can...
To prevent cross-site request forgery attacks in AJAX requests, you...
Alert!

Advertisement