Molecular diagnosis and surveillance of pathogens such as SARS-CoV-2 depend on nucleic acid isolation. Pandemics at the scale of COVID-19 can cause a global shortage of proprietary commercial reagents and BSL-2 laboratories to safely perform testing. Therefore, alternative solutions are urgently needed to address these challenges. An open-source method, magnetic-nanoparticle-aided viral RNA isolation from contagious samples (MAVRICS), built upon readily available reagents, and easily assembled in any basically equipped laboratory, is thus developed. The performance of MAVRICS is evaluated using validated pathogen detection assays and real-world and contrived samples. Unlike conventional methods, MAVRICS works directly in samples inactivated in phenol-chloroform (e.g., TRIzol), thus allowing infectious samples to be handled safely without biocontainment facilities. MAVRICS allows wastewater biomass immobilized on membranes to be directly inactivated and lysed in TRIzol followed by RNA extraction by magnetic nanoparticles, thereby greatly reducing biohazard risk and simplifying processing procedures. Using 39 COVID-19 patient samples and two wastewater samples, it is shown that MAVRICS rivals commercial kits in detection of SARS-CoV-2, influenza viruses, and respiratory syncytial virus. Therefore, MAVRICS is safe, fast, and scalable. It is field-deployable with minimal equipment requirements and could become an enabling technology for widespread testing and wastewater monitoring of diverse pathogens.