Out of Band SQL Injection
Invicti identified an Out of Band SQL Injection by capturing a DNS A request, which occurs when data input by a user is interpreted as an SQL command rather than as normal data by the backend database.
This is an extremely common vulnerability and its successful exploitation can have critical implications.
Invicti confirmed the vulnerability by executing a test SQL query on the backend database that resolves a specific DNS address that {SSRFRESPONDER} can capture, originating from the database server.
- Reading, updating and deleting arbitrary data or tables from the database
- Executing commands on the underlying operating system
- See the remedy for solution.
- If you are not using a database access layer (DAL), consider using one. This will help you centralize the issue. You can also use ORM (object relational mapping). Most of the ORM systems use only parameterized queries and this can solve the whole SQL injection problem.
- If you are generating SQL statements based on information in database tables that are filled with information from users, review the SQL generating parts.
- Locate all of the dynamically generated SQL queries and convert them to parameterized queries. (If you decide to use a DAL/ORM, change all legacy code to use these new libraries.)
- Use your weblogs and application logs to see if there were any previous but undetected attacks to this resource.