Cancer genomics has revealed complex landscapes of molecular aberrations in human tumours. These tend to converge into a limited set of cellular processes, suggesting that the knowledge of signaling pathways can be used to functionally characterize large sets of cancer somatic alterations. A rigorous identification of significantly altered biological pathways is challenged by the high heterogeneity among samples, their differences in mutation rates, and the combinatorial properties arising from cancer evolution. We present SLAPenrich, a statistical approach implemented in an open source R package to search for pathways that are genomically altered in a recurrent manner across the mutations observed in heterogeneous populations of samples. Differently from other tools, our approach assumes the functionality of a given pathway to be potentially disregulated if at least one of its genes is somatically altered. SLAPenrich performs enrichment analysis of pathways at the population level, accounting for differences in mutation rates between samples, exonic lengths of genes in a given pathway, and possible trends of mutational mutual exclusivity among genes of the same pathway. Analyzing a set of somatic mutations from a cohort of lung adenocarcinoma (LUAD) patients we show that SLAPenrich is able to detect well-known LUAD altered pathways, novel pathways recently proposed as therapeutic targets, and to detect established associations with clinicopathological features. Most importantly, we used SLAPenrich to explore, for the first time, the landscape of pathways contributing to the acquisition of the canonical cancer hallmarks, and we show how this analysis can point at novel cancer driver genes and networks. SLAPenrich is a tool to analyze any type of biological dataset amenable to be modeled as a binary matrix equipped with routines to report and visualize results. Our versatile formalism allows differential enrichment analysis of sub-populations, and enabled us to assemble a data-driven landscape of cancer hallmark acquisitions across different cancer types.