New Tool Gives Developers A Free Anti-SQL Injection ShortcutThe 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