Skip to content

fix(security): registrar decisiones de autorización y sacar los valores SQL del log - #24

Merged
bpstack merged 1 commit into
claude/compassionate-planck-gh6aoffrom
opencode/fix-logging
Oct 12, 2026
Merged

bpstack merged 1 commit into
claude/compassionate-planck-gh6aoffrom
opencode/fix-logging

Conversation

@bpstack

@bpstack bpstack commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Cambios

  • Cada 403 deja una línea access_denied (usuario, rol y ruta); también los accesos de admin a conversaciones ajenas.
  • Los errores de mysql2 ya no llevan al log el SQL ni los valores; los secretos se tapan a tres niveles de profundidad.

Por qué

Los 403 no se registraban y los errores de BD escribían en el log los valores de las consultas.

… the log

- Log every 403 the API answers (user, role, method and path without the
  query string) from one middleware before the routes.
- Log each time an admin reads, lists or deletes conversations or messages
  they are not in.
- Hide err.sql, and passwords and tokens at the first three levels of each
  entry instead of only the second.
- Document what the log keeps, and that failed logins keep the typed
  username (owner's decision).

No 403 left a trace, nor did an admin reading conversations of others
(ASVS 7.2). The SQL of a failed db.query carries its values interpolated, and
`*.password` missed req.body.password and a top-level password.
@bpstack
bpstack merged commit fdb264e into claude/compassionate-planck-gh6aof Oct 12, 2026
4 checks passed
@vercel

vercel Bot commented Oct 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
four-points Ready Ready Preview Oct 12, 2026 6:53pm UTC

This branch was successfully deployed

1 active deployment
Preview — 18d71fe4 Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant