Got pulled into a legacy cron job that sends SMS… with hardcoded vendor credentials

Posted by Fabulous_Bluebird931@reddit | ExperiencedDevs | View on Reddit | 72 comments

Someone noticed that SMS alerts weren't going out for account issues, so I got asked to check the old cron job handling them. I found a PHP script from 2016 with no version control, no logging, and vendor credentials hardcoded directly into the file, including a now-dead backup provider.

The script was still being called by a server that no one knew was even running. It silently failed when the vendor changed their api, and the fallback logic just returned true regardless of the result. No one noticed because the UI still showed “Message sent” every time.

I copied chunks of it into blackbox to figure out what a few functions were doing, and copilot tried to be helpful but kept autocompleting random curl examples that didn’t match the vendor’s API. I ended up rewriting the whole thing with proper error handling and pushed it into a repo for the first time.

feels wild how fragile some of the stuff we depend on actually is