Q:

Using CAPM to find correlation of two assets with each other

I stumpled upon an exercise in an investments book:

The data below describe a three-stock financial market that satisfies
  the single-index model.

Stock Capitalization Beta Mean Excess Return Standard Deviation
 A     $3,000         1.0  10%                40% 
 B     $1,940         0.2  2%                 30% 
 C     $1,360         1.7  17%                50%

The standard deviation of the market-index portfolio is 25%.
a. What is the mean excess return of the index portfolio? 
b. What is
  the covariance between stock A and stock B ?

With the solution to the second question given as:

$Cov(R_A, R_B) = \beta_A \beta_B \sigma_M^2 =  1 * 0.2 * .25^2 = .0125$

This translates to $\beta_A \beta_B \sigma_M^2 = \frac{Cov(A,M)}{\sigma_M^2}*\frac{Cov(B,M)}{\sigma_M^2}*\sigma_M^2 = \frac{Cov(A,M)Cov(B,M)}{\sigma_M^2}$
However, I could not derive this formula, and mathematically, we do not know what the correlation is between two assets just from their covariance with a third asset (except that we can give upper and lower bounds, in some cases).
For example, if $A,B$ i.i.d., and $M := A+B$, then 
$Cov(A,B) = 0$ by construction, but $Cov(A,M) = Cov(B,M) = Cov(A,A+B) = Cov(A,A)+Cov(A,B) = Var(A)$.
Am I missing something? Are the assumptions of CAPM playing into this?
Are the sample solutions incorrect?

A:

The solution provided can be derived using the CAPM. For asset $A$ you have:
$$R_A-R_f = \alpha_A +\beta_A(R_M-R_f)+\epsilon_A$$
Similarly for asset B:
$$R_B-R_f = \alpha_B +\beta_B(R_M-R_f)+\epsilon_B$$
Calculate the covariance:
$$\text{Cov}(R_A, R_B) = \text{Cov}(\beta_AR_M, \beta_BR_M)$$
Here I have dispensed with all the constant terms, and also used the usual CAPM assumption that $\epsilon$ represents idiosyncratic volatility, so $\text{Cov}(\epsilon_A, \epsilon_B) = 0$, $\text{Cov}(R_M, \epsilon_A) = 0$ and $\text{Cov}(R_M, \epsilon_B) = 0$. So we have:
$$\text{Cov}(R_A, R_B) = \beta_A\beta_B\text{Cov}(R_M, R_M) = \beta_A \beta_B\sigma_M^2$$

