208
votes
Accepted
Are private, unguessable URLs equivalent to password-based authentication?
A private URL is somewhat weaker than authentication with credentials, even if the bit size of the URL is the same as that of the credentials. The reason is the URL may more easily "leak". It is ...
148
votes
Accepted
Why did SQL injection prevention mechanism evolve into the direction of using parameterized queries?
The problem is that #1 requires you effectively parse and interpret the entirety of the SQL variant you're working against so you know if it is doing something it shouldn't. And keep that code up to ...
98
votes
Accepted
Is it a security vulnerability to declare class members as public?
Access modifiers like public/private/protected are not intended as a security boundary. And since C++ is not a memory-safe language, this cannot be a security boundary.
The laziest “attack” to access ...
96
votes
What is the purpose of identifier-first login screens?
This is common with federated identity systems where a service authenticates users from many identity providers.
Your email address is used to look up which identity provider can authenticate you. ...
79
votes
Why did SQL injection prevention mechanism evolve into the direction of using parameterized queries?
Because option 1 is not a solution. Screening and filtering means rejecting or removing invalid input. But any input might be valid. For example apostrophe is a valid character in the name "O'Malley". ...
60
votes
Why did SQL injection prevention mechanism evolve into the direction of using parameterized queries?
If you're trying to do string processing, then you're not really generating an SQL query. You're generating a string that can produce an SQL query. There's a level of indirection that opens up a lot ...
59
votes
Accepted
SQL sanitizing in code with no user input
If there is never any user input at all, or the program is only used internally, the importance of sanitizing should be reduced.
But there are still a few possible reasons to always do so
If all ...
58
votes
Is this scenario an exception to the rule of never storing passwords in plaintext?
This is a really good example of insecure authentication, justified on the basis that if the site is compromised it is not possible to identify the person. If that's the case, why do we even need a ...
54
votes
Is Reflection a disadvantage as private variables cannot be restricted?
The purpose of access modifiers is to inform developers writing code about what is the public interface of a class. They are not in any way a security measure and they do not literally hide or secure ...
54
votes
What is the purpose of identifier-first login screens?
The purpose of this is to redirect to the account's identity provider. However the use case is not selecting between personal login providers such as Facebook or Google. It's to support organisational ...
48
votes
Are private, unguessable URLs equivalent to password-based authentication?
Note:
A lot of people seem to be confusing a "private" URL with authentication. Also, there seems to be some confusion that sending the link via a trusted entity is an attempt at two-factor ...
46
votes
Is Password Hashing Bad?
This is a reasonable point being justified using incorrect claims.
The issue here isn't about having users enter passwords. How do you think they're going to log in to Google/Facebook/any other third ...
41
votes
SQL sanitizing in code with no user input
Parameterised queries should be your standard approach to all SQL. If you are trying to find reasons why you don't have to use them, then you are doing yourself a disservice.
In your example you have ...
35
votes
SQL sanitizing in code with no user input
By using parameterized queries your SQL server doesn't have to recalculate the query execution plan each time you use a query.
This can improve performance for queries ran often.
31
votes
Is Reflection a disadvantage as private variables cannot be restricted?
To quote Herb Sutter on class access rights:
"The issue here is of protecting against Murphy vs. protecting against Machiavelli... that is, protecting against accidental misuse (which the language ...
30
votes
Is this scenario an exception to the rule of never storing passwords in plaintext?
"Never store passwords in plain text" is not a rule. It is a best practice based on common security breaches on naive implementations of password protections.
In that sense, the question:
Is this ...
25
votes
Authentication and authorisation for people with intellectual disabilities
Users don't care.
Mental disorder or not users simply don't care as much as you do about security. You could set up two factor, OTP, even physical keys and users will still wander off to the bathroom ...
24
votes
Which hashing algorithm is best for uniqueness and speed?
I know there are things like SHA-256 and such, but these algorithms are designed to be secure, which usually means they are slower than algorithms that are less unique.
The assumption that ...
22
votes
Accepted
Authorization and authentication system for microservices and consumers
Authentication and authorization are always good topics
I will try to explain to you how we deal with authorizations in the current multi-tenant service that I am working. The authentication and ...
21
votes
Why did SQL injection prevention mechanism evolve into the direction of using parameterized queries?
It helps that option #2 is generally considered a best practice because the database can cache the unparameterized version of the query. Parameterized queries predates the issue of SQL injection by ...
20
votes
Why did SQL injection prevention mechanism evolve into the direction of using parameterized queries?
Simply said: They did not. Your statement:
Why did SQL Injection prevention mechanism evolve into the direction
of using Parameterized Queries?
is fundamentally flawed. Parameterized queries ...
20
votes
Accepted
Difference between 'aud' and 'iss' in jwt
These are intended for scenarios where you have a token issuing authority that is not the same as the application that is the intended recipient.
This may not be different for your application.
But ...
18
votes
Is Password Hashing Bad?
The specific claim: "Password hashing is bad" is somewhat odd. If you are supporting passwords, hashing is pretty important. The more interesting and more contentious (based on the other ...
17
votes
Accepted
Should we store JWTs in database?
The positives/pro I can see of storing the JWT token in our database would be that even after assigning the token we will have the power to invalidate or deactivate the existing the tokens even before ...
17
votes
Authentication and authorisation for people with intellectual disabilities
Two obvious things.
One, there's an inadequate specification of who the security measures need to resist, and/or who stands to gain from unauthorised access. No system is wholly resistant to ...
16
votes
Accepted
Log off system on all devices
Note: I'm not claiming this is how Facebook or Twitter does it, I'm merely providing a general-purpose way of accomplishing 'Logout on all devices'-functionality.
Generally speaking, authentication ...
15
votes
If passwords are stored hashed, how would a computer know that your password is similar to the last one if you try resetting your password?
One way to implement this is if you reset password, you are usually asked to enter your old password as well. You can simply just use regular string similarity comparison in that situation because you ...
14
votes
Why is it more unsafe to store your password in the URL of a git repo?
It's unsafe because it exposes your password a number of different ways.
Any user can see it in the output of programs like top and ps aux -www. They don't need to be root to see your processes.
It ...
14
votes
Is it a security vulnerability to declare class members as public?
Using public and private correctly (and following good practices in general) helps you write better code with fewer bugs, and code with fewer bugs is typically harder for an attacker to exploit. ...
14
votes
Accepted
Is masking an entered password security through obscurity?
Rather than the hand-waving "security via obscurity", I think you're best taking Kerckhoff's principle:
a cryptosystem should be secure, even if everything about the system, except the key, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
security × 921authentication × 85
web-development × 57
passwords × 55
api × 50
encryption × 50
web-applications × 48
php × 47
rest × 47
architecture × 45
database × 43
javascript × 41
design × 33
authorization × 32
java × 31
c# × 25
web-services × 25
login × 22
api-design × 21
hashing × 21
microservices × 20
open-source × 19
programming-practices × 17
asp.net × 16
cryptography × 16