NO SQL! NO INJECTION?



Similar documents
No SQL! no injection? A talk on the state of NoSQL security

Protecting the Cloud from Inside

What about MongoDB? can req.body.input 0; var date = new Date(); do {curdate = new Date();} while(curdate-date<10000)

NoSQL, But Even Less Security Bryan Sullivan, Senior Security Researcher, Adobe Secure Software Engineering Team

Project 2: Web Security Pitfalls

Hack-proof Your Drupal App. Key Habits of Secure Drupal Coding

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Attacking MongoDB. Firstov Mihail

CSCC09F Programming on the Web. Mongo DB

REDCap General Security Overview

How To Fix A Web Application Security Vulnerability

Server-Side JavaScript Injection Bryan Sullivan, Senior Security Researcher, Adobe Secure Software Engineering Team July 2011

Enterprise Application Security Workshop Series

DIPLOMA IN WEBDEVELOPMENT

SQL Injection. The ability to inject SQL commands into the database engine through an existing application

NoSQL Database Systems and their Security Challenges

Security Awareness For Website Administrators. State of Illinois Central Management Services Security and Compliance Solutions

Cyber Security Challenge Australia 2014

Hacking the WordpressEcosystem

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

SQL Injection for newbie

The Top Web Application Attacks: Are you vulnerable?

Why NoSQL? Your database options in the new non- relational world IBM Cloudant 1

Hack Proof Your Webapps

CTF Web Security Training. Engin Kirda

SQL Injection. By Artem Kazanstev, ITSO and Alex Beutel, Student

ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus

Current Data Security Issues of NoSQL Databases

Rational AppScan & Ounce Products

Serious Threat. Targets for Attack. Characterization of Attack. SQL Injection 4/9/2010 COMP On August 17, 2009, the United States Justice

Threat Modeling. Categorizing the nature and severity of system vulnerabilities. John B. Dickson, CISSP

How To Let A Lecturer Know If Someone Is At A Lecture Or If They Are At A Guesthouse

Criteria for web application security check. Version

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Web Application Guidelines

Security Basics - Lessons From a Paranoid. Stuart Larsen Yahoo! Paranoids - Pentest

EECS 398 Project 2: Classic Web Vulnerabilities

Hacking de aplicaciones Web

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

SQL Injection. Slides thanks to Prof. Shmatikov at UT Austin

Testing Web Applications for SQL Injection Sam Shober

(WAPT) Web Application Penetration Testing

pset 7: C$50 Finance Zamyla Chan

Securing Your Web Application against security vulnerabilities. Ong Khai Wei, IT Specialist, Development Tools (Rational) IBM Software Group

NoSQL replacement for SQLite (for Beatstream) Antti-Jussi Kovalainen Seminar OHJ-1860: NoSQL databases

Advanced Web Security, Lab

PHP and MongoDB Web Development Beginners Guide by Rubayeet Islam

Web Application Report

SQL Injection Attack Lab

SQL Injection Vulnerabilities in Desktop Applications

A SQL Injection : Internal Investigation of Injection, Detection and Prevention of SQL Injection Attacks

ICTN Enterprise Database Security Issues and Solutions

Perl & NoSQL Focus on MongoDB. Jean-Marie Gouarné jmgdoc@cpan.org

SQL Injection January 23, 2013

Still Aren't Doing. Frank Kim

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES. AUTHOR: Chema Alonso

External Network & Web Application Assessment. For The XXX Group LLC October 2012

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

REDCap Technical Overview

A Review of Web Application Security for Preventing Cyber Crimes

Chapter 1 Web Application (In)security 1

Hacking Web Apps. Detecting and Preventing Web Application Security Problems. Jorge Blanco Alcover. Mike Shema. Technical Editor SYNGRESS

Development. Resilient Software. Secure and. Mark S. Merkow Lakshmikanth Raghavan. CRC Press. Taylor& Francis Croup. Taylor St Francis Group,

Nikolay Zaynelov Annual LUG-БГ Meeting nikolay.zaynelov.com

Improving Web Vulnerability Scanning. Daniel Zulla

Defending against XSS,CSRF, and Clickjacking David Bishop

SECURING APACHE : THE BASICS - III

SQL Injection Attack Lab Using Collabtive

Penetration Testing - a way for improving our cyber security

Integrating Moodle with an external tool

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

OpenLogin: PTA, SAML, and OAuth/OpenID

NoSQL in der Cloud Why? Andreas Hartmann

Threat Intelligence Pty Ltd Specialist Security Training Catalogue

WebCruiser Web Vulnerability Scanner User Guide

Intrusion detection for web applications

Understanding Sql Injection

MongoDB. Or how I learned to stop worrying and love the database. Mathias Stearn. N*SQL Berlin October 22th, gen

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

Secure Coding. Code development practice Mitigates basic vulnerabilities. Made by security experts, for non-security experts

HTTPParameter Pollution. ChrysostomosDaniel

Web Application Attacks And WAF Evasion

Web Development using PHP (WD_PHP) Duration 1.5 months

A Strategic Approach to Web Application Security The importance of a secure software development lifecycle

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

Cloud Elements ecommerce Hub Provisioning Guide API Version 2.0 BETA

CS 558 Internet Systems and Technologies

Six Essential Elements of Web Application Security. Cost Effective Strategies for Defending Your Business

HackMiami Web Application Scanner 2013 PwnOff

Transcription:

NO SQL! NO INJECTION? A talk on the state of NoSQL security IBM Cyber Security Center of Excellence Aviv Ron Alexandra Shulman-Peleg IBM AppScan Emanuel Bronshtein

AVIV RON Security Researcher for IBM Cyber Security Center of Excellence @aviv_ron Focus on Application Security in the cloud Ongoing research on new and emerging application vulnerabilities for IBM AppScan, Application Security Testing AppScan

NOT ONLY SQL According to http://db-engines.com

It s not that relational databases are bad but some use cases have better solutions

We are just saying tables are not the solution for EVERYTHING

Applications of NoSQL BIG DATA REAL TIME WEB PERFORMANCE Images are under Creative Commons license and are attributed to their creators FLEXIBILITY SCALABILITY

SO NO SQL, NO WORRIES?

INTRODUCING NOSQL INJECTIONS

A LOOK AT MONGODB db.books.insert({ title: The Hobbit, author: J.R.R. Tolkien }) db.books.find({ title: The Hobbit, author: J.R.R. Tolkien }) array( title => The hobbit, author => J.R.R. Tolkien );

Login Username: Password: username=tolkien&password=hobbit db->logins->find(array( username =>$_POST[ username ], password =>$_POST[ password ])); { username: tolkien, password: hobbit }

Login Username: Password: username[$ne]=1&password[$ne]=1 db->logins->find( array( username =>array( $ne => 1), password => array( $ne => 1)); { username: { $ne: 1 }, password: { $ne: 1 } }

PHP PARAMETER POLLUTION db->logins->find( array( $where => function() { return this.price < 100 } ));

PHP PARAMETER POLLUTION db->logins->find( array( $where => function() { return this.price < 100 } )); From PHP documentation: Please make sure that for all special query operators (starting with $) you use single quotes so that PHP doesn't try to replace "$exists" with the value of the variable $exists.

NOT ONLY IN PHP let s take a look at JavaScript

Login Username: Password: username=tolkien&password=hobbit string query = { username: + post_username +, password: + post_password + } { username: tolkien, password: hobbit }

Login Username: Password: username=tolkien, $or: [ {}, { a : a&password= } ], $comment: hacked string query = { username: + post_username +, password: + post_password + } { username: tolkien, $or: [ {}, { a : a, password: } ], $comment: hacked }

PEOPLE WILL ALWAYS FIND WAYS TO COMPENSATE FOR LIMITATIONS

NOSQL JAVASCRIPT INJECTION

MONGODB MAP REDUCE $map = "function() { for (var i = 0; i < this.items.length; i++) { emit(this.name, this.items[i].$param); } }"; $reduce = "function(name, sum) { return Array.sum(sum); }"; $opt = "{ out: 'totals' }"; $db->execute("db.stores.mapreduce($map, $reduce, $opt);");

ATTACK ON MAP REDUCE JAVASCRIPT a);}},function(kv) { return 1; }, { out: 'x' });db.injection.insert({success:1});return 1;db.stores.mapReduce(function() { { emit(1,1

ATTACK ON MAP REDUCE JAVASCRIPT a);}},function(kv) { return 1; }, { out: 'x' });db.injection.insert({success:1});return 1;db.stores.mapReduce(function() { { emit(1,1 db.stores.mapreduce(function() { for (var i = 0; i < this.items.length; i++) { emit(this.name, this.items[i].a); } },function(kv) { return 1; }, { out: 'x' }); db.injection.insert({success:1}); return 1;db.stores.mapReduce(function() { { emit(1,1); } }, function(name, sum) { return Array.sum(sum); }, { out: 'totals' });"

NOW LET S HAVE SOME REST

CSRF ATTACK ON NOSQL REST API

DEFENDING AGAINST RISKS

Injections CSRF Encode all user input do not assemble JSON from strings If possible disable Javascript execution on DB else be careful when inserting user input to javascript Beware of $ operators in PHP Check your HTTP API framework for CSRF protection (NO JSONP, use of random token) General DEFENSES Use automatic tools for application security testing that support NoSQL such as IBM AppScan Use of role based access control and the principal of least privilege NoSQL databases suffer from the same security issues their relational siblings do

Q&A AND OPEN DISCUSSION http://xkcd.com/327/