SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
NoSQL, But Even Less Security
      Bryan Sullivan, Senior Security Researcher, Adobe Secure Software Engineering Team




© 2011 Adobe Systems Incorporated. All Rights Reserved.
Agenda




             Eventual Consistency
             REST APIs and CSRF
             NoSQL Injection
             SSJS Injection



© 2011 Adobe Systems Incorporated. All Rights Reserved.
NoSQL databases




© 2011 Adobe Systems Incorporated. All Rights Reserved.
Eric Brewer’s CAP Theorem



       Choose any two:

                                                                        Availability




                                                                                        Partition
                                                          Consistency
                                                                                       Tolerance




© 2011 Adobe Systems Incorporated. All Rights Reserved.
Eventual consistency in social networking




© 2011 Adobe Systems Incorporated. All Rights Reserved.
Writes don’t propagate immediately




© 2011 Adobe Systems Incorporated. All Rights Reserved.
Reading stale data




© 2011 Adobe Systems Incorporated. All Rights Reserved.
Reading stale data – a more serious case




© 2011 Adobe Systems Incorporated. All Rights Reserved.
Agenda




             Eventual Consistency
             REST APIs and CSRF
             NoSQL Injection
             SSJS Injection



© 2011 Adobe Systems Incorporated. All Rights Reserved.
Authentication is unsupported or discouraged

       From the MongoDB documentation
                 “One valid way to run the Mongo database is in a trusted environment,
                  with no security and authentication”
                 This “is the default option and is recommended”


       From the Cassandra Wiki
                 “The default AllowAllAuthenticator approach is essentially pass-through”


       From CouchDB: The Definitive Guide
             The “Admin Party”: Everyone can do everything by default


        Riak
                  No authentication or authorization support
© 2011 Adobe Systems Incorporated. All Rights Reserved.
Port scanning


       If an attacker finds an open port, he’s already won…

                Database                                          Default Port
           MongoDB                                        27017
                                                          28017
                                                          27080
           CouchDB                                        5984
           Hbase                                          9000
           Cassandra                                      9160
           Neo4j                                          7474
           Riak                                           8098


© 2011 Adobe Systems Incorporated. All Rights Reserved.
Port Scanning Demo



© 2011 Adobe Systems Incorporated. All Rights Reserved.
Port scanning


       If an attacker finds an open port, he’s already won…

                Database                                          Default Port
           MongoDB                                        27017
                                                          28017
                                                          27080
           CouchDB                                        5984
           Hbase                                          9000
           Cassandra                                      9160
           Neo4j                                          7474
           Riak                                           8098


© 2011 Adobe Systems Incorporated. All Rights Reserved.
REST document API examples (CouchDB)


           Retrieve a document                            Update a document
      GET /mydb/doc_id HTTP/1.0                           PUT /mydb/doc_id HTTP/1.0
                                                          {
                                                            "album" : "Brothers",
                                                            "artist" : "The Black Keys"
                                                          }


           Create a document                              Delete a document
      POST /mydb/ HTTP/1.0                                DELETE /mydb/doc_id?
        {                                                  rev=12345 HTTP/1.0
          "album" : "Brothers",
          "artist" : "Black Keys"
        }


© 2011 Adobe Systems Incorporated. All Rights Reserved.
Cross-Site Request Forgery (CSRF) firewall bypass




© 2011 Adobe Systems Incorporated. All Rights Reserved.
REST document API examples (CouchDB)


           Retrieve a document                            Update a document
      GET /mydb/doc_id HTTP/1.0                           PUT /mydb/doc_id HTTP/1.0
                                                          {
                                                            "album" : "Brothers",
                                                            "artist" : "The Black Keys"
                                                          }


           Create a document                              Delete a document
      POST /mydb/ HTTP/1.0                                DELETE /mydb/doc_id?
        {                                                  rev=12345 HTTP/1.0
          "album" : "Brothers",
          "artist" : "Black Keys"
        }


© 2011 Adobe Systems Incorporated. All Rights Reserved.
Traditional GET-based CSRF




           <img src="http://nosql:5984/_all_dbs"/>


       Easy to make a potential victim request this URL
       But it doesn’t do the attacker any good
       He needs to get the data back out to himself



© 2011 Adobe Systems Incorporated. All Rights Reserved.
RIA GET-based CSRF


  <script>
                var xhr = new XMLHttpRequest();
                xhr.open('get', 'http://nosql:5984/_all_dbs');
                xhr.send();
  </script>


       Just as easy to make a potential victim request this URL
       Same-origin policy won’t allow this (usually)
       Same issue for PUT and DELETE

© 2011 Adobe Systems Incorporated. All Rights Reserved.
POST-based CSRF


  <form method=post action='http://nosql:5984/db'>
               <input type='hidden' name='{"data"}' value='' />
  </form>
  <script>
               // auto-submit the form
  </script>


       Ok by the same-origin policy!



© 2011 Adobe Systems Incorporated. All Rights Reserved.
REST-CSRF Demo



© 2011 Adobe Systems Incorporated. All Rights Reserved.
POST is all an attacker needs



                                                          Insert arbitrary data


                                        Insert arbitrary script data


                   Execute any REST command from
                           inside the firewall

© 2011 Adobe Systems Incorporated. All Rights Reserved.
Agenda




             Eventual Consistency
             REST APIs and CSRF
             NoSQL Injection
             SSJS Injection



© 2011 Adobe Systems Incorporated. All Rights Reserved.
NoSQL injection


       Most developers believe they don’t have to worry
        about things like this


  “…with MongoDB we are not building queries from
   strings, so traditional SQL injection attacks are not a
   problem.”
                                                          -MongoDB Developer FAQ


       They’re mostly correct

© 2011 Adobe Systems Incorporated. All Rights Reserved.
MongoDB and PHP


       MongoDB expects input in JSON array format
        find( { 'artist' : 'The Black Keys' } )


       In PHP, you do this with associative arrays
        $collection->find(array('artist' => 'The Black Keys'));


       This makes injection attacks difficult
       Like parameterized queries for SQL



© 2011 Adobe Systems Incorporated. All Rights Reserved.
MongoDB and PHP


       You also use associative arrays for query criteria
        find( { 'album_year' : { '$gte' : 2011} } )
        find( { 'artist' : { '$ne' : 'Lady Gaga' } } )


       But PHP will automatically create associative arrays
        from querystring inputs with square brackets
        page.php?param[foo]=bar
        param == array('foo' => 'bar');




© 2011 Adobe Systems Incorporated. All Rights Reserved.
NoSQL Injection Demo



© 2011 Adobe Systems Incorporated. All Rights Reserved.
$where queries


       The $where clause lets you specify script to filter results

        find( { '$where' : 'function() { return artist == "Weezer"; }}' )


        find ( '$where' : 'function() {
                var len = artist.length;
                for (int i=2; i<len; i++) {
                  if (len % I == 0) return false;
                }
                return true; }')



© 2011 Adobe Systems Incorporated. All Rights Reserved.
NoSQL Injection Demo #2



© 2011 Adobe Systems Incorporated. All Rights Reserved.
Agenda




             Eventual Consistency
             REST APIs and CSRF
             NoSQL Injection
             SSJS Injection



© 2011 Adobe Systems Incorporated. All Rights Reserved.
Browser war fallout


    Browser wars have given us incredibly fast and powerful JS engines




                           V8                             WebKit   SpiderMonkey
                                                           Nitro       Rhino


    Used for a lot more than just browsers
    Like NoSQL database engines…

© 2011 Adobe Systems Incorporated. All Rights Reserved.
Server-side JavaScript injection vs. XSS


       Client-side JavaScript injection
        (aka XSS) is #2 on OWASP Top Ten


       Use it to steal authentication cookies
       Impersonate victim
       Create inline phishing sites
       Self-replicating webworms ie Samy


       It’s really bad.
       But server-side is much worse.

© 2011 Adobe Systems Incorporated. All Rights Reserved.
Server-Side Javascript Injection (SSJI)



© 2011 Adobe Systems Incorporated. All Rights Reserved.
SSJI red flags


       $where clauses
             Built with user input
             Injected from querystring manipulation


       eval() clauses


       Map/Reduce


       Stored views/design docs
             More CSRF possibilities here


© 2011 Adobe Systems Incorporated. All Rights Reserved.
Wrapping Up



© 2011 Adobe Systems Incorporated. All Rights Reserved.
Conclusions


  1.           Always use authentication/authorization.
                    Firewalls alone are not sufficient
                    Sometimes you may have to write your own auth code
                    This is unfortunate but better than the alternative


  2.           Be extremely careful with server-side script.
                    Validate, validate, validate
                    Escape input too



© 2011 Adobe Systems Incorporated. All Rights Reserved.
Read my blog: http://blogs.adobe.com/asset
  Email me: brsulliv




© 2011 Adobe Systems Incorporated. All Rights Reserved.
© 2011 Adobe Systems Incorporated. All Rights Reserved.

Weitere ähnliche Inhalte

Was ist angesagt?

Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Ontico
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...Ontico
 
微博cache设计谈
微博cache设计谈微博cache设计谈
微博cache设计谈Tim Y
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersSeveralnines
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deploymentYoshinori Matsunobu
 
Performance analysis with_ceph
Performance analysis with_cephPerformance analysis with_ceph
Performance analysis with_cephAlex Lau
 
Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)
Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)
Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)Ontico
 
Scaling MongoDB in the cloud with Microsoft Azure
Scaling MongoDB in the cloud with Microsoft AzureScaling MongoDB in the cloud with Microsoft Azure
Scaling MongoDB in the cloud with Microsoft AzureIvan Fioravanti
 
SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)Lars Marowsky-Brée
 
Build an affordable Cloud Stroage
Build an affordable Cloud StroageBuild an affordable Cloud Stroage
Build an affordable Cloud StroageAlex Lau
 
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...Danielle Womboldt
 
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFSHadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFSErik Krogen
 
Webinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica SetWebinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica SetMongoDB
 
Ceph - High Performance Without High Costs
Ceph - High Performance Without High CostsCeph - High Performance Without High Costs
Ceph - High Performance Without High CostsJonathan Long
 
Scaling Cassandra for Big Data
Scaling Cassandra for Big DataScaling Cassandra for Big Data
Scaling Cassandra for Big DataDataStax Academy
 
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Ontico
 
Glauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformGlauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformDon Marti
 
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and ChefDevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and ChefGaurav "GP" Pal
 

Was ist angesagt? (20)

Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...
 
微博cache设计谈
微博cache设计谈微博cache设计谈
微博cache设计谈
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB Clusters
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deployment
 
Performance analysis with_ceph
Performance analysis with_cephPerformance analysis with_ceph
Performance analysis with_ceph
 
Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)
Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)
Ужимай и властвуй алгоритмы компрессии в базах данных / Петр Зайцев (Percona)
 
Scaling MongoDB in the cloud with Microsoft Azure
Scaling MongoDB in the cloud with Microsoft AzureScaling MongoDB in the cloud with Microsoft Azure
Scaling MongoDB in the cloud with Microsoft Azure
 
SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)
 
Build an affordable Cloud Stroage
Build an affordable Cloud StroageBuild an affordable Cloud Stroage
Build an affordable Cloud Stroage
 
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
 
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFSHadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
 
Webinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica SetWebinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica Set
 
Ceph - High Performance Without High Costs
Ceph - High Performance Without High CostsCeph - High Performance Without High Costs
Ceph - High Performance Without High Costs
 
Scaling Cassandra for Big Data
Scaling Cassandra for Big DataScaling Cassandra for Big Data
Scaling Cassandra for Big Data
 
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
 
MyRocks Deep Dive
MyRocks Deep DiveMyRocks Deep Dive
MyRocks Deep Dive
 
Glauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformGlauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platform
 
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and ChefDevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
 

Andere mochten auch

MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用iammutex
 
NoSQL误用和常见陷阱分析
NoSQL误用和常见陷阱分析NoSQL误用和常见陷阱分析
NoSQL误用和常见陷阱分析iammutex
 
Webinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDBWebinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDBBoxed Ice
 
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachLiving with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachJeremy Zawodny
 
Midas - on-the-fly schema migration tool for MongoDB.
Midas - on-the-fly schema migration tool for MongoDB.Midas - on-the-fly schema migration tool for MongoDB.
Midas - on-the-fly schema migration tool for MongoDB.Dhaval Dalal
 
Lessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistLessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistJeremy Zawodny
 

Andere mochten auch (6)

MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用
 
NoSQL误用和常见陷阱分析
NoSQL误用和常见陷阱分析NoSQL误用和常见陷阱分析
NoSQL误用和常见陷阱分析
 
Webinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDBWebinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDB
 
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachLiving with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
 
Midas - on-the-fly schema migration tool for MongoDB.
Midas - on-the-fly schema migration tool for MongoDB.Midas - on-the-fly schema migration tool for MongoDB.
Midas - on-the-fly schema migration tool for MongoDB.
 
Lessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistLessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at Craigslist
 

Ähnlich wie No sql but even less security

Defending Against Application DoS attacks
Defending Against Application DoS attacksDefending Against Application DoS attacks
Defending Against Application DoS attacksRoberto Suggi Liverani
 
NoSQL - No Security?
NoSQL - No Security?NoSQL - No Security?
NoSQL - No Security?Gavin Holt
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesEric Bottard
 
Asec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwnedAsec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwnedDinis Cruz
 
Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and JerseyChris Winters
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backendDavid Padbury
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best PracticesEric Bottard
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menujtimberman
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBJesse Wolgamott
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOpsMatt Ray
 
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6ForgeRock
 
Microservices and Friends
Microservices and FriendsMicroservices and Friends
Microservices and FriendsYun Zhi Lin
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09manisoft84
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open SourceBertrand Delacretaz
 
Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopShubhra Kar
 
RESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services FrameworkRESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services Frameworkgoodfriday
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open SourceBertrand Delacretaz
 
Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect Cécile Benhamou
 
Evolving Archetecture
Evolving ArchetectureEvolving Archetecture
Evolving Archetectureleo lapworth
 

Ähnlich wie No sql but even less security (20)

Defending Against Application DoS attacks
Defending Against Application DoS attacksDefending Against Application DoS attacks
Defending Against Application DoS attacks
 
NoSQL - No Security?
NoSQL - No Security?NoSQL - No Security?
NoSQL - No Security?
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best Practices
 
Asec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwnedAsec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwned
 
Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and Jersey
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best Practices
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menu
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
 
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
 
Microservices and Friends
Microservices and FriendsMicroservices and Friends
Microservices and Friends
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open Source
 
Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshop
 
RESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services FrameworkRESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services Framework
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open Source
 
Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect
 
Evolving Archetecture
Evolving ArchetectureEvolving Archetecture
Evolving Archetecture
 

Mehr von iammutex

Scaling Instagram
Scaling InstagramScaling Instagram
Scaling Instagramiammutex
 
8 minute MongoDB tutorial slide
8 minute MongoDB tutorial slide8 minute MongoDB tutorial slide
8 minute MongoDB tutorial slideiammutex
 
Thoughts on Transaction and Consistency Models
Thoughts on Transaction and Consistency ModelsThoughts on Transaction and Consistency Models
Thoughts on Transaction and Consistency Modelsiammutex
 
Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告iammutex
 
redis 适用场景与实现
redis 适用场景与实现redis 适用场景与实现
redis 适用场景与实现iammutex
 
Introduction to couchdb
Introduction to couchdbIntroduction to couchdb
Introduction to couchdbiammutex
 
What every data programmer needs to know about disks
What every data programmer needs to know about disksWhat every data programmer needs to know about disks
What every data programmer needs to know about disksiammutex
 
redis运维之道
redis运维之道redis运维之道
redis运维之道iammutex
 
Realtime hadoopsigmod2011
Realtime hadoopsigmod2011Realtime hadoopsigmod2011
Realtime hadoopsigmod2011iammutex
 
[译]No sql生态系统
[译]No sql生态系统[译]No sql生态系统
[译]No sql生态系统iammutex
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbaseiammutex
 
Redis cluster
Redis clusterRedis cluster
Redis clusteriammutex
 
Redis cluster
Redis clusterRedis cluster
Redis clusteriammutex
 
Hadoop introduction berlin buzzwords 2011
Hadoop introduction   berlin buzzwords 2011Hadoop introduction   berlin buzzwords 2011
Hadoop introduction berlin buzzwords 2011iammutex
 
Couchdb and me
Couchdb and meCouchdb and me
Couchdb and meiammutex
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators iammutex
 
MongoDB开发应用实践
MongoDB开发应用实践MongoDB开发应用实践
MongoDB开发应用实践iammutex
 

Mehr von iammutex (20)

Scaling Instagram
Scaling InstagramScaling Instagram
Scaling Instagram
 
8 minute MongoDB tutorial slide
8 minute MongoDB tutorial slide8 minute MongoDB tutorial slide
8 minute MongoDB tutorial slide
 
skip list
skip listskip list
skip list
 
Thoughts on Transaction and Consistency Models
Thoughts on Transaction and Consistency ModelsThoughts on Transaction and Consistency Models
Thoughts on Transaction and Consistency Models
 
Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告
 
redis 适用场景与实现
redis 适用场景与实现redis 适用场景与实现
redis 适用场景与实现
 
Introduction to couchdb
Introduction to couchdbIntroduction to couchdb
Introduction to couchdb
 
What every data programmer needs to know about disks
What every data programmer needs to know about disksWhat every data programmer needs to know about disks
What every data programmer needs to know about disks
 
Ooredis
OoredisOoredis
Ooredis
 
Ooredis
OoredisOoredis
Ooredis
 
redis运维之道
redis运维之道redis运维之道
redis运维之道
 
Realtime hadoopsigmod2011
Realtime hadoopsigmod2011Realtime hadoopsigmod2011
Realtime hadoopsigmod2011
 
[译]No sql生态系统
[译]No sql生态系统[译]No sql生态系统
[译]No sql生态系统
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbase
 
Redis cluster
Redis clusterRedis cluster
Redis cluster
 
Redis cluster
Redis clusterRedis cluster
Redis cluster
 
Hadoop introduction berlin buzzwords 2011
Hadoop introduction   berlin buzzwords 2011Hadoop introduction   berlin buzzwords 2011
Hadoop introduction berlin buzzwords 2011
 
Couchdb and me
Couchdb and meCouchdb and me
Couchdb and me
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators
 
MongoDB开发应用实践
MongoDB开发应用实践MongoDB开发应用实践
MongoDB开发应用实践
 

Kürzlich hochgeladen

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

No sql but even less security

  • 1. NoSQL, But Even Less Security Bryan Sullivan, Senior Security Researcher, Adobe Secure Software Engineering Team © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 2. Agenda Eventual Consistency REST APIs and CSRF NoSQL Injection SSJS Injection © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 3. NoSQL databases © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 4. Eric Brewer’s CAP Theorem Choose any two: Availability Partition Consistency Tolerance © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 5. Eventual consistency in social networking © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 6. Writes don’t propagate immediately © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 7. Reading stale data © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 8. Reading stale data – a more serious case © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 9. Agenda Eventual Consistency REST APIs and CSRF NoSQL Injection SSJS Injection © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 10. Authentication is unsupported or discouraged  From the MongoDB documentation  “One valid way to run the Mongo database is in a trusted environment, with no security and authentication”  This “is the default option and is recommended”  From the Cassandra Wiki  “The default AllowAllAuthenticator approach is essentially pass-through”  From CouchDB: The Definitive Guide  The “Admin Party”: Everyone can do everything by default  Riak  No authentication or authorization support © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 11. Port scanning  If an attacker finds an open port, he’s already won… Database Default Port MongoDB 27017 28017 27080 CouchDB 5984 Hbase 9000 Cassandra 9160 Neo4j 7474 Riak 8098 © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 12. Port Scanning Demo © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 13. Port scanning  If an attacker finds an open port, he’s already won… Database Default Port MongoDB 27017 28017 27080 CouchDB 5984 Hbase 9000 Cassandra 9160 Neo4j 7474 Riak 8098 © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 14. REST document API examples (CouchDB)  Retrieve a document  Update a document GET /mydb/doc_id HTTP/1.0 PUT /mydb/doc_id HTTP/1.0 { "album" : "Brothers", "artist" : "The Black Keys" }  Create a document  Delete a document POST /mydb/ HTTP/1.0 DELETE /mydb/doc_id? { rev=12345 HTTP/1.0 "album" : "Brothers", "artist" : "Black Keys" } © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 15. Cross-Site Request Forgery (CSRF) firewall bypass © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 16. REST document API examples (CouchDB)  Retrieve a document  Update a document GET /mydb/doc_id HTTP/1.0 PUT /mydb/doc_id HTTP/1.0 { "album" : "Brothers", "artist" : "The Black Keys" }  Create a document  Delete a document POST /mydb/ HTTP/1.0 DELETE /mydb/doc_id? { rev=12345 HTTP/1.0 "album" : "Brothers", "artist" : "Black Keys" } © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 17. Traditional GET-based CSRF <img src="http://nosql:5984/_all_dbs"/>  Easy to make a potential victim request this URL  But it doesn’t do the attacker any good  He needs to get the data back out to himself © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 18. RIA GET-based CSRF <script> var xhr = new XMLHttpRequest(); xhr.open('get', 'http://nosql:5984/_all_dbs'); xhr.send(); </script>  Just as easy to make a potential victim request this URL  Same-origin policy won’t allow this (usually)  Same issue for PUT and DELETE © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 19. POST-based CSRF <form method=post action='http://nosql:5984/db'> <input type='hidden' name='{"data"}' value='' /> </form> <script> // auto-submit the form </script>  Ok by the same-origin policy! © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 20. REST-CSRF Demo © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 21. POST is all an attacker needs Insert arbitrary data Insert arbitrary script data Execute any REST command from inside the firewall © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 22. Agenda Eventual Consistency REST APIs and CSRF NoSQL Injection SSJS Injection © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 23. NoSQL injection  Most developers believe they don’t have to worry about things like this “…with MongoDB we are not building queries from strings, so traditional SQL injection attacks are not a problem.” -MongoDB Developer FAQ  They’re mostly correct © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 24. MongoDB and PHP  MongoDB expects input in JSON array format find( { 'artist' : 'The Black Keys' } )  In PHP, you do this with associative arrays $collection->find(array('artist' => 'The Black Keys'));  This makes injection attacks difficult  Like parameterized queries for SQL © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 25. MongoDB and PHP  You also use associative arrays for query criteria find( { 'album_year' : { '$gte' : 2011} } ) find( { 'artist' : { '$ne' : 'Lady Gaga' } } )  But PHP will automatically create associative arrays from querystring inputs with square brackets page.php?param[foo]=bar param == array('foo' => 'bar'); © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 26. NoSQL Injection Demo © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 27. $where queries  The $where clause lets you specify script to filter results find( { '$where' : 'function() { return artist == "Weezer"; }}' ) find ( '$where' : 'function() { var len = artist.length; for (int i=2; i<len; i++) { if (len % I == 0) return false; } return true; }') © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 28. NoSQL Injection Demo #2 © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 29. Agenda Eventual Consistency REST APIs and CSRF NoSQL Injection SSJS Injection © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 30. Browser war fallout  Browser wars have given us incredibly fast and powerful JS engines V8 WebKit SpiderMonkey Nitro Rhino  Used for a lot more than just browsers  Like NoSQL database engines… © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 31. Server-side JavaScript injection vs. XSS  Client-side JavaScript injection (aka XSS) is #2 on OWASP Top Ten  Use it to steal authentication cookies  Impersonate victim  Create inline phishing sites  Self-replicating webworms ie Samy  It’s really bad.  But server-side is much worse. © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 32. Server-Side Javascript Injection (SSJI) © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 33. SSJI red flags  $where clauses  Built with user input  Injected from querystring manipulation  eval() clauses  Map/Reduce  Stored views/design docs  More CSRF possibilities here © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 34. Wrapping Up © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 35. Conclusions 1. Always use authentication/authorization.  Firewalls alone are not sufficient  Sometimes you may have to write your own auth code  This is unfortunate but better than the alternative 2. Be extremely careful with server-side script.  Validate, validate, validate  Escape input too © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 36. Read my blog: http://blogs.adobe.com/asset Email me: brsulliv © 2011 Adobe Systems Incorporated. All Rights Reserved.
  • 37. © 2011 Adobe Systems Incorporated. All Rights Reserved.