BE
Checking integer, float, or Boolean string parameters to ensure accurate values (Option A) can help prevent certain types of injection attacks, such as those that rely on unexpected input. However, it is not a comprehensive solution and can still be bypassed by a determined attacker.
Using prepared statements and parameterized queries (Option B) is a more robust method of preventing SQL injection attacks. These techniques separate the data and the SQL command, preventing attackers from injecting malicious code into the SQL command.
Blocking SQL code execution in the web application database login (Option E) is another robust method to mitigate SQL injection attacks. This technique ensures that no malicious SQL statements can be executed in the database.
Therefore, B and E are correct answers as they are more robust methods of preventing SQL injection attacks.
Option C, Securing the connection between the web and the app tier, is important for overall security, but it is not directly related to preventing SQL injection attacks. Having a secure connection ensures that the data being transmitted between the web and app tier is protected, but it does not prevent attackers from injecting malicious code into the SQL command.
Option D, Writing SQL code instead of using object-relational mapping libraries, can help prevent SQL injection attacks by giving you more control over the SQL commands being executed, but it is not a guarantee. It is still possible to make mistakes in the SQL code that can lead to SQL injection vulnerabilities. Prepared statements and parameterized queries (Option B) is a more robust method of preventing SQL injection attacks, regardless of whether you are using an ORM library or writing raw SQL code.
In summary, B and E are the best options for preventing SQL injection attacks. While C and D may improve overall security, they do not directly address SQL injection vulnerabilities.
A. Input sanitization is a must to mitigate SQL injection
B. By using prepared statements and parameterized queries, you don't execute SQL statements introduced in the SQLi vulnerable form
B AND E
SQL Injection is best prevented through the use of parameterized queries.
FROM: https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.html
Answer A and B
Parameterized statements
Main article: Prepared statement
With most development platforms, parameterized statements that work with parameters can be used (sometimes called placeholders or bind variables) instead of embedding user input in the statement. A placeholder can only store a value of the given type and not an arbitrary SQL fragment. Hence the SQL injection would simply be treated as a strange (and probably invalid) parameter value. In many cases, the SQL statement is fixed, and each parameter is a scalar, not a table. The user input is then assigned (bound) to a parameter
Pattern check
Integer, float or boolean, string parameters can be checked if their value is valid representation for the given type. Strings that must follow some strict pattern (date, UUID, alphanumeric only, etc.) can be checked if they match this pattern.
According to Cisco's documentation: https://tools.cisco.com/security/center/resources/sql_injection.html
B and C are correct:
Parameterized queries in ASP.NET, prepared statements in Java, or similar techniques in other languages should be used comprehensively in addition to strict input validation.
Application layer protocol inspection performs deep packet inspection of traffic that transits the firewall. Using application layer protocol inspection on Cisco firewalls to mitigate SQL attacks against web servers is discussed in Cisco TAC Security Podcast Episode #16.
Only way to do the second, imo, is to secure the connection between the web and app tier (Application layer protocol inspection)
Changing back to A and B based on this statement that comes at the beginning of the section on mitigating these attacks:
The primary approaches include validation of user-supplied data, in the form of whitelisting or blacklisting, and the construction of SQL statements such that user-supplied data cannot influence the logic of the statement.
Last sentence is all about the statements and A and B are directly about that so must be those two.
IT is B and D according to the URL provided.
Parameterized statements
Main article: Prepared statement
With most development platforms, parameterized statements that work with parameters can be used (sometimes called placeholders or bind variables) instead of embedding user input in the statement. A placeholder can only store a value of the given type and not an arbitrary SQL fragment. Hence the SQL injection would simply be treated as a strange (and probably invalid) parameter value. In many cases, the SQL statement is fixed, and each parameter is a scalar, not a table. The user input is then assigned (bound) to a parameter.[24]
Enforcement at the coding level
Using object-relational mapping libraries avoids the need to write SQL code. The ORM library in effect will generate parameterized SQL statements from object-oriented code.
B. Prepared statements and parameterized queries are a way of separating the SQL code from the data that is being passed into the query. By doing this, the SQL injection attack is prevented because the attacker cannot inject any SQL code into the prepared statement or parameterized query.
C. Securing the connection between the web and the app tier is also an important prevention technique to mitigate SQL injection attacks. This is because an attacker can intercept network traffic and view the data that is being passed between the web and the app tier. By using SSL or TLS encryption, the data that is being passed between the two tiers is encrypted, making it much harder for an attacker to view or manipulate.
to me it's B and C as per this Cisco article:
https://tools.cisco.com/security/center/resources/sql_injection.html
"A SQL injection attack can be detected and potentially blocked at two locations in an application traffic flow: in the application and in the network."
"Parameterized queries in ASP.NET, prepared statements in Java, or similar techniques in other languages should be used comprehensively in addition to strict input validation."
A's wording doesn't necessary imply input validation
D doesn't make sense
E is not a solution which I've seen suggested anywhere.
B. Prepared statements and parameterized queries are a way of separating the SQL code from the data that is being passed into the query. By doing this, the SQL injection attack is prevented because the attacker cannot inject any SQL code into the prepared statement or parameterized query.
C. Securing the connection between the web and the app tier is also an important prevention technique to mitigate SQL injection attacks. This is because an attacker can intercept network traffic and view the data that is being passed between the web and the app tier. By using SSL or TLS encryption, the data that is being passed between the two tiers is encrypted, making it much harder for an attacker to view or manipulate.
Correct are A, B.
Countermeasure against SQLi:
..you should most definitely use ORM (Object-Relational Mappings) and prepared statements. = option B.
They take away the vast majority of SQL Injection risk, and are generally good software practices.
However, you shouldn’t think that using these packages makes you completely immune.
Instead, you should also use input validation. This will keep malicious input out of your system to begin with, which is a great way to reduce risk. = option A
https://snyk.io/blog/sql-injection-orm-vulnerabilities/
This is from this link: Parameterized queries in ASP.NET, prepared statements in Java, or similar techniques in other languages should be used comprehensively in addition to strict input validation. Each of these techniques performs all required escaping of dangerous characters before the SQL statement is passed to the underlying database system.
https://en.wikipedia.org/wiki/SQL_injection#Mitigation
Limiting the permissions on the database login used by the web application to only what is needed may help reduce the effectiveness of any SQL injection attacks that exploit any bugs in the web application.
This section is not available anymore. Please use the main Exam Page.350-701 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
sull3y
Highly Voted 2 years, 3 months agosull3y
2 years, 3 months agoCock
Most Recent 6 months, 2 weeks agocerttaker202
7 months, 1 week agodavedavedave
7 months, 2 weeks agoCokamaniako
7 months, 3 weeks agoMarshpillowz
1 year, 1 month agonep1019
1 year, 9 months agonep1019
1 year, 9 months agoBrain_Power
1 year, 11 months agomaddyr
1 year, 11 months agoPrzemol
1 year, 10 months agocyberwhizzy0
1 year, 11 months agoachille5
2 years, 2 months agoachille5
2 years, 2 months agojienBoq
2 years, 5 months agoachille5
2 years, 2 months agoJavierAcuna
2 years, 5 months agoNikoNiko
2 years, 10 months agoHilaM
2 years, 10 months agodavezz
2 years, 5 months agoaal
3 years agootzu1
3 years ago