The vulnerability allows bypassing protected field restrictions using dot-notation in query WHERE clauses and sort parameters. The provided commit 1787db3 directly addresses this. The changes are located in the _UnsafeRestQuery.prototype.denyProtectedFields function within src/RestQuery.js. The patch modifies this function to correctly parse and check fields with dot-notation and adds a new check for sort parameters. Previously, the function only checked for top-level fields in the where clause, which was insufficient. Therefore, _UnsafeRestQuery.denyProtectedFields is the function that contained the flawed logic and is the vulnerable function that would be on the stack during exploitation.