A new bug has been discovered that breaks all Mac networking every 49 days, 17 hours, two minutes, and 47 seconds. It's simple to get around the bug, though.

The bug was detailed in a blog post by Photon, a service that connects AI agents to iMessage. In it, Photon explains how it discovered the issue on its own fleet of Mac servers and confirmed its discovery by running additional targeted testing.

According to Photon, the bug affects all Macs, whether you use the brand-new MacBook Neo or a powerhouse Mac Studio. The good news is that you can avoid the bug by simply restarting your Mac sooner than every 49 days, 17 hours, two minutes, and 47 seconds.

The countdown is on

In a lengthy blog post detailing the bug, Photon explains that affected Macs can no longer establish new TCP connections. TCP connections are the backbone of computer networking — without them, the Mac's network interfaces can no longer function.

In its simplest form, the issue is caused by the way macOS's XNU kernel handles time. Your Mac tracks how long it has been running, and the time resets when it's powered off or restarted.

The problem is that Apple's XNU kernel stores this time as a 32-bit unsigned integer that can hold values from 0 to 4,294,967,295. After that, the value wraps around, starting again from zero. This happens after 49 days, 17 hours, two minutes, and 47 seconds.

While this is expected behavior, it has an unintended knock-on effect on the way macOS closes old TCP connections. After keeping connections alive for a short period after use, macOS uses the XNU kernel's TCP timestamp to decide whether to close them.

Silver MacBook with Apple logo on a shelf, beside an orange smart speaker, potted plant, Apple Watch with orange band, and glowing blue orb against a brick wall backdrop

All Macs are affected, including Apple's newest models

According to Photon, this approach works as intended until the timestamp reaches its limit and wraps around to zero. At this point, the TCP cleanup process no longer starts because old connections aren't deemed to have expired

Effectively, by resetting the clock to zero, macOS also resets the clock on all TCP connections. As a result, they never reach the threshold required to trigger the cleanup process.

Because no old TCP connections are closed, their resources are never made available for new connections. The affected Mac's network grinds to a halt as a result.

The sledgehammer fix

Thankfully, there are some mitigations to consider with this particular bug. The most important thing is that the majority of Macs don't go almost 50 days between restarts.

Between macOS updates and individual user habits of restarting to fix other issues, most users will be unaffected. And for those who are, a simple restart of the Mac will restore network connectivity.

Unfortunately, there are plenty of Macs that routinely run for longer than the 49 days, 17 hours, two minutes, and 47 seconds required for this bug to kick in. Macs that are used as servers, like Photon's, are most likely to be affected.

But developers who leave Mac Pro workstations working on projects could also fall foul of this issue. The recent uptick in Mac mini and Mac Studio demand for AI workflows could lead those machines to be affected, too.

For now, you don't have to be as militant as our own Mike Wuerthele who completely shuts down almost every night. We do recommend that you at least restart your Mac more regularly than every week.

We've reached out to Apple for comment. Photon says it's also actively working on a fix that doesn't require Macs to be restarted.