Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(RHEL-35665) CVE-2023-26604 systemd: privilege escalation via the less pager #153

Merged
merged 2 commits into from
Jul 23, 2024

Commits on Jul 18, 2024

  1. pager: set $LESSSECURE whenver we invoke a pager

    Some extra safety when invoked via "sudo". With this we address a
    genuine design flaw of sudo, and we shouldn't need to deal with this.
    But it's still a good idea to disable this surface given how exotic it
    is.
    
    Prompted by #5666
    
    (cherry picked from commit 612ebf6)
    
    Related: RHEL-35665
    poettering authored and brozs committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    6e14037 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. pager: make pager secure when under euid is changed or explicitly req…

    …uested
    
    The variable is renamed to SYSTEMD_PAGERSECURE (because it's not just about
    less now), and we automatically enable secure mode in certain cases, but not
    otherwise.
    
    This approach is more nuanced, but should provide a better experience for
    users:
    
    - Previusly we would set LESSSECURE=1 and trust the pager to make use of
      it. But this has an effect only on less. We need to not start pagers which
      are insecure when in secure mode. In particular more is like that and is a
      very popular pager.
    
    - We don't enable secure mode always, which means that those other pagers can
      reasonably used.
    
    - We do the right thing by default, but the user has ultimate control by
      setting SYSTEMD_PAGERSECURE.
    
    Fixes #5666.
    
    v2:
    - also check $PKEXEC_UID
    
    v3:
    - use 'sd_pid_get_owner_uid() != geteuid()' as the condition
    
    Based on: 0a42426
    
    rhel-only
    
    Resolves: RHEL-35665
    keszybz authored and brozs committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    a85b8ca View commit details
    Browse the repository at this point in the history