Insecure Processing of Data

This category covers the following issues:

Insecure Deserialization

Why is this important?

Serialization is the process of translating data structures storable formats. In Ruby, objects can be serialized into strings and vice-versa, strings can be deserialized into objects. This functionality can be accessed with methods related to YAML, JSON, CSV, and Marshalling. Insecure deserialization describes the processing of malicious data which in term allows hackers to execute arbitrary code in the context of your application. These issues are common and have been the cause of many high profile breaches.

Fixing Insecure Deserialization

Option A: Use SafeYAML

  1. Go through the issues that GuardRails identified in the PR.
  2. Install safe_yaml by adding this line to your Gemfile:

         gem "safe_yaml"
  3. This would work by default prevent most of the attack vectors against YAML without requiring changing the existing YAML.load methods.

  4. There is more configuration available for this gem.
  5. Test it
  6. Ship it 🚢 and relax 🌴

More information: