This study develops a three-dimensional automated detection framework (PitScan) that systematically evaluates the severity and phenomenology of pitting corrosion. This framework uses a python-based algorithm to analyse microcomputer-tomography scans (μCT) of cylindrical specimens undergoing corrosion. The approach systematically identifies several surface-based corrosion features, enabling full spatial characterisation of pitting parameters, including pit density, pit size, pit depth as well as pitting factor according to ASTM G46-94. Furthermore, it is used to evaluate pitting formation in tensile specimens of a Rare Earth Magnesium alloy undergoing corrosion, and relationships between key pitting parameters and mechanical performance are established. Results demonstrated that several of the parameters described in ASTM G46-94, including pit number, pit density and pitting factor, showed little correlation to mechanical performance. However, this study did identify that other parameters showed strong correlations with the ultimate tensile strength and these tended to be directly linked to the reduction of the cross-sectional area of the specimen. Specifically, our results indicate, that parameters directly linked to the loss of the cross-sectional area (e.g. minimum material width), are parameters that are most suited to provide an indication of a specimen's mechanical performance. The automated detection framework developed in this study has the potential to provide a basis to standardise measurements of pitting corrosion across a range of metals and future prediction of mechanical strength over degradation time.