To address SOQL injection concerns in flexible lookup components and application-accessible code with dynamic WHERE clauses:
1. **Use Bind Variables**: Safely include user-supplied input in the query by using bind variables to ensure input is treated as data, not executable code.
2. **Sanitize Input**: If bind variables can't be used, sanitize the input with methods like `String.escapeSingleQuotes()` to prevent breaking out of its quoted context.
3. **Validate Input**: Check the input against a whitelist of acceptable values. For example, use `Schema.getGlobalDescribe()` to ensure object or field names are valid and accessible.
4. **Limit User Input**: Avoid allowing users to supply portions of the SOQL query beyond object names, field names, and WHERE clause inputs.
5. **Avoid User-Generated Queries**: Avoid executing user-generated queries in Apex, as they run in system mode. If dynamic queries are necessary, ensure proper input validation and sanitation.
6. **Use APIs for Complex Scenarios**: For more complex cases, consider using the REST or SOAP API to safely execute SOQL calls.
7. **Validate Permissions**: Always validate user permissions for objects and fields before executing queries.
These steps help ensure your queries are secure and protected from injection attacks while maintaining the flexibility needed for dynamic components.