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 ...
101
votes
Accepted
REST API security Stored token vs JWT vs OAuth
Consider the first case. Each client gets a random ID that lasts for the duration of the session - which could be several days if you like. Then you store the information relevant to that session ...
100
votes
Accepted
What is a good security practice for storing a critical database on developer's laptops?
Not only do you not want a copy of the production database, it may actually be illegal. For example, in the US, you cannot move production data out of the production environment if it contains ...
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 ...
95
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. ...
91
votes
Accepted
Role vs Permission Based Access Control
(1) What is so "bad" about checking Roles for access control? What
benefits are gained by checking for permissions instead?
At the moment of checking, the calling code only needs to know "does user ...
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
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 ...
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 ...
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 ...
53
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 ...
45
votes
Why not just make non-parameterized queries return an error?
There are too many cases where using a literal is the right approach.
From a performance standpoint, there are times that you want literals in your queries. Imagine I have a bug tracker where once ...
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 ...
37
votes
Is there any reason not to go directly from client-side Javascript to a database?
It's probably not a great idea. And the first and strongest reason I can give is that a database server isn't designed to be a public web server. To the contrary, conventional wisdom says you should ...
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
Accepted
Should UDP data payloads include a CRC?
The UDP protocol does not guarantee that messages are delivered in order or delivered at all, but it does ensure that those messages which do get delivered are complete and unchanged by automatically ...
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 ...
28
votes
Role vs Permission Based Access Control
In response to your first question, the biggest issue with checking that a user has a role rather than a specific permission, is that permissions can be held by multiple roles. As an example to 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 ...
21
votes
How to safeguard a REST API for only trusted mobile applications
To anyone interested, on Android you CAN verify that the request you have gotten was sent from your app.
In short, when you upload your app to google you sign it, with a unique key that known only to ...
21
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 ...
19
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
security × 906authentication × 82
web-development × 56
passwords × 54
api × 49
encryption × 49
web-applications × 48
php × 47
rest × 47
architecture × 44
database × 42
javascript × 41
design × 33
authorization × 32
java × 30
c# × 25
web-services × 25
login × 22
api-design × 21
hashing × 21
microservices × 20
open-source × 19
programming-practices × 16
asp.net × 16
cryptography × 16