mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 00:08:34 +02:00
[GH-ISSUE #1219] [Bug]: On a default Docker install, MFA_ENCRYPTION_KEY is not set #887
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy-maziggy-1#887
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @maziggy on GitHub (May 6, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1219
Originally assigned to: @netscout2001 on GitHub.
Component
Bambuddy
Bug Description
On a default Docker install, MFA_ENCRYPTION_KEY is not set, so:
The encryption module (backend/app/core/encryption.py) emits a single WARNING log line at startup pointing this out, but the warning is not surfaced anywhere a user is likely to see it. Setup wizards, the Settings UI, and the docker-compose template do not mention MFA_ENCRYPTION_KEY at all, so an admin who wires up OIDC and asks users to enroll TOTP can reasonably believe those secrets are protected at rest when in fact they are not.
This is a meaningful security degradation for any install that uses either feature. Users actively using OIDC SSO are the most likely to be affected because the OIDC client_secret is directly disclosable from the SQLite database without any decryption step.
Expected Behavior
In a current Docker deployment (v0.2.4b3, support bundle attached on a separate ticket), the warning fires on every startup:
WARNING [backend.app.core.encryption] MFA_ENCRYPTION_KEY is not set — TOTP secrets and OIDC client_secrets are stored in plaintext.
The same install has active POST /api/v1/auth/oidc/exchange traffic in the access log, confirming OIDC is in use against an unencrypted client_secret column.
Steps to Reproduce
.
Printer Model
None
Bambuddy Version
0.2.3.2 and up
SpoolBuddy Version
No response
Printer Firmware Version
No response
Installation Method
Docker
Operating System
Linux (Ubuntu/Debian)
Relevant Logs / Support Package
No response
Screenshots
No response
Additional Context
Migration considerations
Legacy plaintext rows must keep working when a key is later configured — the current mfa_decrypt path already handles this (no fernet: prefix → returned as-is). So auto-bootstrap is non-breaking for existing installs: the key gets generated, new writes are encrypted, old reads still work, and the UI can prompt for re-enrollment to migrate.
Key rotation is a separate (harder) problem and is out of scope here — the current code raises on rotation, which is fine until someone asks for it.
Severity / impact
Checklist