You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prevent path traversal (../) in create-profile, select, and backup commands(CWE-22) #471
Date: 26 August 2026 Reporter: Sandipan Roy (Red Hat)
Summary
Profile IDs, backup names, and create-profile names are concatenated as dir + "/" + name in several places without rejecting path separators (/) or parent-directory components (..). This allows a root operator to accidentally (or intentionally) write outside the intended profile/backup directories.
Because all mutating authselect commands already gate on getuid() == 0 and the binary is not setuid, this is not a privilege escalation — root can already rewrite PAM and rm -rf /. It is a defense-in-depth / input-validation hardening issue (CWE-22).
Affected code paths
Tested on authselect 1.8.0 (6bd0e16).
1. authselect create-profile
The name argument is used directly in path construction for the custom profile directory under /etc/authselect/custom/. A name like ../../tmp/evil would resolve to /etc/tmp/evil (or higher depending on depth).
2. authselect select (custom profile ID)
A custom profile ID containing ../ can escape the custom profile directory when building the lookup path.
Backup names are concatenated into the backup directory path. A name containing ../ can reference (and potentially create or delete) directories outside the backup tree.
Reproduction
# All commands require root — this is NOT a privilege escalation.# It demonstrates the path is not validated.
sudo authselect create-profile '../../tmp/authselect-traversal-test' \
--base-on sssd 2>&1# Creates /etc/tmp/authselect-traversal-test/ (or errors depending# on intermediate dirs) instead of refusing the name.# Cleanup
sudo rm -rf /etc/tmp/authselect-traversal-test
Classification
CWE: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)
Activity