Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 2.29 KB

File metadata and controls

26 lines (21 loc) · 2.29 KB

Threat Model Analysis for rails-api/active_model_serializers

Description: An attacker might gain unauthorized access to sensitive data by observing API responses that inadvertently include fields not intended for public exposure. This can happen when developers use broad serialization configurations or fail to explicitly whitelist attributes in serializers. An attacker could simply make API requests and inspect the JSON responses to identify and extract sensitive information. Impact: Information disclosure, privacy violations, potential account compromise, leakage of internal system details. Affected AMS Component: ActiveModel::Serializer class, attributes method, association serialization. Risk Severity: High Mitigation Strategies: * Explicitly define attributes using the attributes method in serializers. * Regularly review serializer configurations, especially after model changes. * Use attribute-level authorization within serializers. * Carefully configure and review association serialization.

Description: An attacker could exploit improperly configured associations to access sensitive data from related models. If serializers for associated models are not equally restrictive, or if associations are serialized when not needed, attackers can retrieve data they should not have access to by simply requesting resources that trigger these associations. Impact: Information disclosure of related model data, potentially exposing more sensitive information than intended for the primary resource. Affected AMS Component: ActiveModel::Serializer class, has_many, belongs_to, has_one association methods, association serializers. Risk Severity: High Mitigation Strategies: * Apply attribute whitelisting to serializers of associated models. * Review association configurations in serializers. * Use serializer: false for associations when only IDs are needed. * Thoroughly test serialization of associated models.