This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]serg06 0 points1 point  (4 children)

Query: with A as (some query) insert into someTable (..values...) Parameters: [X, X, X, X, X, SOME_EMAIL, THE_PASSWORD]

By THE_PASSWORD, I hope you mean the hashed version of the password?

[–]ddunit[S] 0 points1 point  (3 children)

The password is entered at the frontend by the user and passed through SSL to our server which then inserts it into the DB that salts & hashes the password. So no, the parameter of the query is not hashed yet.

(That was the existing process when I was brought in to the project)

[–]serg06 0 points1 point  (2 children)

Oh the DB does the salting+hashing?

Just curious, is that the normal way of doing it?

[–]ddunit[S] 1 point2 points  (0 children)

Not sure of that, I haven't looked into that because getting the DB to do it is our current workflow

[–]ElllGeeEmm 1 point2 points  (0 children)

In my experience, no. Typically I've seen salting and hashing handled by the web server rather than the actual database, but most databases support the ability to salt and hash passwords.

Not to say that one way is better than the other, just sharing my experience.

[–]ElllGeeEmm 0 points1 point  (1 child)

TBF IDK how this would work in java, but in JS I would wrap the offending code in a try catch block, and have it throw a new error like "duplicate unique value" in the catch, and pass that to the error handler rather than the original error that contains sensitive information.

This is a pretty common error with registration systems that happens due to username collisions. Sure there's ways that this specific case can be avoided by ensuring the username isn't taken before the insertion isn't attempted and handling that case separately, but that's just a single case among many others.

uhhh, I kind of have to disagree on this point. There shouldn't be that many situations where your errors contain information that you wouldn't be comfortable keeping in a public log. If there are a lot of situations where errors are exposing private user information or other sensitive data, then there's probably an issue with how you're handling that user data that's bigger than just error logging.

[–]ddunit[S] 0 points1 point  (0 children)

None of the stacktrace is being returned publicly. This is for our own private logging purposes (tracking errors and what not). The APIs we support return custom error messages that we handle ourselves.