Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
if filters: for key, value in filters.items(): query = query.filter(getattr(self.__model__, key) == value) if offset: query = query.offset(offset)- Confidence
- 74% confidence
- Finding
- This code applies filters using getattr(self.__model__, key) where key comes from the caller-provided filters dict. An attacker who can influence filter keys may trigger access to unintended model attributes, cause exceptions for nonexistent attributes, or abuse ORM descriptors to alter query behavior, resulting in denial of service or unauthorized querying paths.
