Thy friend has a friend, and thy friend’s friend has a friend; be discreet.
The Talmud (AD 200-500) Collection of Jewish rabbinical writings
Babylonian Talmud, Baba Bathra 28b
(Source)
Noted as a common saying. The summary "be discreet" does not appear in the actual Talmud translations I found, but seems to be an explanation from early Christian reviews of the Talmud for when the verse is given as a stand-alone proverb.