Re:Neighbor's house alarm triggers when I put my car in reverse
by infogulch on Monday December 18, 2017 @10:20AM
(#15952187)
I would take a different lesson: use internally generated ids, not user generated usernames when communicating between services in your backend.
Re:Neighbor's house alarm triggers when I put my car in reverse
by mabbo on Monday December 18, 2017 @10:35AM
(#15952279)
Well technically, the username the user had was generated by us when we signed them up. I honestly think this issue probably would have presented for 1/10 users whose IDs happened to have a leading 0-digit. Our software couldn't handle a situation we had setup for it.
But yes, I do agree with the general sentiment of "communicate via something internal, not something user-supplied".
Re:Neighbor's house alarm triggers when I put my car in reverse
by jmcgough on Monday December 18, 2017 @12:34PM
(#15953418)
I had a similar experience with a bug in a SaaS product that integrated with bank websites. They would send us the user ID and we would use that to determine whose account to log them into on redirect (and create a new account for the user if we hadn't seen the ID before).
At some point it became clear that they ignored leading zeroes during login on their end, but still included those leading zeroes when they sent it over to us, so we had a number of duplicate accounts. I purged the duplicate accounts (delete the newest, strip the leading 0s off the oldest) at the same time that they changed their code to send over the truncated number. All went perfectly, except apparently a few spouses were upset that they could no longer use their secondary account.
Report: "If my secretary logs with our account, it works. If I do, the website logs in but then later shows me errors message when I try to submit a report".[0] Entirely repeatable. Screenshots sent showing it exactly. All of us scratching our heads. How could our web server know who was sitting in front of the keyboard?
Root cause: the username was a number with a leading zero. The login didn't care if you used zeros or not, but the internal logic did care. She logged in with them, he logged in without them (or was it the other way around?). Once logged in, the username was taken from a cookie or something that had been set at login time and fed into the internal logic, which barfed.
Lessons learned: either don't have forgiving logins, or have forgiving functionality when users use inconsistent logins.
[0]They were indeed sharing an account with the same username and password. It was 2005 and government website, so this made sense.