Own Specialization Theme
Martin Markov
Vulnerable Ruby on Rails Application created by OWASP for educational purposes of Rails Developers
How are the present vulnerabilities in the RailsGoat application exploitable and what should be done to enhance the security of the application?
Missing Function Level Access Control
CSRF (Cross-Site Request Forgery)
Unvalidated Redirects and Forwards
Setting the password of User with ID 1
The application stopped because of execution of commands in file name
Using the safe FileUtils.cp() instead of directly executing system commands with user input
Concrete error messages for the authentication flow are a bad practice
If the authentication is not successful display a generic error message
Instead of escaping the string, the html_safe method marks it as trusted and safe
Accessing sensitive information about another user because of trusting paramentrs sent to the server
On line 3 the user_id is fetched from the params object. There's no check if this is the current_user's id
Directly using the current_user instead of fetching the user with the id sent in the request parameters
Exposing all available routes on 404 error
By following the default running instructions in the Readme file the application is running in the development environment which exposes all available routes on 404 routes
Overriding the default ActiveRecord as_json to only serialize the attributes needed
Apply the administrative guard function before every admin action to be sure that the admin endpoints are accessed only by users with the admin role
What if the target user is logged in to the RailsGoat Application, opens a page with this HTML and clicks the button?
The application does not check for foregery requests
If we try the CSRF Attack again we'd get:
On successful login, the user will be redirected to the URL specified as a parameter (if there is one), no matter if it is in the same app or not