Was it directly connected to the internet? Do you know how they got access? I am now worrying about my synology, but I am away from home for the next few days.
(Edit) Or it might've been checking for updates, got redirected elsewhere via a DNS hijack, downloaded something funny, didn't bother to check if it's authentic and installed it.