Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do hard-to-guess SQL database table and column names help prevent SQL injection? [closed]

Tags:

I just met a developer who prepended every table and column name in his MYSQL databases with an underscore (e.g. _users, _name, _active). When I questioned the practice he stated that this helps prevent SQL injection attacks - I have never come across this practice/advice before. How does it help to prevent SQL injection attacks?

like image 687
foiseworth Avatar asked Nov 19 '12 16:11

foiseworth


People also ask

What helps preventing SQL injection?

The only sure way to prevent SQL Injection attacks is input validation and parametrized queries including prepared statements. The application code should never use the input directly. The developer must sanitize all input, not only web form inputs such as login forms.

Which of the following statement is true about SQL injection?

1. Which of the following statement is TRUE about SQL Injection? Explanation: SQL Injection is a Code Penetration Technique and loss to our database could be caused due to SQL Injection.

What are the methods used to detect SQL injection vulnerabilities?

The most common methods for detecting SQL injection attacks are web framework, static and dynamic analysis, and machine learning technique.


2 Answers

_this, _ here has no relation to security ,with that it can be vulnerable

Good read

Best way to prevent SQL injection?

like image 40
NullPoiиteя Avatar answered Sep 21 '22 10:09

NullPoiиteя


No.

His thinking goes "If the attacker doesn't know the name of my tables, then the attacker can't mess with them." However, you're still vulnerable to SQL injection, and the attacker can still cause arbitrary system calls, perhaps to well-known system tables. What if he adds some SQL code that causes very long queries against a system table that bogs down your server?

Security through obscurity is no security at all.

like image 55
Andy Lester Avatar answered Sep 20 '22 10:09

Andy Lester