Posts

Showing posts with the label ruby secure code

Ruby best secure code approaches

Hi, This is  Shubham Mishra  from India,  this is the part of  Ruby on Rails  exploration journey.  In this post we will discuss about the ruby's some special concepts and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... It's crucial for software engineers to build secure code in addition to functional code. In order to ensure the security of our apps, we will discuss several security best practises in this blog. 1. Avoid SQL Injection One of the most common security vulnerabilities in web applications is SQL injection. To avoid SQL injection in Ruby, use the built-in parameter binding mechanism provided by your database driver. This ensures that user input is properly escaped and prevents malicious SQL statements from being executed. In above snippet rather than block A, use block B approach, This way, the name parameter is properly escaped and cannot be used to inject malicious SQL code. 2...