[Bug] PathMatchingFilterChainResolver.setPathMatcher() does not reach PathMatchingFilters
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- authentication, security
Línea de trabajo
Start with PathMatchingFilterChainResolver.setPathMatcher, FilterChainManager.createChain, and PathMatchingFilter.preHandle; the mismatch is between the resolver's matcher and each filter's private AntPathMatcher. Compare with the Spring wiring in #2928. Exercise the resolver through an AbstractShiroFilter with the regex chain from the report; done means /secure/report without credentials returns 401 via authcBasic, while the literal /admin/panel chain still works.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Search before asking
- I had searched in the issues, including closed issues, and found no similar issues.
Environment
Java 21, embedded Tomcat 11.0.13, plain servlet API (no Spring, no Guice, no INI).
Shiro version
3.0.2. main at ea33e99 has the same code.
What was the actual outcome?
PathMatchingFilterChainResolver.setPathMatcher() changes only the resolver's own matcher. Each PathMatchingFilter keeps its private AntPathMatcher and matches the path again in preHandle. With RegExPatternMatcher and the chain /secure/[^/]+ = authcBasic, the resolver selects the chain, the filter's Ant match fails, and preHandle returns true, so authcBasic does not run and the request goes through without credentials.
What was the expected outcome?
The filters in the selected chain use the same matcher as the resolver, as ShiroFilterFactoryBean already arranges for Spring (#2928), so authcBasic runs for /secure/report.
How to reproduce
var resolver = new PathMatchingFilterChainResolver();
resolver.setPathMatcher(new RegExPatternMatcher());
resolver.getFilterChainManager().createChain("/secure/[^/]+", "authcBasic");
// Install the resolver in an AbstractShiroFilter, then:
// GET /secure/report without credentials -> 200 (expected 401)
A literal chain such as /admin/panel = authcBasic answers 401 in the same setup, because both matchers read it alike. I have a pull request that applies the resolver's matcher to the PathMatchingFilters in its FilterChainManager.
- Lenguaje dominante
- Java
- Estrellas
- 4.5k
- Forks
- 2.3k
- Merge medio
- 1 d 5 min
- PR fusionados (30 d)
- 27
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/shiro
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[Bug] Jakarta EE: secure-session-cookie.disabled is ignored in Faces Production modePosiblemente ocupada @AndrewG10i la tomó hace 5 días. Abiertojava valid
apache/shiro#2962 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Enable strict authorization configuration by default in 3.1Posiblemente ocupada @lprimak la tomó hace 11 días. Abiertojava
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
help-wanted java valid
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
valid
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
apache/shiro#2325 · 10 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/shiro
Issues similares
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Handle TSP error code 212Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
bug module: hybrid priority: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bancolombia/bin-stash#92 ·
-
Pub/Sub nackSplit drops other splits' empty checkpoint entries and lowers pendingCheckpointsAbiertobug module:pubsub priority:P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
flink-gcp/flink-connector-gcp#2325 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
eclipse-dirigible/dirigible#8877 ·
Los mantenedores suelen responder en 1 día