Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
rails-cve-2017-17917 — Educational demonstration of CVE-2017-17917 SQL injection in Rails, with step-by-step replication and secure coding mitigation using parameterized queries. | Kitploit
Tools/GitHubGitHub/matiasarenhard/rails-cve-2017-17917
Vulnerability AnalysisCode AnalysisWeb Application ExploitationLearning & EducationDatabase SecurityLabs & Practice
GitHubmatiasarenhard/rails-cve-2017-17917

rails-cve-2017-17917

Educational demonstration of CVE-2017-17917 SQL injection in Rails, with step-by-step replication and secure coding mitigation using parameterized queries.

View Repository
162 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

rails-cve-2017-17917

The project demonstrates the replication of a SQL injection vulnerability in the id parameter, and subsequently provides insights into mitigating and resolving this security issue. https://www.cvedetails.com/cve/CVE-2017-17917/?q=CVE-2017-17917

Stack:

root@kitploit:~
  Ruby: 3.2.2
  Rails: 7.0.8
  Docker 24.0.5
  Docker-Compose 1.29.2
  PostgreSQL

CVE-2017-17917

image

We selected this CVE to highlight the persisting occurrence of this issue in the latest versions of Rails, reaffirming its relevance of the development best practices.

Schema from the environment to replicate the vulnerability

Diagrama sem nome drawio(1)

Instructions to replicate this vulnerability.

Requirements:

root@kitploit:~
  docker
  docker-compose

Steps to build a project:

root@kitploit:~
  sudo docker-compose build

image

root@kitploit:~
  sudo docker-compose run web bundle install

image

root@kitploit:~
  sudo docker-compose run web rails db:create db:migrate db:seed

image

root@kitploit:~
  sudo docker-compose up

image

Go to http://localhost:3000/

image

image

SQL Injection param 1 OR id > 1

image

Assessing the risks of the vulnerability in a production environment.

With this SQL injection, an attacker can retrieve user data they wouldn't normally have access to view.
degree difficulty to execution: easy

Conclusion

The issue lies in the controller method, specifically when invoking a where clause as follows:
@clients = Client.where("id = #{params[:id_search]}")
Link to Code

The problem is resolved by using the following approach:
@clients = Client.where(id: "#{params[:id_search]}")
Link to Code

Tests

root@kitploit:~
  sudo docker-compose run web rspec

image

Download Tool