The original getRelativeFrom method manually traversed parent directories without using secure path resolution, making it susceptible to path traversal.
createImageGallery accepted user-controlled 'baseRootFolder' input without verifying it was contained within the artifacts directory. The patch added Path normalization and the isChild() check to address these issues, confirming these functions were the attack vectors.