secubox-deb/packages/secubox-users
CyberMind-FR 6f8a04fcad fix(users): stop leaking password hashes and TOTP secrets to any client
GET /api/v1/users/users, /user/{username} and /export returned raw records
from users.json, which holds the argon2id password hash, the TOTP *secret*,
and the argon2id hashes of the TOTP backup codes.

All three routes are gated by `require_jwt` — ANY authenticated account, not
just an admin — so the lowest-privilege user could harvest every other
account's credentials. The TOTP secret alone lets an attacker mint valid
6-digit codes forever: a complete MFA bypass. This is a privilege-escalation
vector on a product whose own charter forbids secrets in clear.

/export was the worst: its comment said "Remove sensitive data" while dropping
only `provision_results`. A comment asserting a guarantee the code does not
provide is worse than no comment — it stops reviewers from looking.

Add redact_user() as the single place that decides what a client may see, and
route all three through it. `totp` is kept but reduced to its non-secret
metadata, and its PRESENCE is preserved: the webui shows the MFA badge on a
truthiness test (`u.totp_enabled || u.totp || u.mfa_enabled`), so dropping the
key would blank the badge and always emitting one would light it up for users
who never enrolled.

It lives in its own module rather than main.py because main.py reads the config
at import, so importing it requires read access to /etc/secubox/secubox.conf —
a security rule must stay testable without privileges.

Verified live on gk2 across all three routes: no argon2 hash, no TOTP secret,
no backup codes; totp_enabled still correct per account (admin true, gk2 and
operator false). Mutation-checked: restoring the passthrough fails 5 of the 9
tests.

Co-Authored-By: Gerald KERMA <devel@cybermind.fr>
2026-07-17 12:58:38 +02:00
..
api fix(users): stop leaking password hashes and TOTP secrets to any client 2026-07-17 12:58:38 +02:00
debian feat(auth): webui-toggleable admin-TOTP requirement (default off) + per-user 2FA reset 2026-07-11 06:52:56 +02:00
menu.d
nginx
sbin
schema
share
tests fix(users): stop leaking password hashes and TOTP secrets to any client 2026-07-17 12:58:38 +02:00
www/users feat(auth): webui-toggleable admin-TOTP requirement (default off) + per-user 2FA reset 2026-07-11 06:52:56 +02:00
README.md

👥 User Management

Unified identity management

Category: Access

Screenshot

User Management

Features

  • User CRUD
  • Groups
  • Service provisioning
  • RBAC

Installation

# Add SecuBox repository
curl -fsSL https://apt.secubox.in/install.sh | sudo bash

# Install package
sudo apt install secubox-users

Configuration

Configuration file: /etc/secubox/users.toml

API Endpoints

  • GET /api/v1/users/status - Module status
  • GET /api/v1/users/health - Health check

License

LicenseRef-CMSD-1.0 (Source-Disclosed License) — CyberMind © 2024-2026. See LICENCE-CMSD-1.0.md.