today security offers some of the main problems on the internet, be it of mobile apps, IoT, or web apps.
it is a technique used by malicious users to inject sql commands using sql statements into a database
They compromise web applications greatly
@projects = Project.find(:all, :conditions => “name like #{params[:name]}”)
or
name = params[:name] @projects = Project.where(“name like ‘“ + name + “‘“);
are weak : name parameter is not escaped
a solution would be
@projects = Project.where("name like ?", "%#{params[:name]}%")
input should be authenticated against a set of defined rules for length, type and syntax
an attacker may send an email containing embedded malicious javascript the http request gets initiated on the victims browser once the user clicks on it where data is then sent to the vulnerable web app
malicious javascript is then executed in the context of the user's session
visualize a situation where a site accepts usernames that are displayed as profile names.
the web app does not sanitize the input and thus allows an attacker to enter scripts
once a user views the attackers profile page, the code automatically executes in the context of their sessions
vulnerability lies in the web app not the user's browser and not the site hosting the CSRF
requests are sent from a site which a user visits to a site where an attacker believes a user is validated against
the browser is used as the medium, channel or tool for carrying out the request
protect_from_forgery (in app controller)
command does the forgery protection