CodeQL flags request host and path reaching slog in plugins
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 60/100
Línea de trabajo
The log calls are in core/cost/settle/settle.go, core/plugins/a2aparser/plugin.go, core/plugins/contextguru/plugin.go, core/plugins/cpex/manager_cpex.go, and the other plugin files listed in the issue, each at the given line numbers. Start by finding pipeline.SanitizeLogValue, the helper added in #1616, and check how it is called there. Then wrap every pctx.Host and pctx.Path passed to slog in it. Done when a PR touching these lines raises no go/log-injection alerts in CodeQL.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
CodeQL (go/log-injection, medium) will flag plugins that pass pctx.Host or pctx.Path to slog.* unsanitized. Both values are client-controlled. pctx.Host comes from the Host header. pctx.Path is the percent-decoded URL path, so a %0A in a request becomes a real newline in the log line.
Call sites, by log message. Line numbers are as of main at 5ba75a0:
- cost/settle (
core/cost/settle/settle.go:225,:229) —refused an implausible cost header,refused a cost header larger than any inference call could plausibly be - a2a-parser (
core/plugins/a2aparser/plugin.go:60,:76) —invalid JSON-RPC,not an A2A-namespace method - context-guru (
core/plugins/contextguru/plugin.go:253,:273) —skipped request with no session identity, and the per-request summary line - cpex (
core/plugins/cpex/manager_cpex.go:587) —body modification requested but no protocol extension present - ibac (
core/plugins/ibac/plugin.go:528,:541) —judge uncertain,judge unavailable - inference-parser (
core/plugins/inferenceparser/plugin.go:90) —no/invalid body - mcp-parser (
core/plugins/mcpparser/plugin.go:187,:203,:226,:241) —session terminate,transport stream,body is not valid JSON-RPC,not an MCP-namespace method - opa (
core/plugins/opa/plugin.go:441,:493) —decision error on request,decision error on response - sparc (
core/plugins/sparc/plugin.go:427,:431,:450) —reflector unavailable, failing open,reflector unavailable, failing closed,no inference context to ground against - token-exchange-aiac (
core/plugins/tokenexchangeaiac/plugin.go:414,:418,:424,:458,:462) —audience exists but is not granted to this workload,the destination's client is disabled,token exchange failed(twice),host in another namespace names a target
Status
CodeQL reports only flows that pass through lines a PR changes, so any PR that edits code on a path to one of these sites will raise the alert. #1612 and #1533 had the same problem in the listeners and the session store. Found in review of #1616.
Fix
Wrap each value in pipeline.SanitizeLogValue, the helper #1616 added, which CodeQL recognizes as a log-injection sanitizer. Done when a PR that touches these log lines raises no go/log-injection alerts.
- Lenguaje dominante
- Go
- Estrellas
- 23
- Forks
- 44
- Merge medio
- 16 h 3 min
- PR fusionados (30 d)
- 248
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 rossoctl/cortex
-
UI shows costs for all sessions even when drilled into a sessionPosiblemente ocupada @esnible la tomó hace 21 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
rossoctl/cortex#1116 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
feedback laptop
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
Los mantenedores suelen responder en 1 día
-
chore: Remove the decline_responses_websockets translation after a deprecation releasePosiblemente ocupada @Alan-Cha la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
rossoctl/cortex#1625 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug: A config reload stops the old pipeline while requests are still using itPosiblemente ocupada @evaline-ju la tomó hoy. Abiertobug
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 Más de una semana Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
Todos los issues de rossoctl/cortex
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
masahitojp/mariamem#108 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Pod detail shows CPU usage ten times too high, and throws on decimal memory suffixesPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 11 días
-
tsuru_app_cname and tsuru_app_router don't handle removal outside terraformPosiblemente ocupada @lbarrosby la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
contributor-friendly good-first-issue lang:go
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
irbis-sh/zen-desktop#870 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día