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


Recommended Reading:

Comment  | 
Print  | 
More Insights
Newest First  |  Oldest First  |  Threaded View
COVID-19: Latest Security News & Commentary
Dark Reading Staff 8/3/2020
Pen Testers Who Got Arrested Doing Their Jobs Tell All
Kelly Jackson Higgins, Executive Editor at Dark Reading,  8/5/2020
New 'Nanodegree' Program Provides Hands-On Cybersecurity Training
Nicole Ferraro, Contributing Writer,  8/3/2020
Register for Dark Reading Newsletters
White Papers
Cartoon Contest
Current Issue
Special Report: Computing's New Normal, a Dark Reading Perspective
This special report examines how IT security organizations have adapted to the "new normal" of computing and what the long-term effects will be. Read it and get a unique set of perspectives on issues ranging from new threats & vulnerabilities as a result of remote working to how enterprise security strategy will be affected long term.
Flash Poll
The Changing Face of Threat Intelligence
The Changing Face of Threat Intelligence
This special report takes a look at how enterprises are using threat intelligence, as well as emerging best practices for integrating threat intel into security operations and incident response. Download it today!
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
PUBLISHED: 2020-08-07
Lindy 42633 4-Port USB 2.0 Gigabit Network Server 2.078.000 devices allow an attacker on the same network to elevate privileges because the administrative password can be discovered by sniffing unencrypted UDP traffic.
PUBLISHED: 2020-08-07
Lindy 42633 4-Port USB 2.0 Gigabit Network Server 2.078.000 devices allow an attacker on the same network to bypass authentication via a web-administration request that lacks a password parameter.
PUBLISHED: 2020-08-07
Lindy 42633 4-Port USB 2.0 Gigabit Network Server 2.078.000 devices allow an attacker on the same network to conduct persistent XSS attacks by leveraging administrative privileges to set a crafted server name.
PUBLISHED: 2020-08-07
Lindy 42633 4-Port USB 2.0 Gigabit Network Server 2.078.000 devices allow an attacker on the same network to denial-of-service the device via long input values.
PUBLISHED: 2020-08-07
DIGITUS DA-70254 4-Port Gigabit Network Hub 2.073.000.E0008 devices allow an attacker on the same network to elevate privileges because the administrative password can be discovered by sniffing unencrypted UDP traffic.