Home / Companies / GitHub / Blog / Post Details
Content Deep Dive

LIKE injection

Blog post from GitHub

Post Details
Company
Date Published
Author
Ben Toews
Word Count
732
Company Posts That Month
6
Language
English
Hacker News Points
-
Post removed?
No
Summary

The text discusses an issue encountered with a slow SQL query in a Ruby on Rails application, highlighting a potential performance problem related to unsanitized user input in LIKE clauses. The concern arose when a query with a user-provided term containing multiple percent signs led to slow query performance, prompting an investigation into the impact of wildcard placements on database indexing. To address the lack of built-in Rails helpers for escaping LIKE metacharacters, custom methods were developed to sanitize user inputs in SQL LIKE queries, thereby reducing the risk of Denial of Service (DoS) vulnerabilities. Although the risk was relatively low, the potential for application-level DoS was identified as a significant concern, emphasizing the need for mitigation strategies. The text concludes by noting that Rails 4.2 introduced a sanitize_sql_like helper to aid in resolving such issues.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.