Configure authentication mechanisms with secure default settings to prevent security vulnerabilities. When implementing WebAuthn or similar authentication protocols:
Configure authentication mechanisms with secure default settings to prevent security vulnerabilities. When implementing WebAuthn or similar authentication protocols:
// INCORRECT: Allows attestation bypass
return new WebAuthnAsyncManager(
Arrays.asList(
new NoneAttestationStatementAsyncVerifier(),
// other verifiers
)
);
// INCORRECT: Too short for authentication ceremonies
this.timeout = config.timeout().orElse(Duration.ofSeconds(60));
// CORRECT: Use recommended 5 minutes
this.timeout = config.timeout().orElse(Duration.ofMinutes(5));
// INCORRECT: Security feature disabled by default
this.userPresenceRequired = config.userPresenceRequired().orElse(false);
// CORRECT: Security feature enabled by default
this.userPresenceRequired = config.userPresenceRequired().orElse(true);
// VULNERABLE: Returns user-specific credential information
// to unauthenticated requests
.map(challenge -> security.toJsonString(challenge))
.subscribe().with(challenge -> ok(ctx, challenge), ctx::fail);
Enter the URL of a public GitHub repository