Codebase review: high-priority security, reliability, maintainability, and bloat findings
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 15/100
Línea de trabajo
Start with the concrete references in src/webserver/oidc.rs, src/webserver/database/sqlpage_functions/functions.rs, src/webserver/http.rs, src/filesystem.rs, and src/render.rs; read the relevant sections alongside the proposed execution plan. Run the applicable tests and cargo audit to establish current behavior. This issue spans security, dependency remediation, HTTP semantics, stability, and refactoring, so its completion criteria need to be narrowed into focused follow-up work.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
- A deep review of the current codebase found several high-impact issues across security, reliability, maintainability, and code bloat/duplication. This issue tracks the highest-priority items with concrete references.
High priority
1) Sensitive auth/material is logged in plaintext (token/cookie/response leakage)
Current code logs OIDC secrets and arbitrary HTTP response bodies:
- OIDC access token secret log
- OIDC auth cookie (ID token) log
- OIDC ID token verification log
- OIDC raw HTTP response body log
- OIDC token response object log
-
sqlpage.fetchraw response body log
Why this matters:
- Tokens and identity claims can leak into logs and downstream observability pipelines.
- Any log access then becomes auth/session compromise risk.
Suggested fix:
- Never log token/cookie values or raw OIDC responses.
- Redact or hash sensitive values (
[REDACTED]). - Keep only metadata: status code, endpoint host/path class, payload size, elapsed time.
2) Dependency security advisories in lockfile/dependency graph
cargo audit reports:
-
RUSTSEC-2023-0071onrsa 0.9.10(Marvin timing side-channel) - Unmaintained warnings:
-
RUSTSEC-2024-0436(paste 1.0.15) -
RUSTSEC-2025-0134(rustls-pemfile 2.2.0)
-
Dependency entrypoints:
Why this matters:
- Security debt accumulates in auth and DB-critical dependency paths.
Suggested fix:
- Plan migration away from
sqlx-oldapi 0.6.xline to maintained upstream. - Re-resolve OIDC stack and lockfile to versions without advisory hits when available.
- Add
cargo audit(or equivalent) to CI as informational gate at minimum.
Medium priority
3) Incorrect HTTP caching semantics for static files
Why this matters:
- Weak/incorrect cache validation and inconsistent behavior between local FS and DB-backed FS.
- Causes unnecessary cache misses and confusing revalidation behavior.
Suggested fix:
- Set
Last-Modifiedfrom actual source mtime (or omit if unknown). - Align local/db modified comparison semantics (
>vs>=) to one consistent contract.
4) 404 fallback behavior returns 200 for custom 404.sql
Why this matters:
- API clients, crawlers, and monitoring receive incorrect status codes for missing resources.
Suggested fix:
- Preserve the custom body but set status code to
404for custom not-found handlers.
5) Crash/panic edges in request path and response finalization
Why this matters:
- A panic in request handling can take down worker tasks and create unstable behavior under malformed edge inputs.
Suggested fix:
- Replace
unwrap()with structured error propagation and explicit400/500mapping.
Maintainability / bloat / duplication
6) Very large multi-responsibility modules increase change risk
Key files:
-
src/webserver/database/sql.rs -
src/webserver/oidc.rs -
src/render.rs -
src/webserver/database/sqlpage_functions/functions.rs -
src/app_config.rs
Also note duplicated fetch pipelines:
Why this matters:
- High cognitive load, difficult reviews, and increased regression risk.
Suggested fix:
- Split by responsibility boundaries (parsing/rewrite/validation/execution; OIDC callback/logout/token; renderer header/body/format adapters).
- Extract shared HTTP fetch execution into one reusable helper returning a structured internal response object.
Proposed execution plan
- Security patch pass
- Remove/redact sensitive logs in OIDC + fetch paths.
- Add regression tests asserting no token value appears in logs for auth flow failures.
- HTTP correctness pass
- Fix
Last-Modifiedsource and local/db comparison contract. - Return proper 404 status for custom 404 handlers.
- Fix
- Stability pass
- Eliminate production
unwrap()in request/response hot paths.
- Eliminate production
- Dependency/risk pass
- Open follow-up migration issue for
sqlx-oldapiand dependency audit remediation.
- Open follow-up migration issue for
- Refactor pass
- Break down oversized files and deduplicate fetch logic with targeted tests.
- Lenguaje dominante
- Rust
- Estrellas
- 2.6k
- Forks
- 175
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 43
Preparar el entorno
- Incluye un Dockerfile o un 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 sqlpage/SQLPage
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
sqlpage/SQLPage#1218 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
There is no convenient way to reproduce issuesPosiblemente ocupada @81reap la tomó hace 26 días. Abiertoenhancement
sqlpage/SQLPage#1566 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Confusing sort interfacePosiblemente ocupada @lovasoa la tomó hace 73 días. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
sqlpage/SQLPage#1442 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Mutation Testing Results :: Dead Code + Missing TestsQuizá libre de nuevo @81reap la tomó hace 61 días y no hay ningún pull request abierto. Abierto
sqlpage/SQLPage#1396 · 5 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de sqlpage/SQLPage
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
symposium-dev/symposium#530 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
topgrade-rs/topgrade#2540 ·
Los mantenedores suelen responder en 1 día
-
Invalid JSON options for ngram and edge_ngram silently use defaultsPosiblemente ocupada @Tilendlesa la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
noemaforge/vimanam#153 ·
Los mantenedores suelen responder en 1 día