Skip to content

Unprotected Mass Assignment

Description

Using `:without_protection => true` during mass assignment allows users to bypass permissions protections, making the application vulnerable to unauthorized access or data manipulation.

Examples

Insecure Code

ruby
User.new(params[:user], :without_protection => true)

Secure Code

ruby
class User < ActiveRecord::Base
  attr_accessible :name, :email
end

Remediation

Configure `attr_accessible` to control attribute access instead of using `:without_protection => true`

Rule Details

FieldValue
IDCODE-0543
CategoryInjection
SeverityMEDIUM
CWECWE-915
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
Tagsmass assignment, attribute access
OWASPA6:2017-Security Misconfiguration, A08:2021-Software and Data Integrity Failures

References