{"id":1049,"date":"2020-06-05T13:48:06","date_gmt":"2020-06-05T13:48:06","guid":{"rendered":"https:\/\/sectigostore.com\/blog\/?p=1049"},"modified":"2020-11-03T16:35:03","modified_gmt":"2020-11-03T16:35:03","slug":"what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks","status":"publish","type":"post","link":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/","title":{"rendered":"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Akamai\u2019s State of the Internet report that analyzed data between November 2017 and March 2019 indicates that SQL injection now represents nearly <\/strong><a href=\"https:\/\/www.akamai.com\/uk\/en\/multimedia\/documents\/state-of-the-internet\/soti-security-web-attacks-and-gaming-abuse-report-2019.pdf\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>two thirds (65.1%)<\/strong><\/a><strong> of all web application attacks<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One of the most widespread attacks on web servers aims to attack their backend databases to reveal sensitive information such as customer details, company data, etc. Because the stakes are so high, regardless of whether you\u2019re an application owner or a regular user, addressing questions like \u201cwhat is SQL injection?\u201d or \u201cwhat are some of the most commonly used SQL injection types?\u201d will hopefully move us forward in the right direction to better understanding <a href=\"https:\/\/owasp.org\/www-community\/attacks\/SQL_Injection\" target=\"_blank\" rel=\"noreferrer noopener\">SQL injection attacks<\/a> are, how they work, and how to stop them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, in this article, we\u2019ll discuss how to prevent SQL injection attacks once we have a better understanding of what constitutes this high-risk vulnerability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Is SQL Injection and How Does It Work?<\/strong><\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"227\" src=\"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-attack-breakdown.png\" alt=\"What is an SQL injection? This graphic visually breaks down how an SQL injection attack works\" class=\"wp-image-1051 addshadow\" srcset=\"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-attack-breakdown.png 817w, https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-attack-breakdown-300x83.png 300w, https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-attack-breakdown-560x156.png 560w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><figcaption>This graphic represents how an SQL injection attack works.<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">SQL (structured query language, pronounced \u201csequel\u201d or \u201cS-Q-L,\u201d depending on the user) injection attacks regularly show up on the <a href=\"https:\/\/sectigostore.com\/blog\/what-is-owasp-what-are-the-owasp-top-10-vulnerabilities\/\">OWASP vulnerabilities list<\/a> that reveals the top 10 web application security risks in the industry. SQLi attacks, as they\u2019re also known, rely on inadequate input validation checks that can be circumvented to execute a crafted query as a SQL command on the site\u2019s backend database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">User-supplied data (a malicious string submitted as a search query) can be passed onto the backend database server. Without proper input validation checks, the query may get executed on the server. Apart from data security issues, attackers can exploit this vulnerability to delete tables and wreak havoc, severely disrupting your entire business operation. From verbose error messages that can inadvertently disclose helpful details to a potential attacker to sensitive data stored on the server getting leaked, SQL injection flaws can lead to undesirable and disastrous outcomes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s take a moment to understand what a typical SQL query looks like and how the database processes it. This will help you better understand what SQL injection is and how it works. For this example, imagine that there\u2019s an insecure e-commerce application with no defenses in place against SQL injection attacks. When a user attempts to log in, their browser requests the URL below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;insecure-app.com\/login<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The SQL query that runs on the backend database to log in the user after the credentials are submitted is shown below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM Users WHERE username=\u2018admin\u2019 AND password=\u2019adminpass\u2019;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The asterisk symbol (*) indicates that all the columns from the table \u201cUsers\u201d will display if the login is successful. But now consider that an attacker tries to manipulate the database to log in as the admin user without knowing the password and enters the username as <strong>admin\u2019&#8211;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM Users WHERE username=\u2018admin\u2019--\u2019 AND password=\u2019passw0rd\u2019;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Using line comments (&#8211;) to trick the database into disregarding the remaining query to avoid filling out mandatory parameters or to dodge syntax errors is a common trick deployed in SQL injection attacks. The problem with the above query is that the database comments out the \u201cAND\u201d statement, which leads to the password parameter being ignored. An input parameter in a SQL statement acts like a placeholder to which data can be passed at runtime.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, how do we detect this vulnerability in our applications? Besides relying on manual testing, a common testing tool called <a href=\"http:\/\/sqlmap.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">sqlmap<\/a> can be used to identify and exploit six types of SQL injection vulnerabilities. Some other tools can also be used for detection, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/utkusen\/leviathan\" target=\"_blank\" rel=\"noreferrer noopener\">Leviathan<\/a> (a mass audit toolkit),<\/li><li><a href=\"https:\/\/github.com\/WhitewidowScanner\/whitewidow\" target=\"_blank\" rel=\"noreferrer noopener\">Whitewidow<\/a> (an open-source automated SQL vulnerability scanner), and<\/li><li><a href=\"https:\/\/github.com\/ekultek\/zeus-scanner\" target=\"_blank\" rel=\"noreferrer noopener\">Zeus<\/a> (an open-source reconnaissance and vulnerability assessment tool).<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Types of SQL Injection Attacks<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When it comes to SQL injection types, SQLi attacks can be broadly categorized into three classes:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>In-Band SQLi<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">One of the most common SQL injection types is in-band SQLi, where the data shows up on the same channel that\u2019s used to inject the malicious code. Error-based and <a href=\"https:\/\/www.sqlinjection.net\/union\/\" target=\"_blank\" rel=\"noreferrer noopener\">union-based SQL injection attacks<\/a> are two of the most frequently used in-band SQL injection attack techniques. In error based SQLi attacks, a verbose error (retrieved data) displays right on the web page in response to a malformed or unexpected query (the malicious user input). This is an example of an in-band SQL injection attack.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"843\" height=\"445\" src=\"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-test-query.png\" alt=\"Graphic example of a test query SQL injection\" class=\"wp-image-1052 addshadow\" srcset=\"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-test-query.png 843w, https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-test-query-300x158.png 300w, https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-test-query-560x296.png 560w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><figcaption>Graphic source: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/watch?v=5ulehtDTuvE&amp;t=123s\" target=\"_blank\">YouTube<\/a>. It&#8217;s a screenshot that serves as an example of a test query.<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"343\" src=\"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-verbose-error-message.png\" alt=\"Graphic example of a verbose error message\" class=\"wp-image-1053 addshadow\" srcset=\"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-verbose-error-message.png 932w, https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-verbose-error-message-300x110.png 300w, https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/sql-injection-verbose-error-message-560x206.png 560w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><figcaption>Graphic source: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/watch?v=5ulehtDTuvE&amp;t=123s\" target=\"_blank\">YouTube<\/a>. It&#8217;s a screenshot that&#8217;s an example of a verbose error message.<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Union-based SQLi involves using the UNION SQL operator to combine the results of two or more SELECT statements into a single query and can be employed to extract data from multiple tables within the database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Out-of-Band SQLi<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><a rel=\"noreferrer noopener\" href=\"https:\/\/medium.com\/bugbountywriteup\/out-of-band-oob-sql-injection-87b7c666548b\" target=\"_blank\">Out-of-Band SQLi<\/a> is a less common form of SQL injection type. This is where the attacker is unable to extract the data using the same channel via which he launched the attack. The response to the attack gets delivered via other channels, like email, or it relies on the ability of the application&#8217;s database server to make DNS or HTTP requests to a server controlled by the attacker. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, xp_cmdshell can be utilized by users with DBA permissions to execute commands on a remote database host. Once the query gets executed, attackers can email the results or find a way to transfer the required information to themselves.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Inferential SQLi<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In this type of SQL injection, also known as blind SQLi, there\u2019s no real transfer of data. However, attackers can observe the way in which the application responds to payloads, enabling them to gain insights into whether the query is executed or how the database processes the requests. Although reconstructing the logic of the original query is much easier with verbose errors, an attacker who\u2019s able to successfully execute a blind SQL injection attack on the application can reverse engineer the logic to arrive at the original query.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A time-based blind SQLi attack, another frequently used method, involves examining the delay in response to understand if the query gets executed. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/insecure-app.com\/attack.php?id=1\u2019 and sleep(10)--<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On sending the above request, there is no delay in page loading. If the comment used is tweaked, as shown below, and there is a delayed response, it denotes that the query was executed. The attacker now knows the right syntax for commenting out parts of a query as used by the application. Once they have this bit of knowledge, they can continue attacking the application using this information in future techniques.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/insecure-app.com\/attack.php?id=1\u2019 and sleep(10)#<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So, now that we know what a SQL injection is and are familiar with the different SQL injection types of attacks, it\u2019s time to explore ways to prevent them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Prevent SQL Injection Attacks<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apart from using web application firewalls (like <a href=\"https:\/\/www.modsecurity.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">ModSecurity<\/a>, or <a href=\"https:\/\/github.com\/nbs-system\/naxsi\" target=\"_blank\" rel=\"noreferrer noopener\">NAXSI<\/a> on NGINX) to filter out malicious or dangerous requests, when we talk about how to prevent SQL injection attacks, the most important precautionary measures possibly are the use of parameterized query and proper input validation checks. However, they aren\u2019t the only preventive controls that you can adopt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In addition to discussing these tools, let\u2019s also take a look at a few other tips that can help you prevent SQL injection attacks:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Don\u2019t Trust Any User-Supplied Input<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">User input channels are the primary access points that are exploited to execute SQLi attacks, and it\u2019s here that <a href=\"https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Input_Validation_Cheat_Sheet.html\" target=\"_blank\" rel=\"noreferrer noopener\">input validation<\/a> steps in. Strict context-dependent validation checks (which verify that the type, length, format, allowed characters, etc. match expected values) applied early on in the data flow ensure only inputs that meet a specific set of criteria are permitted. Apart from using semantic validation that is context-based, enforcing syntactic validation to confirm the correct syntax is also considered useful for structured data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Additionally, though not as effective as input validation, consider escaping all user-controllable data based on the supported character escaping scheme.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Refrain From Using Dynamic SQL Queries Whenever Possible<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Dynamic queries used in an insecure manner lead to SQL injection vulnerabilities since the SQL code and the issuing logic are built while it\u2019s processing the user input. However, when using a <a href=\"https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Query_Parameterization_Cheat_Sheet.html\" target=\"_blank\" rel=\"noreferrer noopener\">parameterized query<\/a>, the SQL logic is defined <em>before<\/em> the user input gets passed as parameters. As a result, the user input can\u2019t alter the logic and is strictly passed as a parameter based upon its defined data type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another option is using stored procedures that are implemented in a secure manner without any unsafe dynamic SQL generation. Stored procedures are SQL statements with parameters (that are automatically parameterized) and are saved in the database to be called during execution instead of writing it repeatedly. Nevertheless, stored procedures without proper input validation checks and execution rights can increase the risk potential of an application rather than reduce it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Use Accounts With Least Privileges to Restrict Access in Case of a Breach<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Limiting access and minimizing privileges for every account can restrict the risks associated with unauthorized access. This can be done by:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Assessing the level of access rights required by each account, and the specific tables or portions of it, to which it needs access.<\/li><li>Creating different DB users for different applications.<\/li><li>Avoiding administrative privileges.<\/li><li>Creating views to limit access to underlying tables.<\/li><li>Assigning only read access where feasible.<\/li><li>Carefully considering the impact before granting create or delete access to any database account.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Rely More on Whitelists Since Most Persistent Attackers Can Find a Way Around Blacklists<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We\u2019ve discussed input validation earlier, and there are two ways to approach it \u2014 by using blacklists or whitelists. Blacklists are deployed to block known malicious characters, whereas with whitelisting the user input is vetted against a list of permitted characters. These two approaches are also implemented to block traffic from suspicious IP addresses or to limit access to the addresses included in a whitelist.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Due to evolving attack techniques that can subvert filters, whitelists are generally considered a more effective approach when it comes to security.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Use Appropriate Technology and Frameworks When Developing Your Application<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Most development frameworks in use today come equipped with built-in SQL injection protection mechanisms that aren\u2019t incorporated in older development technologies. Using modern frameworks and environments to build your application can safeguard you from such attacks from the get-go.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, use the object relational mapping (ORM) framework to reduce risks, or rely on PHP data objects (PDO) instead of MySQLi in PHP. However, not all of these are foolproof, and more often than not, deploying a combination of techniques is appropriate. The <a href=\"https:\/\/snyk.io\/blog\/sequelize-orm-npm-library-found-vulnerable-to-sql-injection-attacks\/\" target=\"_blank\" rel=\"noreferrer noopener\">Sequelize ORM<\/a> being vulnerable to SQLi underscores how the code generated by an ORM can sometimes be vulnerable to injection attacks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Conduct Regular Vulnerability Scans and Code Reviews to Detect Potential Second-Order Attacks<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Using automated vulnerability scanning tools and manual web application security assessments will thoroughly investigate your application for any SQL injection or other potential weaknesses that may lead to a security incident. When a user input gets injected into the database but doesn\u2019t trigger an immediate response until activated by a future event, it\u2019s called a second-order SQL injection attack.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, how do you prevent these types of attacks? Secure code reviews can be done to rule out the possibility of second-order SQL injection attacks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7. Install Updates and Patches Regularly to Your Applications<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Running updated software and installing patches regularly to your applications \u2014 and even to the underlying systems on which it runs \u2014 protects you against known vulnerabilities. A security patch or an update is released when a bug that was found or reported in previous versions is fixed by developers. Unless these patches are applied, the application continues to be at risk of being breached by exploiting security bugs that could have been avoided with a simple update.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8. Organize Security Awareness Workshops to Educate Your Staff<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re serious about security, you probably already have security awareness that goes above and beyond conducting annual or biannual workshops as a part of your organization\u2019s culture. Persuading your employees to be cognizant of the fact that <a href=\"https:\/\/sectigostore.com\/blog\/42-cyber-attack-statistics-by-year-a-look-at-the-last-decade\/\">cyber attacks<\/a> are on the rise is crucial. This helps every member of an organization feel responsible for maintaining security on a regular basis.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Awareness workshops are a platform where general security topics or specific questions \u2014 like what is SQL injection, and how to prevent SQL injection attacks \u2014 can be addressed to keep your staff updated on the kinds of security incidents that are prevalent. However, security requires a transformation in attitude to avoid negligent practices. Until that happens, mandatory training and workshops can only take you so far.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>In Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SQL injection attacks have graced the <a href=\"https:\/\/sectigostore.com\/blog\/owasp-iot-top-10-iot-vulnerabilities\/\">OWASP top 10 list<\/a> since it was first published in 2003. It\u2019s been around for a while now and continues to be relevant in part due to misplaced priority when it comes to implementing security controls. This relevancy likely won\u2019t change any time soon since attackers continue to find new ways to evade existing controls.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hopefully, we\u2019ve been able to address your queries around what is SQL injection and SQL injection types. We\u2019ve also provided you with multiple suggestions for how to prevent SQL injection attacks by using a combination of parameterized queries, whitelists, input validation, and applying restrictions through database controls (like the LIMIT SQL clause to prevent mass disclosure in case of a successful breach). Stay tuned for future posts relating to SQL injection attacks by subscribing to our blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Akamai\u2019s State of the Internet report that analyzed data between November 2017 and March 2019 indicates that SQL injection now represents nearly two thirds (65.1%) of all web application attacks&#8230;<\/p>\n","protected":false},"author":9,"featured_media":1054,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":"","tve_updated_post":"","tve_custom_css":"","tve_user_custom_css":"","tve_globals":{},"tcb2_ready":0,"tcb_editor_enabled":0,"tve_landing_page":"","_tve_header":"","_tve_footer":""},"categories":[13],"tags":[76],"class_list":["post-1049","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cyber-security","tag-sql-injection","post-with-tags"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks - InfoSec Insights<\/title>\n<meta name=\"description\" content=\"Wondering what is an SQL injection attack? We&#039;ve got your answers. Here&#039;s everything to know about what it is &amp; how to prevent SQL injection attacks.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks - InfoSec Insights\" \/>\n<meta property=\"og:description\" content=\"Wondering what is an SQL injection attack? We&#039;ve got your answers. Here&#039;s everything to know about what it is &amp; how to prevent SQL injection attacks.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/\" \/>\n<meta property=\"og:site_name\" content=\"InfoSec Insights\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-05T13:48:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-03T16:35:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/what-is-sql-injection.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"1000\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Lumena Mukherjee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lumena Mukherjee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/\"},\"author\":{\"name\":\"Lumena Mukherjee\",\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/#\\\/schema\\\/person\\\/8fc401352fbdfcfdf08996099c088b1f\"},\"headline\":\"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks\",\"datePublished\":\"2020-06-05T13:48:06+00:00\",\"dateModified\":\"2020-11-03T16:35:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/\"},\"wordCount\":2220,\"image\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/what-is-sql-injection.jpg\",\"keywords\":[\"sql injection\"],\"articleSection\":[\"Cyber Security\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/\",\"url\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/\",\"name\":\"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks - InfoSec Insights\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/what-is-sql-injection.jpg\",\"datePublished\":\"2020-06-05T13:48:06+00:00\",\"dateModified\":\"2020-11-03T16:35:03+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/#\\\/schema\\\/person\\\/8fc401352fbdfcfdf08996099c088b1f\"},\"description\":\"Wondering what is an SQL injection attack? We've got your answers. Here's everything to know about what it is & how to prevent SQL injection attacks.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/#primaryimage\",\"url\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/what-is-sql-injection.jpg\",\"contentUrl\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/what-is-sql-injection.jpg\",\"width\":1600,\"height\":1000,\"caption\":\"Computer hacker silhouette of hooded man with internet login screen concept for security, phishing and hacking network account username and password\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/\",\"name\":\"InfoSec Insights\",\"description\":\"SectigoStore.com Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sectigostore.com\\\/blog\\\/#\\\/schema\\\/person\\\/8fc401352fbdfcfdf08996099c088b1f\",\"name\":\"Lumena Mukherjee\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8a52ef8468ca2c6184cc71ebfa0bcdbf4c16ab01d988415c1bc743cb16730db3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8a52ef8468ca2c6184cc71ebfa0bcdbf4c16ab01d988415c1bc743cb16730db3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8a52ef8468ca2c6184cc71ebfa0bcdbf4c16ab01d988415c1bc743cb16730db3?s=96&d=mm&r=g\",\"caption\":\"Lumena Mukherjee\"},\"description\":\"Lumena is a cybersecurity consultant, tech writer, and regular columnist for InfoSec Insights. She is currently pursuing her masters in cybersecurity and has a passion for helping companies implement better security programs to protect their customers' data.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks - InfoSec Insights","description":"Wondering what is an SQL injection attack? We've got your answers. Here's everything to know about what it is & how to prevent SQL injection attacks.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/","og_locale":"en_US","og_type":"article","og_title":"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks - InfoSec Insights","og_description":"Wondering what is an SQL injection attack? We've got your answers. Here's everything to know about what it is & how to prevent SQL injection attacks.","og_url":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/","og_site_name":"InfoSec Insights","article_published_time":"2020-06-05T13:48:06+00:00","article_modified_time":"2020-11-03T16:35:03+00:00","og_image":[{"width":1600,"height":1000,"url":"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/what-is-sql-injection.jpg","type":"image\/jpeg"}],"author":"Lumena Mukherjee","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Lumena Mukherjee","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/#article","isPartOf":{"@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/"},"author":{"name":"Lumena Mukherjee","@id":"https:\/\/sectigostore.com\/blog\/#\/schema\/person\/8fc401352fbdfcfdf08996099c088b1f"},"headline":"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks","datePublished":"2020-06-05T13:48:06+00:00","dateModified":"2020-11-03T16:35:03+00:00","mainEntityOfPage":{"@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/"},"wordCount":2220,"image":{"@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/#primaryimage"},"thumbnailUrl":"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/what-is-sql-injection.jpg","keywords":["sql injection"],"articleSection":["Cyber Security"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/","url":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/","name":"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks - InfoSec Insights","isPartOf":{"@id":"https:\/\/sectigostore.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/#primaryimage"},"image":{"@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/#primaryimage"},"thumbnailUrl":"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/what-is-sql-injection.jpg","datePublished":"2020-06-05T13:48:06+00:00","dateModified":"2020-11-03T16:35:03+00:00","author":{"@id":"https:\/\/sectigostore.com\/blog\/#\/schema\/person\/8fc401352fbdfcfdf08996099c088b1f"},"description":"Wondering what is an SQL injection attack? We've got your answers. Here's everything to know about what it is & how to prevent SQL injection attacks.","breadcrumb":{"@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/#primaryimage","url":"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/what-is-sql-injection.jpg","contentUrl":"https:\/\/sectigostore.com\/blog\/wp-content\/uploads\/2020\/06\/what-is-sql-injection.jpg","width":1600,"height":1000,"caption":"Computer hacker silhouette of hooded man with internet login screen concept for security, phishing and hacking network account username and password"},{"@type":"BreadcrumbList","@id":"https:\/\/sectigostore.com\/blog\/what-is-sql-injection-8-tips-on-how-to-prevent-sql-injection-attacks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sectigostore.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What Is SQL Injection? 8 Tips on How to Prevent SQL Injection Attacks"}]},{"@type":"WebSite","@id":"https:\/\/sectigostore.com\/blog\/#website","url":"https:\/\/sectigostore.com\/blog\/","name":"InfoSec Insights","description":"SectigoStore.com Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sectigostore.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sectigostore.com\/blog\/#\/schema\/person\/8fc401352fbdfcfdf08996099c088b1f","name":"Lumena Mukherjee","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8a52ef8468ca2c6184cc71ebfa0bcdbf4c16ab01d988415c1bc743cb16730db3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8a52ef8468ca2c6184cc71ebfa0bcdbf4c16ab01d988415c1bc743cb16730db3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8a52ef8468ca2c6184cc71ebfa0bcdbf4c16ab01d988415c1bc743cb16730db3?s=96&d=mm&r=g","caption":"Lumena Mukherjee"},"description":"Lumena is a cybersecurity consultant, tech writer, and regular columnist for InfoSec Insights. She is currently pursuing her masters in cybersecurity and has a passion for helping companies implement better security programs to protect their customers' data."}]}},"_links":{"self":[{"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/posts\/1049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/comments?post=1049"}],"version-history":[{"count":0,"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/media\/1054"}],"wp:attachment":[{"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sectigostore.com\/blog\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}