Obviously, we can't know what her sore was. We didn't see it.
The palm of the hand is a very unusual place for a syphilis chancre, though. Perhaps she cut it on something - that's far more likely.
It's even less likely that it would be a herpes sore.
I wouldn't worry about this being an STD at all, and touching is no risk for STD transmission.