Nested Attributes Rejection Bypass Affecting activerecord package, versions < 5.0.0.beta1.1, >= 4.3< 4.2.5.1, >= 4.2< 4.1.14.1, >= 3.2.23< 3.2.22.1, >= 3.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.68% (80th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Nested Attributes Rejection Bypass vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-ACTIVERECORD-20259
  • published24 Jan 2016
  • disclosed24 Jan 2016
  • creditJustin Coyne

Introduced: 24 Jan 2016

CVE-2015-7577  (opens in a new tab)
CWE-284  (opens in a new tab)

How to fix?

Upgrade ActiveRecord to version 5.0.0.beta1.1, 4.2.5.1, 4.1.14.1, 3.2.22.1 or higher.

Overview

ActiveRecord is the Object-Relational Mapping (ORM) that comes out-of-the-box with Rails. It plays the role of Model in the MVC architecture employed by Rails.

Affected versions of this package are vulnerable to Nested Attributes Rejection Bypass. ActiveRecord handles updates in combination with destroy flags when destroying records is disabled. Attackers could use this do things like set attributes to invalid values and to clear all of the attributes amongst other things.

Details

When using the nested attributes feature in ActiveRecord you can prevent the destruction of associated records by passing the allow_destroy: false option to the accepts_nested_attributes_for method. However due to a change in the commit a9b4b5d the _destroy flag prevents the :reject_if proc from being called because it assumes that the record will be destroyed anyway. However this isn't true if :allow_destroy is false so this leads to changes that would have been rejected being applied to the record.

CVSS Scores

version 3.1