Child sexual abuse inflicts lifelong devastating consequences for victims and is an ongoing social concern. In most countries, child sexual abuse material (CSAM) distribution is illegal. As a result, there are many research papers in the literature which proposed technologies to detect and investigate CSAM. In this survey, a comprehensive search of the peer-reviewed journal and conference paper databases (including preprints) is conducted to identify high-quality literature. We use the PRISMA methodology to refine our search space to 2,761 papers published by Springer, Elsevier, IEEE and ACM. After iterative reviews of title, abstract and full text for relevance to our topics, 43 papers are included for full review. Our paper provides a comprehensive synthesis of the tasks of the current research and how the papers use techniques and datasets to solve their tasks and evaluate their models. To the best of our knowledge, we are the first to focus exclusively on online CSAM detection and prevention with no geographic boundaries, and the first survey to review papers published after 2018. It can be used by researchers to identify gaps in knowledge and relevant publicly available datasets that may be useful for their research.