Files
gh-openrewrite-rewrite-docs…/skills/writing-openrewrite-recipes/references/recipes-security-common.csv
2025-11-30 08:45:33 +08:00

9.5 KiB

1Fully Qualified Recipe NameRecipe NameDescription
2io.moderne.cryptography.FindSecurityModificationsFind Security class modificationsFinds invocations of java.security.Security methods that modify security configuration such as removeProvider addProvider insertProviderAt setProperty and removeProperty.
3io.moderne.cryptography.FindSecuritySetPropertiesFind `Security.setProperty(..)` calls for certain propertiesThere is a defined set of properties that should not be set using `Security.setProperty(..)` as they can lead to security vulnerabilities.
4org.openrewrite.analysis.java.security.FindSecurityVulnerabilitiesFind security vulnerabilities using taint analysisIdentifies potential security vulnerabilities where untrusted data from sources flows to sensitive sinks without proper sanitization.
5org.openrewrite.analysis.java.security.FindCommandInjectionFind command injection vulnerabilitiesDetects when user-controlled input flows into system command execution methods like Runtime.exec() or ProcessBuilder which could allow attackers to execute arbitrary commands.
6org.openrewrite.analysis.java.security.FindLdapInjectionFind LDAP injection vulnerabilitiesFinds LDAP injection vulnerabilities by tracking tainted data flow from user input to LDAP queries.
7org.openrewrite.analysis.java.security.FindPathTraversalFind path traversal vulnerabilitiesDetects potential path traversal vulnerabilities where user input flows to file system operations without proper validation.
8org.openrewrite.analysis.java.security.FindSqlInjectionFind SQL injection vulnerabilitiesDetects potential SQL injection vulnerabilities where user input flows to SQL execution methods without proper sanitization.
9org.openrewrite.analysis.java.security.FindUnencryptedPiiStorageFind unencrypted PII storageIdentifies when personally identifiable information (PII) is stored in databases files or other persistent storage without encryption.
10org.openrewrite.analysis.java.security.FindXssVulnerabilityFind XSS vulnerabilitiesDetects potential cross-site scripting vulnerabilities where user input flows to output methods without proper sanitization.
11org.openrewrite.analysis.java.security.FindXxeVulnerabilityFind XXE vulnerabilitiesLocates XML parsers that are not configured to prevent XML External Entity (XXE) attacks.
12io.moderne.vulncheck.FixVulnCheckVulnerabilitiesUse [VulnCheck Exploit Intelligence](https://docs.vulncheck.com/products/exploit-and-vulnerability-intelligence/exploit-intelligence) to fix vulnerabilitiesThis software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe by default only upgrades to the latest **patch** version. If a minor or major upgrade is required to reach the fixed version this can be controlled using the `maximumUpgradeDelta` option. Vulnerability information comes from VulnCheck Vulnerability Intelligence. The recipe has an option to limit fixes to only those vulnerabilities that have evidence of exploitation at various levels of severity.
13org.openrewrite.xml.security.AddOwaspDateBoundSuppressionsAdd date bounds to OWASP suppressionsAdds an expiration date to all OWASP suppressions in order to ensure that they are periodically reviewed. For use with the OWASP `dependency-check` tool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
14org.openrewrite.xml.security.IsOwaspSuppressionsFileFind OWASP vulnerability suppression XML filesThese files are used to suppress false positives in OWASP [Dependency Check](https://jeremylong.github.io/DependencyCheck).
15org.openrewrite.xml.security.RemoveOwaspSuppressionsRemove out-of-date OWASP suppressionsRemove all OWASP suppressions with a suppression end date in the past as these are no longer valid. For use with the OWASP `dependency-check` tool. More details on OWASP suppression files can be found [here](https://jeremylong.github.io/DependencyCheck/general/suppression.html).
16org.openrewrite.xml.security.UpdateOwaspSuppressionDateUpdate OWASP suppression date boundsUpdates the expiration date for OWASP suppressions having a matching cve tag. For use with the OWASP `dependency-check` tool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
17org.openrewrite.github.security.InsecureCommandsRecipeFind insecure commands configurationDetects when insecure workflow commands are enabled via `ACTIONS_ALLOW_UNSECURE_COMMANDS`. This environment variable enables dangerous workflow commands that can lead to code injection vulnerabilities. Based on [zizmor's insecure-commands audit](https://github.com/woodruffw/zizmor/blob/main/crates/zizmor/src/audit/insecure_commands.rs).
18org.openrewrite.github.security.TemplateInjectionRecipeFind template injection vulnerabilitiesFind GitHub Actions workflows vulnerable to template injection attacks. These occur when user-controllable input (like pull request titles issue bodies or commit messages) is used directly in `run` commands or `script` inputs without proper escaping. Attackers can exploit this to execute arbitrary code. Based on [zizmor's `template-injection` audit](https://github.com/woodruffw/zizmor/blob/main/crates/zizmor/src/audit/template_injection.rs).
19org.openrewrite.java.security.PartialPathTraversalVulnerabilityPartial path traversal vulnerabilityReplaces `dir.getCanonicalPath().startsWith(parent.getCanonicalPath()` which is vulnerable to partial path traversal attacks with the more secure `dir.getCanonicalFile().toPath().startsWith(parent.getCanonicalFile().toPath())`. To demonstrate this vulnerability consider `"/usr/outnot".startsWith("/usr/out")`. The check is bypassed although `/outnot` is not under the `/out` directory. It's important to understand that the terminating slash may be removed when using various `String` representations of the `File` object. For example on Linux `println(new File("/var"))` will print `/var` but `println(new File("/var" "/")` will print `/var/`; however `println(new File("/var" "/").getCanonicalPath())` will print `/var`.
20org.openrewrite.java.security.marshalling.InsecureJmsDeserializationInsecure JMS deserializationJMS `Object` messages depend on Java Serialization for marshalling/unmarshalling of the message payload when `ObjectMessage#getObject` is called. Deserialization of untrusted data can lead to security flaws.
21org.openrewrite.java.security.servlet.CookieSetSecureInsecure cookiesCheck for use of insecure cookies. Cookies should be marked as secure. This ensures that the cookie is sent only over HTTPS to prevent cross-site scripting attacks.
22org.openrewrite.java.security.XmlParserXXEVulnerabilityXML parser XXE vulnerabilityAvoid exposing dangerous features of the XML parser by updating certain factory settings.
23org.openrewrite.java.security.spring.CsrfProtectionEnable CSRF attack preventionCross-Site Request Forgery (CSRF) is a type of attack that occurs when a malicious web site email blog instant message or program causes a user's web browser to perform an unwanted action on a trusted site when the user is authenticated. See the full [OWASP cheatsheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html).
24org.openrewrite.java.security.OwaspTopTenRemediate vulnerabilities from the OWASP Top Ten[OWASP](https://owasp.org) publishes a list of the most impactful common security vulnerabilities. These recipes identify and remediate vulnerabilities from the OWASP Top Ten.
25org.openrewrite.java.security.OwaspA01Remediate OWASP A01:2021 Broken access controlOWASP [A01:2021](https://owasp.org/Top10/A01_2021-Broken_Access_Control/) describes failures related to broken access control.
26org.openrewrite.java.security.OwaspA02Remediate OWASP A02:2021 Cryptographic failuresOWASP [A02:2021](https://owasp.org/Top10/A02_2021-Cryptographic_Failures/) describes failures related to cryptography (or lack thereof) which often lead to exposure of sensitive data. This recipe seeks to remediate these vulnerabilities.
27org.openrewrite.java.security.OwaspA03Remediate OWASP A03:2021 InjectionOWASP [A03:2021](https://owasp.org/Top10/A03_2021-Injection/) describes failures related to user-supplied data being used to influence program state to operate outside of its intended bounds. This recipe seeks to remediate these vulnerabilities.
28org.openrewrite.java.security.OwaspA05Remediate OWASP A05:2021 Security misconfigurationOWASP [A05:2021](https://owasp.org/Top10/A05_2021-Security_Misconfiguration/) describes failures related to security misconfiguration.
29org.openrewrite.java.security.OwaspA06Remediate OWASP A06:2021 Vulnerable and outdated componentsOWASP [A06:2021](https://owasp.org/Top10/A06_2021-Vulnerable_and_Outdated_Components/) describes failures related to vulnerable and outdated components.
30org.openrewrite.java.security.OwaspA08Remediate OWASP A08:2021 Software and data integrity failuresOWASP [A08:2021](https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/) software and data integrity failures.
31org.openrewrite.java.spring.security6.PropagateAuthenticationServiceExceptionsRemove calls matching `AuthenticationEntryPointFailureHandler.setRethrowAuthenticationServiceException(true)`Remove any calls matching `AuthenticationEntryPointFailureHandler.setRethrowAuthenticationServiceException(true)`. See the corresponding [Sprint Security 6.0 migration step](https://docs.spring.io/spring-security/reference/6.0.0/migration/servlet/authentication.html#_propagate_authenticationserviceexceptions) for details.