The CRA has published an informative article explaining how CPP and EI amounts are deducted when an individual is employed by or placed in a postition of employment by an employment/placement agency.
The article can be found on the Canada Revenue Website here.