The sigillum, or seal, is permeable only when there is moral certainty that discussion of a penitent’s sins would not be traceable back to him. For instance, a priest could discuss with seminarians the ways in which he has dealt with certain kinds of sins. It would not be permissible for a priest to say at a conference that he was at St. so and so’s parish one time and a big man with a long red beard came to confession and said x y z.
In the case of hearing the sin on the external forum, what must be avoided is the sin of scandal… He must go out of his way to show that he learned this from an informer, rather than a penitent.
There is a lot of commentary out there on canons 983 and 984, which are the ones that deal with this. There is a bit of a gray area… What exactly does “detriment” mean, and all that.