Validate the report-uri value given to CSPHeaderConfiguration#reportBack
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
Línea de trabajo
Lee la rama de validación de REPORT_URI en CSPDirective.java y checkValidityForSrc() de RelativeURICSPValue.java para confirmar si rechaza las URL absolutas. Añade pruebas para una URL absoluta no válida y una ruta de montaje cspviolation válida en wicket-core-tests/src/test/java/org/apache/wicket/csp/CSPDirectiveTest.java. Se considera terminado cuando reportBack rechaza los valores no relativos con IllegalArgumentException y acepta una ruta de montaje normal.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
CSPHeaderConfiguration#reportBack(String mountPath) adds a RelativeURICSPValue to the report-uri directive. The directive's checkValueForDirective returns as soon as it sees a RelativeURICSPValue, so the value is never checked. Passing an absolute URL or a malformed path by mistake is accepted silently and produces a CSP header the browser can't use.
Where
wicket-core/src/main/java/org/apache/wicket/csp/CSPDirective.java, theREPORT_URIconstant'scheckValueForDirective: theif (value instanceof RelativeURICSPValue) { return; }branch.wicket-core/src/main/java/org/apache/wicket/csp/RelativeURICSPValue.javaalready hascheckValidityForSrc(), which resolves the value againsthttps://example.com/. The original report suggests calling it from the branch above. Check whether it actually rejects an absolute URL likehttps://evil.example/report; the report says it should be rewritten as well.
Done when
reportBackthrows anIllegalArgumentExceptionfor a value that isn't a relative path, and still accepts a normal mount path likecspviolation.- Tests for both cases in
wicket-core-tests/src/test/java/org/apache/wicket/csp/CSPDirectiveTest.java.
Background
Originally reported as WICKET-7015 (Wicket 9.12). The reporter included the proposed change in the ticket.
Part of #1945. This issue is meant for a first contribution to Wicket. To work on it, leave a comment so others know; a claim without a pull request lapses after two weeks. Questions are welcome, here on the issue or on [email protected]. Start your branch from master, and see Send a pull request to Wicket for building and testing.
- Lenguaje dominante
- Java
- Estrellas
- 800
- Forks
- 437
- Merge medio
- 21 h 36 min
- PR fusionados (30 d)
- 167
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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/wicket
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPosiblemente ocupada @vaibhavgupta443 la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/wicket#1991 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Stop the autocomplete from accumulating request parameters while typingPosiblemente ocupada @aryankalantri la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
apache/wicket#1947 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/wicket
Issues similares
-
account assessment course feature lecture
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
app:learninggoalhub enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100