Your Common Sense
  • Member for 7 years, 11 months
  • Last seen this week
Password security in databases - today still best practice?
10 votes

You forgot just one little thing: Password strength. Just 2 words which overweight whole your brilliant topic. There are indeed hundreds of topics on Stackoverflow telling you to use this or ...

View answer
Can hacker delete my server files and database where I am using below function?
Accepted answer
6 votes

To be awfully honest, this function is just an arbitrary collection of more or less useless or harmful and sometimes even contradicting procedures, most of which has nothing to do with security at all....

View answer
How to deny access to my server end points ? (PHP)
3 votes

Your idea on the domains is rather wrong. You need to understand one essential thing about a web server. There is no such thing like "an access from a domain". It is not a "software" which is ...

View answer
Possibility of SQL injection by static or predefined values
Accepted answer
3 votes

Situation-1 It's a function. Which means it could be called with different parameters and you cannot foretell whether these will be predefined or not. Besides, I just don't understand why you're ...

View answer
How exploiting RCE in jpg file actually works?
3 votes

What you are missing is the actual execution of the uploaded file. A file would be harmless unless executed as a PHP script. And your web-server will treat a file according to its extension. So a ...

View answer
Is this scenario a file upload vulnerability?
Accepted answer
2 votes

First off, you don't have to tamper with the request. Some PHP code could be simply written in EXIF fields or any other metadata field. Or even just bluntly added to the actual binary code of the ...

View answer
After running a string through mysqli_real_escape_string, is it safe to remove the backslash before echoing it into a page?
2 votes

You should never use anything "to reduce the likelihood of SQL injections" in the first place. It just doesn't work this way. You are not adding some code just in case, sort of a rabbit foot. SQL ...

View answer
Locale detection & huge Accept-Language header, can this be considered an atack vulnerability?
Accepted answer
2 votes

Looks like your situation is quite unique, as, according to this answer, most web-servers won't let you to send 25000 fake languages, but only rather something around 2500. Given your code is not ...

View answer
What pages are vulnerable to SQL injection?
2 votes

This is a very popular question on Stack Overflow, and that made me develop a sort of "standard response" to it. 1. Why are you trying to bargain? First off, the question sounds like you are trying ...

View answer
Possible SQLi with self-made prepared statements and real_escape_string?
1 votes

if there is anything wrong to escape and process user input like that? To clarify, there is nothing wrong with escaping per se as long as it is used on purpose - to escape not the arbitrary "user ...

View answer
How to prevent unauthorized users from accessing an image on my server just by URL?
1 votes

An answer for the question title: just require a login and password and check the user's authorization before sending the image. An answer for the question body/comments: as mentioned by ChatterOne ...

View answer
Php parameters (username, password) in link
1 votes

There is no direct threat from sending the credentials in the query string. Technically, for the server it doesn't matter whether the form data is sent in the request body or in the query string. So ...

View answer
Using single or double quotes to prevent XSS and SQLi?
1 votes

Without quotes, the payload would escape the actual attribute's value and will start a new attribute with its own payload: <div class=fist onclick=console.log(document.cookie)> Whereas with ...

View answer
Check for vulnerabilities on website having an error with realpath PHP
Accepted answer
1 votes

The error message is quite clear: File(/srv) is not within the allowed path. So - no, you cannot access the /etc/passwd/ directory. The answer you mentioned explicitly states No white/black lists, ...

View answer
Could hashing prevent SQL injection?
1 votes

Like many other learners, you are confusing the storage and the transport. And in order to protect the latter, you are deliberately spoiling the former. You have to understand that SQL injection is ...

View answer
Is there a way to check the filetype of a file uploaded using PHP?
0 votes

There is no conception of file type. Because every file could be of a dozen different formats at once. Well, at least two is always plausible. Say, a csv file could be a PHP file as well 462331,"...

View answer
Store database access password in PHP class const?
Accepted answer
0 votes

For me, the form in which credentials are stored is not that important as the way they are called. Having them listed right in the function/method parameters will make them appear in the regular PHP'...

View answer
What is the benefit of combining a form with php processing script in a single page using isset
Accepted answer
0 votes

There are no benefits or drawbacks security-wise. Technically it's always two calls to the server, one to load the form and one to process it, no matter how many files you have. So it's just the way ...

View answer
Using SQL to compare hashed passwords
0 votes

Honestly I don't see any difference from the common solution. You didn't disclose its drawbacks (and yes, password_hash and password_verify are the common solution), neither provided any benefit for ...

View answer
bWAPP- SQL injection Hack displays a white screen?
Accepted answer
0 votes

This application is extremely outdated, not only about its contents but also about the way it is distributed. It is using a PHP extension that is now extinct, which will cause a fatal error in any ...

View answer
Directory transversal in PHP with the $_FILES array?
0 votes

According to my experience, $_FILES["uerrfile"]["name"] already consists of only a filename part, with the path stripped out. However, the PHP manual suggests to use the basename() function anyway, ...

View answer