Search code examples
node.jscassandrainject

How to use Apache Cassandra securely?


I want to setup Apache Cassandra as my new database. All my code is currently written in NodeJS, so it would be nice to use Cassandra together with the official NodeJS driver: https://github.com/datastax/nodejs-driver. As a beginner of Casandra my question is: What safety precautions should I consider? Does Cassandra or the Node module have problems with CQL injections or other attacks?


Solution

  • You can bind values (prepare them) to your statement instead of string building which is pretty easy to do in node.js driver. Then there is little to no concerns. Whats sent over the wire is a id of the statement and then a list of params that Cassandra will use to query the data.

    If you take untrusted strings from a user and concat a string together you might create a scenario where injections are possible.