This article presents a new model for valuing financial contracts subject to credit risk and collateralization. Examples include the valuation of a credit default swap (CDS) contract that is affected by the trilateral credit risk of the buyer, seller and reference entity. We show that default dependency has a significant impact on asset pricing. In fact, correlated default risk is one of the most pervasive threats in financial markets. We also show that a fully collateralized CDS is not equivalent to a risk-free one. In other words, full collateralization cannot eliminate counterparty risk completely in the CDS market.