<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shkarsardar</title>
    <description>The latest articles on DEV Community by Shkarsardar (@shkarsardar).</description>
    <link>https://dev.to/shkarsardar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F346251%2F8cb6370d-7e42-49c9-8cc1-ed956fe45372.png</url>
      <title>DEV Community: Shkarsardar</title>
      <link>https://dev.to/shkarsardar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shkarsardar"/>
    <language>en</language>
    <item>
      <title>The Sneaky Danger of SQL Injection Attacks</title>
      <dc:creator>Shkarsardar</dc:creator>
      <pubDate>Wed, 16 Aug 2023 10:56:02 +0000</pubDate>
      <link>https://dev.to/shkarsardar/the-sneaky-danger-of-sql-injection-attacks-204m</link>
      <guid>https://dev.to/shkarsardar/the-sneaky-danger-of-sql-injection-attacks-204m</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DhSRLVVn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wy2q0whdo0fk1ge14s5c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DhSRLVVn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wy2q0whdo0fk1ge14s5c.png" alt="Image description" width="800" height="463"&gt;&lt;/a&gt;SQL injection is a common hacking technique that manipulates  database queries. It can give attackers unauthorized access to sensitive information. Despite being well-known, SQL injection remains a major web application vulnerability due to inadequate safeguards.&lt;/p&gt;

&lt;p&gt;How It Works &lt;/p&gt;

&lt;p&gt;Many web apps use SQL to interface with databases. Hackers can insert malicious SQL code into input fields, like search bars, to modify queries:&lt;/p&gt;

&lt;p&gt;Normal query:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT * FROM users WHERE name = 'username'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;With injection: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT * FROM users WHERE name = 'username' OR '1'='1'--&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The injected code  &lt;code&gt;'1'='1'--&lt;/code&gt;  makes the query return all records. This tricks the app into handing over data without authentication.&lt;/p&gt;

&lt;p&gt;Dangers of SQL Injection&lt;/p&gt;

&lt;p&gt;Successful injection can let hackers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Steal personal data like credit cards or passwords&lt;/li&gt;
&lt;li&gt;Access and modify sensitive information &lt;/li&gt;
&lt;li&gt;Install malware on servers&lt;/li&gt;
&lt;li&gt;Perform denial of service attacks &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even huge sites like Facebook and Yahoo have fallen victim to SQL injection. The impact can be severe.&lt;/p&gt;

&lt;p&gt;Preventing Injection Attacks&lt;/p&gt;

&lt;p&gt;Defending against SQL injection requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Input validation and sanitization - filter out dangerous characters&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Parameterized queries - separate data from SQL code &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Minimizing database permissions &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Security scanning to identify vulnerabilities&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SQL injection is a sneaky and devastating attack vector. But following secure coding practices will help shut the door on injection attacks. &lt;/p&gt;

</description>
      <category>programming</category>
      <category>security</category>
      <category>hashin</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
