Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class SecurityConfig {
"/v3/api-docs/**", "/swagger-ui/**", "/swagger-resources/**",
"/api/v1/tags/**",
"/actuator/health",
"/api/v1/auth/signup"
"/api/v1/auth/signup",
"/api/v1/auth/refresh"
};

private static final String[] REQUEST_AUTHENTICATED_ARRAY = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
"/swagger-ui",
"/swagger-ui.html",
"/swagger-resources",
"/actuator"
"/actuator",
"/api/v1/auth/refresh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

Adding /api/v1/auth/refresh to the EXCLUDED_PATHS list using startsWith in the shouldNotFilter method is insecure. This can lead to authentication bypasses via path traversal (e.g., /api/v1/auth/refresh/..;/protected-endpoint) or unintentionally match other endpoints (e.g., /api/v1/auth/refresh-admin). It is recommended to use exact matching or a robust path matcher like AntPathMatcher. Furthermore, this change alone is insufficient; the SecurityConfig.java file must also be updated to allow public access to this endpoint by adding "/api/v1/auth/refresh" to PERMIT_ALL_URL_ARRAY. Without this, the endpoint will be blocked by Spring Security's anyRequest().authenticated() rule, preventing token reissuance.

);

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-test..yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spring:

jpa:
hibernate:
ddl-auto: create-drop
ddl-auto: none
properties:
hibernate:
dialect: ${JPA_HIBERNATE_DIALECT}
Expand Down
Loading