MySQL is an open-source relational database management system.
Questions tagged [mysql]
507 questions
142
votes
24 answers
Why can't I just let customers connect directly to my database?
I'm pretty sure this is a stupid idea but I'd like to know why, so bear with me for a moment.
Lots of the work backend developers do is providing CRUD access to customers via HTTP, essentially mapping data from and to the internal database.…
Moritz Friedrich
- 1,455
- 2
- 10
- 10
59
votes
6 answers
Should I obscure database primary keys (IDs) in application front end?
I'm working on an application which allows a moderator to edit information of user.
So, at the moment, I have URL's like
http://www.example.com/user/1/edit
http://www.example.com/user/2/edit
I'm a bit worried here, as I'm directly exposing the…
Pruthvi Raj Nadimpalli
- 693
- 1
- 5
- 5
47
votes
5 answers
Password security in databases - today still best practice?
Possible Duplicate:
Which password hashing method should I use?
There are a ton of great posts about password security in databases on stack overflow and on other sites and as I am completely new to this I spent quite some hours trying to learn…
Chris
- 481
- 5
- 6
45
votes
1 answer
I have the ability to run arbitrary Python code on the 'apache' user. What damage can I do?
So, due to bad programming on the part of one of my former colleagues, one of our internal web apps allows the user to upload and run an arbitrary Python file. This recently came to light via an anonymous tip. So far I haven't done anything too…
ian93
- 481
- 1
- 5
- 6
40
votes
6 answers
Is SQL injection possible with LIMIT?
A friend of mine built a web application that I'm testing for fun. I noticed that he allows a user to set the limit of a certain query, and that limit is not sanitized.
For example, I can choose any number or string I like as a limit. I realize…
Ali
- 519
- 1
- 4
- 8
39
votes
4 answers
Convince the company not to store credit card numbers in our webapp
The company I work for needs a system to perform monthly credit card charges to customer accounts. Customers will be able to update their credit card information from an online interface written in PHP (which will be presented through HTTP over…
M8R-53mg86
- 393
- 3
- 5
34
votes
11 answers
How to limit the impact of and reduce the risk of SQL injection for existing website?
Our website is 100% API based (with an SPA client). Recently, a hacker managed to get our admin's password (hashed with SHA-256) through SQL injection (and cracking pwd) like this:
https://example.com/api/products?userId=3645&type=sqlinject here
It…
Phung D. An
- 1,051
- 1
- 11
- 13
28
votes
1 answer
Why should we sometimes use --+ instead of -- in SQL injection to comment the rest of the query?
I have encountered some websites that when I used -- to comment the rest of the query it didn't work, but when I tried --+ it worked.
In the MySQL official documentation there is no such thing as --+ and we only have -- and two other ways.
Why does…
Richard Jones
- 497
- 1
- 6
- 9
28
votes
2 answers
MySQL Server Hardening
Following the hardening theme....
What are some best practices, recommendations, required reading for securing MySQL.
Scott Pack
- 15,167
- 5
- 61
- 91
27
votes
12 answers
Why are stored procedures and prepared statements the preferred modern methods for preventing SQL Injection over mysql real escape string() function
Why are stored procedures and prepared statements the preferred modern methods for preventing SQL Injection over mysql_real_escape_string() function?
Damien Pham
- 287
- 3
- 3
26
votes
2 answers
Second order SQL injection protection
Normal SQL injections are no problem since I always use prepared statements, but how to protect oneself from second order SQL injections?
J. Smith
- 385
- 1
- 3
- 6
25
votes
1 answer
Understanding SQL injection payload
My server was hit by the following SQL injection…
Aayush
- 557
- 6
- 17
24
votes
4 answers
Is "Why Should You Avoid AES In MySQL?" true?
From a 2012 Smashing Magazine article quite a bold statement is made to avoid AES in MySQL itself. Or as they put it "Why Should You Avoid AES In MySQL?". However, if you search for SQL encryption, you often find the AES_ENCRYPT from (My)SQL…
Jurian Sluiman
- 873
- 2
- 7
- 9
22
votes
3 answers
MySQL OLD_PASSWORD cryptanalysis?
The password hash used for MySQL passwords prior to version 4.1 (now called OLD_PASSWORD()) seems like a very simple ad-hoc hash, without salts or iteration counts. See e.g an implementation in Python at
Django snippets: Old MySQL Password Hash
Has…
nealmcb
- 20,544
- 6
- 69
- 116
22
votes
3 answers
Sanitizing input for parameterized queries
If I use fully parameterized queries everywhere, is it still necessary and/or security-relevant to somehow sanitize input? E.g. check that mail addresses are valid before sending a parameterized query against the database, or filtering out certain…
Alexander
- 2,143
- 2
- 16
- 22