Imagine a pirate vessel drifting through space, compromising ships' OSes with a LADAR- or comms-based zero-day.
There will absolutely be space hackers taking advantage of this type of vulnerability, and I think that's the coolest shit my 12 year old brain could've come up with.
A ship on the sea (or in space) is independent and things always come up. Pretty much the whole history of ships has shown that you need to make updates and modifications and get tech upgrades as/when possible.
Well hardware maybe, but i think that software does not degrade the way hardware does. There is a lot of firmware which never gets updated and devices just keep working as long as the hardware is still ok.
And then even without these updates ships are fine running legacy software controlling obsolete hardware. As long as spares are available. Would a major navy, like the Martian one, keep their fleet up to date? Sure. Would it be done in flight? I don't think so. As today, this stuff is done during major maintenance in shipyards. Same goes for today's planes.