2022 Developer Survey is open! Take survey.
114 votes
Accepted

Does read-only access to the database prevent sql injection?

No. You might be confusing SQL injection with data injection; read-only tables do not prevent SQL injection and at best do only a little to limit its impact. SQL injection simply means the ability ...
user avatar
  • 71.4k
25 votes
Accepted

Sanitizing input for parameterized queries

No, it's not necessary. But please, read on. Input sanitization is a horrible term that pretends you can wave a magic wand at data and make it "safe data". The problem is that the definition of "safe"...
user avatar
  • 898
17 votes
Accepted

Determine SSL/TLS version using Wireshark

(Adding a new answer which should be definitive, leaving the old around as it's useful debug for how we got here. Credit for pointing to the actual answer in comments goes to @P4cK3tHuNt3R and @...
user avatar
  • 71.4k
14 votes

Does read-only access to the database prevent sql injection?

No, trivial example EXEC ('SELECT COUNT(*) FROM table WHERE UserName =''''' + @UserName + ''''' AND Password = '''''+@Password+'''''') Set @Password to a' OR 1=1;-- And your ...
user avatar
  • 733
14 votes

Does read-only access to the database prevent sql injection?

Does a least-privilege (select ability on one table only), read-only connection to the database prevent all injection attacks? SQL injection is a way for an attacker to modify an existing statement ...
user avatar
12 votes
Accepted

Is sending plaintext passwords to a SQL Server database a security risk?

SQL Server has the option to encrypt the connection between application and database. When you operate SQL server in an untrusted environment, it is recommended that you enable it. When you do, ...
user avatar
  • 48.8k
12 votes

Security risks of using SQL Server without a firewall

There are many vulnerabilities associated with database management systems. Basic security issues include: Deployment security issues. Application level (DBMS) security issues. Abuse of database ...
user avatar
  • 658
9 votes
Accepted

AD User vs SQL User for SQL Server Authentication

Ideally, the user or application accessing SQL Server should be using the set of credentials that identifies them correctly, and that has been assigned the appropriate level of access to the SQL ...
user avatar
  • 35.4k
9 votes

Is sending plaintext passwords to a SQL Server database a security risk?

Trust no one. Use secure strings to hold plain text passwords and hash them immediately. Gone are the times when you can hope your system is secure. It is not. It's just matter of time/money until a ...
user avatar
  • 1,046
9 votes

Sanitizing input for parameterized queries

If I use fully parameterized queries everywhere, is it still necessary and/or security-relevant to somehow sanitize input? Yes. It's always a good idea to sanitize the input before sending it to the ...
user avatar
  • 4,448
9 votes

Generating a PIN from cryptographic bytes

First of all, I totally agree with MechMK1 on the proper algorithm to generate cryptographically secure uniformly distributed random number between 0 and 10000. However: there's no reason not to ...
user avatar
8 votes
Accepted

Safest SQL database

TL;TR: these are not problems of the database. Maybe you are using a wrong architecture for your hidden service. And regarding the additional information after the edit of the question see at the end ...
user avatar
8 votes

Determine SSL/TLS version using Wireshark

I just use this filter in Wireshark to find TLS 1.0 traffic: ssl.handshake.version==0x0301 0x0302 is TLS 1.1 and 0x0303 is TLS 1.2.
user avatar
7 votes
Accepted

Does using ASP.NET prevent XSS

SQL Server does not prevent XSS. XSS would still be possible via issues in the web application code. Proper use of prepared statements with SQL Server can prevent SQLi, but to prevent XSS, you must ...
user avatar
7 votes

This is a working SQL-injection. What could the server side query string look like?

In MySQL, the # symbol can be used as a comment marker. Quote marks in comments don't have to balance. Not all SQL instances run on Microsoft databases.
user avatar
  • 33.6k
6 votes
Accepted

SQL Injection via Unicode

There are cases of SQL Injections leveraging the implicit conversion of Unicode homoglyphs from Unicode character string types (NCHAR, NVARCHAR) to character string types (CHAR, VARCHAR). A character ...
user avatar
  • 2,003
6 votes

Determine SSL/TLS version using Wireshark

(Ignore this answer, which I'm leaving for historical data, and read my other answer, which explains what's actually going on) Update after an example packet was added to the question - The packet ...
user avatar
  • 71.4k
6 votes
Accepted

Why Microsoft claims that SQL Server is the least vulnerable database?

When they say that, they are probably referring to the number of published exploits and vulnerabilities for their product. If true, this is a very, very bad idea. I'm actually surprised it says that. ...
user avatar
  • 3,384
6 votes
Accepted

Security risks of using SQL Server without a firewall

First hoping that IP address control can add strong security is kind of a brave assumption. IP theft should always be considered as a possible attack. Next, if there is no firewall at all in front of ...
user avatar
6 votes
Accepted

Why does this SQL injection have an equals symbol?

In SQL operator "AND" has higher precedence than "OR". Let add parentheses, to make the logic more clear: SELECT * FROM Users WHERE (Name ="") or (""="&...
user avatar
  • 7,926
5 votes

What's the best way to test for SQL Injection vulnerabilities? Manual or SQLMap?

Using SQLMap will be helpuf, since it scan for most well-known vulnerabilities and will save you some time and efford. But, the greatest threat is a hackers' imagination and ability to exploit ...
user avatar
5 votes

Is internal or external hosting more secure?

In a generic sense neither internal nor external hosting are inherently more or less secure on their own. Ultimately it's just a different set of trade-offs. In both situations the amount of security ...
user avatar
  • 14.1k
4 votes
Accepted

Wireshark displays sql calls - Prevention

This is a configuration issue with the database. Most modern databases offer transport encryption, though many are not enabled by default. Here are some links for setting up SSL on popular SQL ...
user avatar
  • 5,454
4 votes

AD User vs SQL User for SQL Server Authentication

Using Active Directory for SQL Server has a number of advantages, which makes it the recommended approach. SQL DBAs will often want to have the database in Windows Integrated Authentication (WIA) mode ...
user avatar
4 votes

How does the client pick the correct certificate from its certificate store?

The sever sends its certificate during the TLS handshake and the client verifies its trust path. In the first step the client matches the common name (CN) field with the server's hostname (it does ...
user avatar
  • 9,131
4 votes

Compromised server name and port number of a SQL Server DB Server

Sounds to me, that what was leaked is only information obtainable by a simple nmap scan. If the security of your system depended on that staying private, you might have an issue in you approach ...
user avatar
  • 281
4 votes
Accepted

Can be SQL Queries sniffed through the client network adapter?

Unless the established connection between your software and the SQL server is encrypted by your software, then most likely the traffic can be intercepted and viewed using a network traffic analyzer ...
user avatar
  • 769
4 votes

What can I do with blind SQLi if the database is encrypted?

You already cracked half their defenses. Now all that's left is a compromise of the AES key. That should be a reason to worry. Especially because changing that key won't be trivial, because they would ...
user avatar
  • 48.8k

Only top scored, non community-wiki answers of a minimum length are eligible