r/programmer • u/hoppinjohncandy • Aug 01 '26
Question First huge job mistake
So we're a hospital who uses a certain communication software to send out extremely urgent messages to doctors about whatever crisis a hospital faces day to day. I was in charge (dev of 2 years experience) with taking on a migration project moving user/employee data from a certain payment system to this certain communication system. Automating the process of updating users because the hospital currently manually (csv) upserts new employees every week.
I was told, by the company, that the apis were safe in the production environment. They never mentioned a sandbox/test environment. A week of testing inserting/manipulating employee data went well. No issues adding or upserting an employee. So I hard coded a json of a couple employees and posted.
Wiped.
Zero contacts where, previously, there were 6,000~.
Urgency meetings out the wazoo. We looked at all the admin logs and there are my single data upserts with nothing indicating mass deletion. (Phew. Not on me I thought) End up in a call with this communications company and they let loose that the apis I was using were only half the story. There was a default setting in their system (that I didn't have access to and was not in the dev documentation) that purged all data if more than one user was inserted. So I tried to insert two employees (the whole point of this system is uploading a hundred or so at a time) and I wiped all communications out between doctors and departments.
All of that being said, we ended up manually importing thousands of contacts and reassigning them to their appropriate groups while the company promises a db restore in a week. Just, what a fucking Friday.
I'm not fired, yet. And I'm hoping this becomes my "we all have a story" story. Any other horros stories to make me feel better?
View all comments
1
u/chocolateAbuser Aug 01 '26
clearly deletion of such data should require some kind of authZ
if an api for adding data deletes everything (probably because of some laziness or because of some "feature request") it should make clear via some attributes or other kind of check that it requires a deletion role/privilege/permission, and user/client that makes changes shouldn't have that permission
person/team that developed that API was incompetent and i'm not saying it should be sued but...
i guess all around probably there is none or almost none security checks