We develop a state-space model to decompose bid and ask quotes of CDS into two components, fair default premium and liquidity premium. This approach gives a better estimate of the default premium than mid quotes, and it allows to disentangle and compare the liquidity premium earned by the protection buyer and the protection seller. In contrast to other studies, our model is structurally much simpler, while it also allows for correlation between liquidity and default premia, as supported by empirical evidence. The model is implemented and applied to a large data set of 118 CDS for a period ranging from 2004 to 2010. The model-generated output variables are analyzed in a difference-in-difference framework to determine how the default premium, as well as the liquidity premium of protection buyers and sellers, evolved during different periods of the financial crisis and to which extent they differ for financial institutions compared to non-financials.