Technology1 min read

CodeSOD: Next Month

By · Published by Everything Blog

In short

The disruption was traced by a colleague named Sean to a programming error that evaluated only calendar months while ignoring the year. Consequently, the software mistakenly compared the next billing month against the end date month, which caused the application to purge upcoming billing dates. While the company bypassed the need for a full backup restoration, teams still faced the task of auditing historical data to restore an unknown number of canceled customer billing periods.

Key points

  • Initech determined the software malfunction was an accidental coding error rather than de…: Initech determined the software malfunction was an accidental coding error rather than deliberate sabotage by the departed worker.
  • Staff avoided a complete backup restoration by deciding to reconstruct the missing billin…: Staff avoided a complete backup restoration by deciding to reconstruct the missing billing dates directly.
  • Employees must review the system history to identify and repair an unknown number of canc…: Employees must review the system history to identify and repair an unknown number of canceled customer billing periods.

Sources checked by our analysis pipeline: 1

One of Sean's colleagues left Initech on good terms. It caused no small amount of surprise that the very next day their billing system started failing. The billing system which the colleauge had worked on.

No one truly suspected foul play, it was just a weird coincidence. Still, billing blowing up was a 5 alarm fire, so everyone was throwing every idea out about what could be the cause.

Late in the evening, after staring at the code for many hours, Sean found this:

if item.next_bill_date.month >= end_date.month

item.next_bill_date = nil

item.save

else

...

end

If the month of the next billing date is greater than the last billing date for this account, wipe the billing date and update the item.

It's worth noting that Sean's co-worker's last date happened to be the end of November, and billing started blowing up on the 1st of December. You'll also note this is checking just the month and not any other part of the date, like, oh, I don't know, the year?

While this bug could happen to any bill, it was…

Technology