Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Application Security //

Database Security

06:16 PM
Connect Directly

New Tool Gives Developers A Free Anti-SQL Injection Shortcut

The open-source AntiSQLi library for .NET and SQL Server automates parameterization during development of database-connected Web apps

As one of the longest-lingering burrs in the saddles of database security and application security professionals, SQL injection continues to plague the Web application world for a myriad of reasons. But none is so oft-lamented as the fact that developers continue to write unparameterized database queries into their code.

That is why Security Innovation and LockBox teamed up to release a new open-source project going live this week on GitHub. The hope is that the new AntiSQLi Library for .NET and SQL Server will help make it easier for developers to parameterize queries with as little fuss as possible, say Joe Basirico, vice president of professional services for Security Innovation, and Kevin Lam, president of LockBox, who helped initiate the project. Initially started as an in-house project to help Lam's developers, the library eventually blossomed into an open-source effort that its first contributors hope will help mitigate SQLi across the industry.

Dark Reading caught up with the duo to discuss the project and how it can help the database security and app sec community:

Dark Reading: What moved you to look for a better way to address SQL injection in the developer community?
Basirico: Around my office we often have this chat about if you could fix just one thing, wave a magic wand and make it disappear, what would it be? When you get a real answer out of them, it's always SQL injection. Being able to just mitigate SQL injection across the board would be huge.

Lam: From my side, as the product developers, we do secure file transfer, and we're in the business of protecting our customers' data. So the last thing we want is to get hacked, especially because of SQL injection, because the impact it creates when someone is able to exploit a SQL injection vulnerability really gets them the keys to the kingdom.

So from a developer's standpoint, we just wanted a way where we could have high assurance that we've mitigated as many SQL injection vulnerabilities across our products as much as possible. So we needed something that was repeatable, that was less prone to human error, and that was implementing industry best practices. [How have attackers managed to 'break' AV with a glut of malware? See 10 Ways Attackers Automate Malware Production.]

Dark Reading: What's the principle behind AntiSQLi?
Lam: This library doesn't create anything new. It's not inventing a new way of mitigating SQL injection. It's just a way of implementing best practices really easily and to make it super easy for developers to deploy best practices in their code.

Dark Reading: OK, so best practice No. 1 is paramaterizing code. But why not just have developers parameterize queries themselves?
Lam: We always teach our developers to use parameterized queries or stored procedures, and we're noticing that developers just aren't doing that.

To me, the evidence is on the news: You see companies getting hit with SQL injection all the time, and data breaches and intrusions just based on that vulnerability alone.

Basirico: When I first heard about AntiSQLi, my first reaction was why not use parameterized queries? That's what people normally use. But then I kind of realized that parameterized queries, stored procedures, and ORMs have been around for a long time, and we continue to see SQL injection happening.

I think the biggest reason for that is simply that those solutions are a little bit hard to use, they require a developer to learn a little bit extra or change their development style, and so adoption is slow. So if we could find a solution that lets people program the way that they normally program, using paradigms that they're already comfortable with and mitigate SQL injection, that seems like a huge win.

Dark Reading: How does AntiSQLi work?
Basirico: The paradigm that Kevin has used is the string format or paradigm. Essentially you have one string. Within that first string you have a number of small parameters, and then after that you have an array of values that you're going to put into that string. So from there, you might have this value turn into the user name, that value will turn into the password, and another value will turn into the role of the user, for example.

That's a really normal kind of paradigm of concatenating strings together. Really, it might be the way that developers are insecurely writing their vulnerable code right now. So they can essentially switch from using a string-form runner to the AntiSQLi library just by calling a different function, and they'll get all these benefits.

Lam: What the library does is it'll inspect each item inside that array and say, 'What type are you' and then it automatically converts into a parameter. We've basically taken out all of that work required for the developer to parameterize each variable that's going into that string and essentially do it for the developer so they can focus more on the business logic rather than having to worry about specifics.

Dark Reading: Why did you decide to go open-source with this project?
Basirico: From our perspective, we're always very open-source-centric. We really see that model work, especially on things like GitHub, where you have the community built in. And from a security perspective, it's an easy win, as well, because people can inherently trust the system.

Lam: If we give someone a black-box solution, they're going to have to take our word for it that this works, but by open-sourcing we give the developer that option for them to understand how the library works and see if there are any benefits to add features or maybe even extend it to other database platforms. They're more free to do that.

Have a comment on this story? Please click "Add Your Comment" below. If you'd like to contact Dark Reading's editors directly, send us a message. Ericka Chickowski specializes in coverage of information technology and business innovation. She has focused on information security for the better part of a decade and regularly writes about the security industry as a contributor to Dark Reading.  View Full Bio

Comment  | 
Print  | 
More Insights
Newest First  |  Oldest First  |  Threaded View
7 Old IT Things Every New InfoSec Pro Should Know
Joan Goodchild, Staff Editor,  4/20/2021
Cloud-Native Businesses Struggle With Security
Robert Lemos, Contributing Writer,  5/6/2021
Defending Against Web Scraping Attacks
Rob Simon, Principal Security Consultant at TrustedSec,  5/7/2021
Register for Dark Reading Newsletters
White Papers
Cartoon Contest
Current Issue
2021 Top Enterprise IT Trends
We've identified the key trends that are poised to impact the IT landscape in 2021. Find out why they're important and how they will affect you today!
Flash Poll
How Enterprises are Developing Secure Applications
How Enterprises are Developing Secure Applications
Recent breaches of third-party apps are driving many organizations to think harder about the security of their off-the-shelf software as they continue to move left in secure software development practices.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
PUBLISHED: 2021-05-17
Hirschmann HiOS 07.1.01, 07.1.02, and 08.1.00 through 08.5.xx and HiSecOS 03.3.00 through 03.5.01 allow remote attackers to change the credentials of existing users.
PUBLISHED: 2021-05-17
An authentication brute-force protection mechanism bypass in telnetd in D-Link Router model DIR-842 firmware version 3.0.2 allows a remote attacker to circumvent the anti-brute-force cool-down delay period via a timing-based side-channel attack
PUBLISHED: 2021-05-17
Incorrect access control in zam64.sys, zam32.sys in MalwareFox AntiMalware where IOCTL's 0x80002014, 0x80002018 expose unrestricted disk read/write capabilities respectively. A non-privileged process can open a handle to \.\ZemanaAntiMalware, register with the driver using IOCTL 0x8000201...
PUBLISHED: 2021-05-17
Incorrect access control in zam64.sys, zam32.sys in MalwareFox AntiMalware allows a non-privileged process to open a handle to \.\ZemanaAntiMalware, register itself with the driver by sending IOCTL 0x80002010, allocate executable memory using a flaw in IOCTL 0x80002040, install a hook wit...
PUBLISHED: 2021-05-17
Intelbras Router RF 301K Firmware 1.1.2 is vulnerable to Cross Site Request Forgery (CSRF) due to lack of validation and insecure configurations in inputs and modules.