Skeleton in the closet or skeleton in the cupboard is a colloquial phrase and idiom used to describe an undisclosed fact about someone which, if revealed, would damage perceptions of the person.
It evokes the idea of someone having had a human corpse concealed in their home so long that all its flesh had decomposed to the bone.
[1] It is listed in both the Oxford English Dictionary, and Webster's Dictionary, under the word "skeleton".
The "Cambridge Academic Content Dictionary" lists it under this but also as a separate idiom.
In the most derisive of usage, murder, or significant culpability in a years-old disappearance or non-understood event (a mystery), may be implied by the phrase.