policy: id: "spring4shell_check" file: "spring4shell_check.yml" name: "Spring4Shell dependency check" description: "This document provides prescriptive guidance for identifying Spring4Shell RCE vulnerability" references: - https://nvd.nist.gov/vuln/detail/CVE-2021-44228 - https://www.cisa.gov/uscert/apache-log4j-vulnerability-guidance requirements: title: "Check if Java is present on the machine" description: "Requirements for running the SCA scan against machines with Java on them." condition: all rules: - 'c:sh -c "ps aux | grep java | grep -v grep" -> r:java' checks: - id: 10000 title: "Ensure Spring framework is not under 5.3.18 or 5.2.20." description: "The Spring framework is vulnerable to Spring4Shell RCE (CVE-2022-22965) on versions 5.3.0 to 5.3.17, and 5.2.0 to 5.2.19" remediation: "Update the Spring framework to version 5.3.18 or 5.2.20" condition: none rules: - 'c:find / -name "*.jar" -type f -exec sh -c "if unzip -l {} | grep org/springframework/; then unzip -p {} META-INF/MANIFEST.MF; fi | grep Implementation-Version" \; -> r:5.3.0$|5.3.1$|5.3.2$|5.3.3$|5.3.4$|5.3.5$|5.3.6$|5.3.7$|5.3.8$|5.3.9$|5.3.10$|5.3.11$|5.3.12$|5.3.13$|5.3.14$|5.3.15$|5.3.16$|5.3.17$|5.2.0$|5.2.1$|5.2.2$|5.2.3$|5.2.4$|5.2.5$|5.2.6$|5.2.7$|5.2.8$|5.2.9$|5.2.10$|5.2.11$|5.2.12$|5.2.13$|5.2.14$|5.2.15$|5.2.16$|5.2.17$|5.2.18$|5.2.19$'