<?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: Tim Kellogg</title>
    <description>The latest articles on DEV Community by Tim Kellogg (@kellogh).</description>
    <link>https://dev.to/kellogh</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%2F810%2FIMG_1101.JPG</url>
      <title>DEV Community: Tim Kellogg</title>
      <link>https://dev.to/kellogh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kellogh"/>
    <language>en</language>
    <item>
      <title>SQL is Insecure</title>
      <dc:creator>Tim Kellogg</dc:creator>
      <pubDate>Sun, 25 Dec 2016 04:47:34 +0000</pubDate>
      <link>https://dev.to/kellogh/sql-is-insecure</link>
      <guid>https://dev.to/kellogh/sql-is-insecure</guid>
      <description>&lt;p&gt;SQL is insecure, tell everyone. If you use SQL, your website will get hacked. Tell everyone.&lt;/p&gt;

&lt;p&gt;I saw the news that the US Elections Agency &lt;a href="http://www.reuters.com/article/us-election-hack-commission-idUSKBN1442VC"&gt;was hacked by a SQL injection attack&lt;/a&gt; and I kind of lost it. It's been well over two decades since &lt;a href="https://en.wikipedia.org/wiki/Prepared_statement"&gt;prepared statements&lt;/a&gt; were introduced. We've &lt;a href="https://ics-cert.us-cert.gov/sites/default/files/recommended_practices/DHS_Common_Cybersecurity_Vulnerabilities_ICS_2010.pdf"&gt;educated and advised&lt;/a&gt; developers about how to avoid SQL injection, yet it still happens. If education failed, all we can do is shame developers into never using SQL.&lt;/p&gt;

&lt;p&gt;I actually really like SQL, I've even made &lt;a href="http://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-reference.html"&gt;a SQL dialect&lt;/a&gt;. SQL's relational algebra is expressive, probably more so than any other NoSQL database I know of. But developers have proven far too often that it's simply too difficult to know when to use prepared statements or just concatenate strings — it's time we just abandon SQL altogether. It isn't worth it. It's time we called for all government's to ban use of SQL databases in government contracts and in healthcare. There must be utter clarity.&lt;/p&gt;

&lt;p&gt;Part of the problem is the curse of the junior developer. They're experienced enough to realize that their employers will reward rapid development, but inexperienced enough to not understand the tremendous cost associated with sloppy code.&lt;/p&gt;

&lt;p&gt;As a senior develper you might note that a relational database provides the flexibility you need to be successful. You know how to use prepared statements to prevent SQL injection. They are a little more work than simply concatenating user input with executable SQL code, but not much more. The decision seems obvious: use SQL.&lt;/p&gt;

&lt;p&gt;But 2 years from now, after you quit this job, a very junior developer picks up your code with some very tight deadlines and a ton of management pressure. Does he know about prepared statements? Maybe, maybe not. Either way, it is a lot easier and faster to slop the code together and get shit done, so that's what he does.&lt;/p&gt;

&lt;p&gt;It's time we accepted fate and let SQL die. Software runs our world now. When our software fails, people's lives actually get messed up. Companies will always want software to be made for cheap, but it's our ethical responsibility as senior developers to prevent future mistakes from being made under pressure.&lt;/p&gt;

&lt;p&gt;Security is paramount. Your customers are worth it. Abandon SQL.&lt;/p&gt;

</description>
      <category>security</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
