- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Edit Admin
For those not familiar with .net, yes, there are free secret stores available for decades now. And a ton of commercial products for big enterprises. There's no need for hack like this.
Admin
Idiots. Hard-coding secrets. They should have done it like real programmers.
Admin
But how does one get stuff out of said free secret store? (Presumably using a hardcoded secret store secret)
Edit Admin
It would still be offensive if the application read the token from a file - encoded or otherwise - but only slightly less so.
Edit Admin
You'd rather it said return (token == a || token == b) ?
Admin
They could have hard-coded date ranges over which those tokens are valid if they wanted the old token to work for a little while longer, since they're in the hard-coding mood. I get it, that only fixes one of the horrible WTFs, but I'm all about fixing one thing at a time.
Admin
Most likely they want "return token.equals("xxxxxxxxxxxxxx")"
Admin
I don't mind the early-return pattern in small, select cases, but it bothers me that they used an
else
. If the first one matches, it will return, so successive lines are inherently anelse
clause. Of course, there's the other part - which annoys Remy more - if (cond) return true` or conditionals/ternaties? Of course, now the analyzers would recommend using a switch expression instead.Edit Admin
My CI pipeline gets secrets from the secret store by authenticating using it's Windows Active Directory account. We even limit that access to a list of IPs to add another layer of protection.
For token authentication, we just use an RsaSecurityKey and the service is only configured with the public key. The private key lives only on the authentication infrastructure.
Edit Admin
Edit Admin
Bah. I give up on this Markdown nonsense / lack of preview / lack of ability to edit. Thought I had enough new lines in there.
Admin
That is not a token, that is a string. A string that is being used as a password.
A token should have a sender authentication mechanism.
Now, being a password - why is it not being hashed? That would at least help a little.