I have been contacted by a purported Xfinity agent, reporting my modem software is out of date.
How can I check this, and could it be scam?
It's almost certainly a scam. With rare exceptions, Comcast can update modem and gateway devices automatically.
Did the agent offer any details?