Scanner probes cause MimeNegotiation::InvalidType 500s on the home page: return 4xx instead
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
Línea de trabajo
Empieza leyendo el controlador unsupported_media_type existente en app/controllers/application_controller.rb y luego comprueba cómo se establece config.action_dispatch.rescue_responses en config/application.rb. Añade un request spec para GET / con el encabezado Accept mal formado y confirma que devuelve una respuesta 4xx. La tarea estará terminada cuando el spec pase y el tipo MIME no válido deje de producir un 500.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Scout APM Errors (7 days to 2026-11-15): ActionDispatch::Http::MimeNegotiation::InvalidType on StaticController#index (the home page). 4 all-time, 1 in the last 7 days, latest 2026-11-10. The message is a path-traversal probe: "../../../../../../../../../../etc/services{{" is not a valid MIME type.
Root cause
This is an automated scanner sending a junk Accept or Content-Type header. Rails raises while reading request.format and returns a 500, which pages us and fills the error list with noise. It is not a vulnerability: Rails rejects the value. It should be a 4xx, not an error.
Suggested fix
- In
ApplicationController, addrescue_from ActionDispatch::Http::MimeNegotiation::InvalidTypewith a handler that doeshead :not_acceptable(406) orhead :bad_request(400). Look at the existingunsupported_media_typehandler inapp/controllers/application_controller.rbfirst; it may be reusable. - Note the exception can be raised before the controller runs (in middleware). If a controller
rescue_fromdoes not catch it in a spec, add the handler as a small Rack middleware or useconfig.action_dispatch.rescue_responses["ActionDispatch::Http::MimeNegotiation::InvalidType"] = :not_acceptableinconfig/application.rb. That one line is the simplest option, try it first. - Add a request spec:
get "/", headers: {"Accept" => "../../etc/passwd{{"}returns 4xx, not 500. - Mark Scout error group 124280 resolved after deploy.
Difficulty: easy. Good first issue.
- Lenguaje dominante
- Ruby
- Estrellas
- 384
- Forks
- 558
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 63
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un 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 rubyforgood/casa
-
Difficulty: Easy Good First Issue Help Wanted ruby Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rubyforgood/casa#7402 ·
Los mantenedores suelen responder en 1 día
-
Remove the bin/bundle binstub (Heroku warns it can break Bundler on deploy)Posiblemente ocupada @Akash-Dhanwate la tomó hace 8 días. Abiertodependencies Difficulty: Easy Good First Issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
rubyforgood/casa#7325 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Reports page: move export-button disable/re-enable into a Stimulus controllerQuizá libre de nuevo @Akash-Dhanwate la tomó hace 9 días y no hay ningún pull request abierto. AbiertoDifficulty: Easy Good First Issue Help Wanted javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rubyforgood/casa#7311 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
New case: use Stimulus for the "I don't know the court date yet" toggleQuizá libre de nuevo @Aryankn29 la tomó hace 9 días y no hay ningún pull request abierto. AbiertoDifficulty: Easy Good First Issue Help Wanted javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rubyforgood/casa#7310 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Case contacts filter: use the auto-submit Stimulus controller instead of jQueryPosiblemente ocupada @Impana-14 la tomó hace 7 días. AbiertoDifficulty: Easy Good First Issue Help Wanted javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rubyforgood/casa#7309 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de rubyforgood/casa
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
internetee/registry#2984 ·
Los mantenedores suelen responder en 6 días
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configuredPosiblemente ocupada @mimosa la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
riscv/riscv-unified-db#2829 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
docker-library/ruby#534 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100