GitHub
GitHub logoGitHub · Feature trail

SQL LIKE Clause Injection Prevention

1 post · Nov 2015

What this trail covers

This feature thread tracks the evolution of preventing SQL LIKE clause injection vulnerabilities. Initially, the focus was on identifying and mitigating the performance impact of unsanitized user-provided LIKE clauses. This post details the development of custom Ruby helpers (`like_sanitize`, `with_prefix`, `with_suffix`, `with_substring`) to escape LIKE metacharacters (`%`, `_`) and prevent pathological queries that could lead to Denial of Service (DoS) vectors. It also notes the existence of Rails 4.2's `sanitize_sql_like` helper.

All GitHub trails