Remediate OWASP A07:2025 Identification and authentication failures
Recipe ID
org.openrewrite.java.security.Owasp2025A07Artifactorg.openrewrite.recipe:rewrite-java-securityOWASP A07:2025 describes failures related to identification and authentication, including weak credential management, missing brute force protections, session fixation, hardcoded credentials, insecure "remember me", and missing multi-factor authentication. Same position as A07:2021 (no prior aggregator existed).
Composite recipeCWE-521CWE-259CWE-347CWE-798CWE-1004CWE-327CWE-613CWE-614CWE-307CWE-539CWE-294CWE-384CWE-287securityCWE-916Proprietary
Add to your build
Get a download tokenThis recipe is Moderne licensed, so the token must belong to a Moderne customer. It replaces YOUR_DOWNLOAD_TOKEN below.
~/.gradle/gradle.properties
codeGenomeUsername=you@example.com
codeGenomeToken=YOUR_DOWNLOAD_TOKEN
build.gradle.kts
plugins {
id("org.openrewrite.rewrite") version("latest.release")
}
rewrite {
activeRecipe("org.openrewrite.java.security.Owasp2025A07")
}
repositories {
mavenCentral()
maven {
url = uri("https://artifacts.codegenomeproject.org/maven")
credentials {
username = providers.gradleProperty("codeGenomeUsername").get()
password = providers.gradleProperty("codeGenomeToken").get()
}
}
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-java-security:3.41.0")
}
Then run
./gradlew rewriteRunUsage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.java.security.Owasp2025A07If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-java-security:RELEASEDefinition
This recipe runs the following recipes in order.
- Find secrets
org.openrewrite.java.security.secrets.FindSecrets - Find hardcoded authentication credentials
org.openrewrite.java.security.search.FindHardcodedAuthenticationCredentials - Find
User.withDefaultPasswordEncoder()usageorg.openrewrite.java.security.search.FindUserWithDefaultPasswordEncoder - Remove explicit configuration of SHA-256 as encoding and matching algorithm for
TokenBasedRememberMeServicesorg.openrewrite.java.spring.security6.UseSha256InRememberMe - Find weak Spring Security password encoders
org.openrewrite.java.security.search.FindWeakSpringPasswordEncoder - Find weak message digests used inside custom
PasswordEncoderimplementationsorg.openrewrite.java.security.search.FindWeakDigestInPasswordEncoder - Find unsigned JWT usage
org.openrewrite.java.security.search.FindUnsignedJwt - Find Spring Security configurations that disable session fixation protection
org.openrewrite.java.security.search.FindInsecureSessionFixationConfig - Find insecure Spring Security RememberMe configuration
org.openrewrite.java.security.search.FindInsecureRememberMeConfig - Find weak password encoder strength
org.openrewrite.java.security.search.FindWeakPasswordEncoderStrength - Find long or disabled HTTP session timeout
org.openrewrite.java.security.search.FindLongSessionTimeout - Insecure cookies
org.openrewrite.java.security.servlet.CookieSetSecure - Cookies missing HttpOnly flag
org.openrewrite.java.security.servlet.CookieSetHttpOnly
Data tables
Structured output this recipe can produce.
- Taint flowRecords taint flows from sources to sinks with their taint types.
org.openrewrite.analysis.java.taint.table.TaintFlowTable - Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats