I actually do have this problem. People confide stuff to me all the time. They have my whole life. Most of the time I make the right decision and keep my big mouth shut.
The very few times I've screwed up and opened my mouth, it didn't end well. So I would do my best to keep my mouth shut.
If it was really super funny I would probably tell my best friend... if she wasn't personally involved with one of the people the story was about. If she was... then I would tell my husband, have a good laugh and then it would go no further.
And I would probably snicker to myself whenever I saw the culprits.