I don't know how old your hamster is but it could be an abscess, or infection, or something worse, like cancer if your hamster is older. I would take her to a vet to be definative. Your vet could perform a fine needle aspirate by sticking a very tiny needle in the mass and if pus comes out it is an abscess, if something else comes out the substance can be sent to a pathologist for definative diagnosis.
Oh, I forgot to add that. The hamster mentioned just turned 1 about 2 weeks ago. It might be cancer like you said because she is older. I'm concerned about how common is cancer in older hamsters? Because her pups are turning one in a few weeks.
Thank you for your help, I'll try to take her to the vet to see what it is.