Skip to content

fix(security): restrict biometric model file permissions to root-only#1106

Open
RedEye1605 wants to merge 1 commit into
boltgolt:masterfrom
RedEye1605:fix/insecure-model-permissions
Open

fix(security): restrict biometric model file permissions to root-only#1106
RedEye1605 wants to merge 1 commit into
boltgolt:masterfrom
RedEye1605:fix/insecure-model-permissions

Conversation

@RedEye1605
Copy link
Copy Markdown

I noticed that face model files are created world-readable (644) under /etc/howdy/models, which means any unprivileged user on the system can read biometric embedding vectors. This was reported in #1098.

The root cause is twofold:

  1. os.makedirs() in add.py doesn't specify mode, so it inherits the default (usually 755)
  2. The postinst script does chmod 755 -R /etc/howdy/ which explicitly makes models world-readable

What this changes:

  • add.py — create the models directory with mode=0o700 and os.chmod() the model file to 0o600 after writing
  • remove.py — maintain 0o600 permissions after rewriting the model file
  • postinst — after the broad chmod 755, explicitly restrict the models directory to 0o700 and all model files to 0o600

The PAM authentication stack runs as root, so this doesn't affect normal operation. Only root can now read the biometric data.

Tested on Fedora 43 with howdy-git — howdy add creates files with -rw------- and the directory is drwx------.

Closes #1098

Face model files (.dat) in /etc/howdy/models contain sensitive biometric
data (face embedding vectors) but are created with world-readable 644
permissions, and the models directory itself is 755. Any unprivileged user
or process can read these models.

Changes:
- add.py: create models directory with mode 0o700, chmod model file to
  0o600 after write
- remove.py: maintain 0o600 permissions after rewriting model file
- postinst: chmod existing models dir to 0o700 and all .dat files to
  0o600 after the broad chmod 755 on /etc/howdy

This ensures only root (and the PAM stack running as root) can access
biometric data, following the principle of least privilege.

Closes boltgolt#1098
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.

Security: Insecure default permissions (644) for face model files in /etc/howdy/models

1 participant