top of page

Common Ruby On Rails Vulnerability

First let’s start by explaining what Ruby On Rails is, among the myriad of programming languages, styles and platforms that exist, Ruby On Rails because interesting in about 2013, although it had existed previously. If is not nearly as popular as the oft used, Java. One thing to key in on is the fact that “Rails” is considered and “application framework”, which means essentially a software library used to support programming within a certain environment. We can view this in the same context as the Android Studio framework and the SWIFT Framework. In order to decrease the confusion, understand that different languages can be used in this framework such as Ruby, javascript, html. There is also however a Ruby programming language! Ruby as a language is not all too popular, although it is general purpose and object oriented, day to day it is more often used for scripting. Let’s hop right into a talking about a few vulnerabilities that Ruby On Rails as a whole has.

SQL Injection:

Although Ruby on Rails isn’t along framework wise in its’ vulnerability to SQL Injection, it’s make up seems to make it more vulnerable day to day. Since 2014 multiple patches have come out to squelch this vulnerability, but as security improves, viruses, attacks and hackers adjust. This vulnerability mainly lies in a library and feature known as Active Record, that is of course directly related to pulling information from databases. Some database admins use raw sql language, queries to retrieve information, ruby on rails has created some easier ways to search for the information, in doing so it opens itself of to SQL Injections. An SQL Injection is the most commonly successful injection attack across the world. It quite often leads to the theft of important information, credit cards, social security numbers and other information. Let’s take a look at an example of how one would pull information from a database. A standard query is for items or people, let’s say you work for a store, furniture store any type of store and you’re looking for data on certain items, or certain customers then you would use “Select” statement in

MySQL such as:

“Mysql> select name, payment method” That’s just an example of information querying. That gives you an idea of what type of information DBA’s often work with. What an attacker can do is input some of these SQL queries into the front-end input forms directly, often bypassing what the form is intended for. You may have a GUI or front facing form that request Username and password, but an attacker may type a query directly into the form that garners them additional information. Essentially, we’re typing a code into the form where we would normally type password, in order to gather us addition information from what is normal. You may only intend for your input or log-in form to allow us to log into the system, but because that form speaks to the database, we'd inject, use a query in hopes of producing additional information. Perhaps DOB, social security number, or even credit card data. Check out the diagram below from W3 resources for an illustrated understanding. There are also more complicate attacks in which attackers attempt to control or own particular tables.

W3 Resources

There are some ways in which you can to an extent protect your website from these issues. Parameterization in state of standard string is one practice that helps.This is the most common way to thwart SQL injection attacks. Continue to view the website, tutorials and articles for additional information.


Single post: Blog_Single_Post_Widget
bottom of page