The vulnerability is an ORM leak caused by improper validation of filterable fields in the Harbor application. The q query parameter, used across multiple API endpoints, allows filtering on database table columns. The core of the issue lies in the orm.metadata.Filterable function, which incorrectly determined that any existing field in a model was filterable, ignoring any security-related annotations. This allowed an attacker with knowledge of the data models to craft queries that could leak sensitive information, such as password hashes and salts from the user table, by filtering on these fields and observing the response.
The provided patch addresses this vulnerability at its source. First, it modifies the orm.metadata.Filterable function to correctly respect a filter:\"false\" tag on model fields. Second, it adds this tag to sensitive fields in several models, including user, oidc_user, robot, and registry, effectively preventing them from being used in filters. The orm.setFilters function, which consumes the Filterable logic, is where the user-provided query is processed, making it a critical function in the execution flow of an attack. Any runtime profile during exploitation would show calls to orm.setFilters and orm.metadata.Filterable when the malicious query is being processed.