Chained GORM conditions on a pinned connection can leak into the next query
Los mantenedores suelen responder en 1 día
@Wikid82 ya está trabajando en esto.
Desde el 3/12/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
What: a function that runs more than one query on a pinned *gorm.DB connection (for example the single-connection migration path, backend/internal/api/routes/migrate.go) can have conditions from one query carry into the next, because GORM builds on the receiver's existing statement unless a fresh session is started. This was hit while writing services.KeepManagementCountryListsExcludingLocal (added in PR closing #1895/#1980): a follow-up query on the same pinned connection picked up a leftover key = ? condition from an earlier, unrelated query and failed with "no such column: uuid". The fix there was to start each query from conn.Session(&gorm.Session{NewDB: true}).
Where: any function that chains more than one top-level query call against a single pinned connection, including other migration-path or management-access helpers in backend/internal/services/management_access.go (for example ManagementListUUIDs, if called more than once from the same pinned connection without an intervening fresh session).
Suggested approach: audit callers that reuse a pinned connection across more than one query and have them call .Session(&gorm.Session{NewDB: true}) (or an equivalent fresh-statement pattern) before each independent query, rather than relying on the caller never chaining unrelated conditions.
Severity: low (correctness/reliability only, no data exposure — surfaces as a query failure, not a wrong result returned to a caller).
Found during B8-05 implementation.
- Lenguaje dominante
- Go
- Estrellas
- 17
- Forks
- 2
- Merge medio
- 1 h 42 min
- PR fusionados (30 d)
- 173
Preparar el entorno
- 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 Wikid82/Charon
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Docs promise signed SLSA provenance that the image build does not producePosiblemente ocupada @Wikid82 la tomó hoy. Abiertoarchitecture documentation security ui
Wikid82/Charon#2152 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Orthrus agent images are not signed or SBOM-attestedPosiblemente ocupada @Wikid82 la tomó hoy. Abiertosecurity ssl testing
Wikid82/Charon#2151 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Registry prune deletes release image signatures and SBOM attestations on GHCR after 7 daysPosiblemente ocupada @Wikid82 la tomó hoy. Abiertocritical testing
Wikid82/Charon#2150 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Minor follow-ups from the country-allow-list local-network reviewPosiblemente ocupada @Wikid82 la tomó hoy. Abiertoarchitecture backend documentation frontend low
Wikid82/Charon#2149 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de Wikid82/Charon
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
agent:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
turbot/flowpipe#1162 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
LifetimeRemaining divides by zero when expireAfter is 0s, producing NaN disruption costsPosiblemente ocupada @weirong-ui la tomó hoy. Abiertokind/bug needs-priority needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kubernetes-sigs/karpenter#3728 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
compaction: redundant exclusion checks after inRangePosiblemente ocupada @moodbased la tomó hoy. Abierto
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 78/100
docker/mcp-registry#8199 ·
Los mantenedores suelen responder en 2 días