Skip to content

7.4 update: security hardening, #44/#61/#93, Ubuntu 26.04 compat#94

Open
hermanntoast wants to merge 9 commits into
masterfrom
feat/lmn74-security-and-compat
Open

7.4 update: security hardening, #44/#61/#93, Ubuntu 26.04 compat#94
hermanntoast wants to merge 9 commits into
masterfrom
feat/lmn74-security-and-compat

Conversation

@hermanntoast

@hermanntoast hermanntoast commented Jul 23, 2026

Copy link
Copy Markdown

Overview

Collected 7.4 (lmn74) update bundling a security audit follow-up, two open bug fixes, one open PR, and Ubuntu 26.04 / Samba 4.2x compatibility. Version bumped to 7.4.0 lmn74.

Security fixes

The sudoTools helper is callable NOPASSWD by every member of domain users (see etc/sudoers.d/99-linuxmuster-linuxclient7), so its arguments are an unprivileged→root trust boundary.

  1. Path traversal / arbitrary CIFS mount as root (critical). mount-share --name flowed unvalidated into the mountpoint (/home/{user}/media/{name}), so --name ../../../.. escaped the per-user base and let any domain user mkdir as root and mount an attacker-controlled SMB server at an arbitrary path. shares._mountShare() now validates the network path and share name and confirms the resolved mountpoint stays inside the user's base dir. Also fixes the mount-share success check (the old if tuple: was always truthy).
  2. install-printer argument injection. Restricted device-uri schemes to a safe allow-list (notably rejecting file://, which would let a domain user write to any file as root) and validated the printer name.
  3. LDAP filter injection. Usernames, hostnames and policy names were interpolated into LDAP filters via f-strings without escaping. All values now go through ldap.filter.escape_filter_chars().

Bug fixes

Incorporated PR

Ubuntu 26.04 / Samba 4.2x compatibility

  • Dropped the deprecated client use spnego smb.conf option (SPNEGO is always used in modern Samba; the option triggers warnings).
  • Made SSSD version parsing tolerant of packaging suffixes (e.g. 2.10.0-1ubuntu1) so the krb5_child capability check keeps working.
  • The mount.cifs timeout above also hardens boot on new stacks.

⚠️ The Ubuntu 26.04 changes are based on the current Samba deprecation state and were not validated on a live 26.04 client. Please smoke-test a real domain join + login on 26.04 before release.

Tests

make tests110 passed (99 previously + 11 new covering the validation, LDAP escaping, timeout and version-parsing paths).

Usernames, hostnames and policy names were embedded into LDAP filters via
f-strings without escaping, allowing LDAP filter injection through crafted
AD principal names. All values now go through ldap.filter.escape_filter_chars().
sudoTools is callable NOPASSWD by any member of 'domain users' and forwards
the --path and --name arguments into shares._mountShare() as root. The share
name was used unvalidated to build the mountpoint, so '--name ../../..' could
escape the per-user base dir and mount an attacker-controlled server to an
arbitrary location (root mkdir + mount.cifs). _mountShare() now validates the
network path and share name and verifies the resolved mountpoint stays inside
the user's base directory. Also fixes the sudoTools mount-share success check
(a (False, None) tuple is truthy) and wraps mount.cifs in 'timeout' so an
unreachable server cannot hang boot/login (part of #61).
… paths (#93)

install-printer (reachable as root via sudoTools by any domain user) now
rejects unsafe device-uri schemes (notably file://, which would allow writing
to an arbitrary file as root) and invalid printer names. Additionally resolve
lpadmin/lpstat to absolute paths so printers are still uninstalled on logout,
where the PAM environment only provides PATH=/bin:/usr/bin (#93).
…le (#61)

pullKerberosTicketForComputerAccount() gained an optional timeout, and onBoot
now pulls the ticket with a 5s timeout. Together with the mount.cifs timeout,
an unreachable domain controller / sysvol no longer stalls the boot process.
Drop the deprecated 'client use spnego' smb.conf option (SPNEGO is always used
in modern Samba and the option triggers warnings), and make SSSD version
parsing tolerant of packaging suffixes (e.g. '2.10.0-1ubuntu1') so the
krb5_child capability check keeps working on newer distributions.
New homes are created mode 0700 so users can no longer read each other's data
via an explicit path. Incorporates PR #44 by dorianim.
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.09%. Comparing base (5181369) to head (5cf4b86).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   61.82%   65.09%   +3.26%     
==========================================
  Files          18       18              
  Lines        1548     1607      +59     
==========================================
+ Hits          957     1046      +89     
+ Misses        591      561      -30     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hermanntoast
hermanntoast marked this pull request as draft July 23, 2026 10:39
Version scheme switched to 7.4.x so the linuxmuster (lmn) version is obvious
from the package version.
@hermanntoast
hermanntoast force-pushed the feat/lmn74-security-and-compat branch from a32ba1f to 3152362 Compare July 23, 2026 10:40
@hermanntoast

Copy link
Copy Markdown
Author

🧪 Live test on real hardware — Ubuntu 26.04 LTS against linuxmuster.net 7.4

This branch was built into a 7.4.0 package, installed on a real client, and fully tested end-to-end against a linuxmuster.net 7.4 server.

Test environment

  • linuxmuster.net 7.4 server (domain join against the real AD)
  • Ubuntu 26.04 LTS client (Kernel 7.0), Python 3.14.4
  • Samba 4.23.6, SSSD 2.12.0

Installation & compatibility

Test Result
Package 7.4.0 installed incl. all dependencies
All Python core modules import under Python 3.14 ✅ no breakage
setup — domain join against Samba 4.23 ✅ successful
sysvol mount (timeout … mount.cifs … vers=3.0) ✅ "Success"
status → "fully setup and working"
Live /etc/samba/smb.conf: no active client use spnego ✅ Samba 4.x compatible

AD login (one fresh user per role)

Test Student Teacher Staff
Login / Kerberos auth
Home freshly created with 0700 (umask=077, #44)
Role-based share mounts (sec=krb5) ✅ (incl. students' homes)
Login hooks incl. remote logon.sh
Access to sudoTools via %domain users

Side note: the new staff role (linuxmuster 7.4) is a member of domain users and can use sudoTools without a dedicated sudoers entry — a %role-staff line is not required.

Printer logout (#93)

Test Result
Uninstall on logout under reduced PATH=/bin:/usr/bin ✅ via absolute /usr/sbin/lpadmin

Security fixes (verified on the real machine)

Attack Result
Path traversal via --name (root mkdir/mount at arbitrary location) ✅ rejected, no directory created
Traversal network path ✅ rejected
install-printer file:// (write to arbitrary file as root) ✅ rejected
Malicious printer name ✅ rejected
LDAP escaping via python-ldap (*\2a)
sudoers valid (visudo -cf = parsed OK)

Conclusion: On Ubuntu 26.04 with Samba 4.23, the 7.4.0 client works fully against a linuxmuster.net 7.4 server — domain join, AD login (student/teacher/staff), shares, hooks and printers all function, and every security fix holds up live.

@hermanntoast
hermanntoast marked this pull request as ready for review July 24, 2026 09:34
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