Live data from Hacker News

Klarna users are being signed in to random accounts

twitter.com

181–190 of 517 posts

Re: Klarna users are being signed in to random accounts

#181
I'm just guessing, but...

"developer gets a great idea - let's push an update to the API as a GET request so we can cache this on the CDN... forgetting that the JWT token is potentially returned in the call. Now, whoever makes the call first gets their JWT token stored for everyone else to load instead when the API call is made."

Ta-da, Klarna.

Re: Klarna users are being signed in to random accounts

#183

I m sure it s not random but somehow systematic

If it's really a reverse proxy / Varnish / CDN / etc. misconfiguration issue like some others here suspect, then it could be totally random. The data of some unlucky person whos data happens to get requested when the cache times out will be cached and then sent to all others.

Re: Klarna users are being signed in to random accounts

#184

Does Klarna still do the IQ test as part of their hiring process?

tangential thought, but related: I am, in general, a proponent of nuclear energy as a green alternative to whatever the hell we are doing today. But when I see such stories that humans manage to fuck up simple payment processing apps, still make errors while maintaining bridges, still manage to do hugely negligent screw-ups (most likely corrupt) in *cable cars maintenance*, I immediately think that it is imminent, th…

The Italian cable car was really messed up. The emergency brakes of that cart were intermittently triggering, so the operator jammed a piece of metal to stop that from happening.

His assumption is surely, "Relax, what's going to happen, the cable won't break!".

Re: Klarna users are being signed in to random accounts

#185
What are the ways you can implement "log in as anyone accidentally"?

I'm imagining it was a case of an SQL-based password check where "TRUE OR" got added to the WHERE clause, and the code takes the first result instead of expecting only 0 or 1 row.

Are there other easy ways to do this?

Re: Klarna users are being signed in to random accounts

#186

Junior dev was facing a dilemma. Before pushing to production please finish this code and choose the id you want to use: "select * from users where id = ?" > user_id > profile_id > user_profile_id > profile_user_id > id > rand()

I don't think it's nice to make fun of beginners in our industry.

I _think_ it's intended to be a joke about the IQ test they supposedly administer to applicants.

Re: Klarna users are being signed in to random accounts

#188
post #185

What are the ways you can implement "log in as anyone accidentally"? I'm imagining it was a case of an SQL-based password check where "TRUE OR" got added to the WHERE clause, and the code takes the first result instead of expecting only 0 or 1 row. Are there other easy ways to do this?

From a quick glimpse on twitter, people couldn't make changes to any of the accounts they were seeing.

This points in the direction of this being a caching bug; you request your homepage, and get the homepage of whichever user was placed in the cache last.

Most of the time in these situations it's not an application-code issue (per-se), as much as a "shared global state" issue.

Re: Klarna users are being signed in to random accounts

#189
post #169

Earlier quoted context omitted.

I once got a credit card statement that told me I would be able to pay off my credit card in 100,000 years. It was discouraging.

Once a colleague made an accounting error and it showed that we're in debt something like 100 million.... I told him to stay calm and relax, we don't have that kind of money so why worry :)

"If you owe the bank $100 that's your problem. If you owe the bank $100 million, that's the bank's problem"

Re: Klarna users are being signed in to random accounts

#190

Interesting that all the screenshots have a (typically) female name, and the reporter seems female. Could be chance of course, but a quite low likelihood if the sampling is truly random... Can’t help thinking what kind of bug could cause that. :)

> quite low likelihood if the sampling is truly random...

If you're assuming their user base is 50/50 male/female, which for many apps is not a valid assumption.

If I remember how to do math correctly, 50/50 gives 5 random users all being female ~4%. And 80/20 split is closer to 40%.

Post reply on HN