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
- 82% confidence
- Finding
- The list() method applies filters using getattr(self.__model__, key) where key comes from the caller. Although SQLAlchemy prevents classic SQL injection here, unvalidated attribute selection can let callers query on unintended model fields, including sensitive ones, and can raise exceptions for invalid names, enabling misuse or denial-of-service in higher-level flows. In this skill, that matters more because the same DAO also manages user and token-related records unrelated to the stated image/video summary purpose.
