If what gets shared in confidence is of interest to all parties in the mix, it should not be kept a secret. At that point you let it be known you're not comfortable keeping that confidence you feel it should be shared with all involved.
If it doesn't matter in the grand scheme of things to everyone in the mix, it should be kept in confidence.
[A, B], [C, D]. example:
D bought C a sweater that she secretly hates and tells you she secretly hates it. Whats the point of sharing that?
C tells you she feels marginalized by D's relationship with B - you all need to sit down and talk that out even if C intended to only vent it with you and stew silently over it there after because it could end up a problem for all four.