The Prophet told something in confidence to one of his wives. When she disclosed it [to another wife] and God made this known to him, he confirmed part of it, keeping the rest to himself. When he confronted her with what she had done, she asked, ‘Who told you about this?’ and he replied, ‘The All Knowing, the All Aware told me.’
When the Prophet disclosed a matter in confidence to one of his consorts, and she then divulged it (to another), and Allah made it known to him, he confirmed part thereof and repudiated a part. Then when he told her thereof, she said, "Who told thee this? "He said, "He told me Who knows and is well-acquainted (with all things)."