Skip to content

systemd-coredump: privacy enhancement: store core dumps in a per-user directory, make coredumpctl work on a per-user basis #20848

Open

Description

@pabs3

Is your feature request related to a problem? Please describe.

I recently switched from a different core dump handler to systemd-coredump and I noticed that it leaks information about core dumps across user boundaries. The core dumps are all stored in one directory /var/lib/systemd/coredump so any user can read the metadata stored in the core dump filenames. The coredumpctl command also lists and prints info for core dumps from any user. The core dump itself is of course inaccessible, but some of the metadata could be private information and the fact that a particular application crashed could be useful information when trying to break into another user account.

Describe the solution you'd like

  • Have systemd-coredump listen for user logins from logind and create directories named after the uid under /var/lib/systemd/coredump, so that the existence of the per-uid directory doesn't leak information about whether a crash has happened or not.
  • Set permissions on /var/lib/systemd/coredump so that the size/blocks of each per-uid subdirectory cannot leak information about whether a crash has happened or not.
  • When a crash happens, store the core dump and other data for the crash under the per-uid directory.
  • Store the core dump metadata retrieved by coredumpctl such that each user only has access to metadata for their own core dumps.

Describe alternatives you've considered

Avoid using systemd-coredump on multi-user systems where crash metadata leakage could be problematic.

The systemd version you checked that didn't have the feature you are asking for
249.4

Activity

  1. poettering commented on Sep 29, 2021

    @poettering
    Member

    umpf. we only expose external metadata in the coredump, basically information roughly similar to what other users see in "ps" too, i.e. stuff you can mostly see from /proc/ while the process is running. I am not convinced we need stricter controls here.

    Or to say this differently: unless kernels/distros switch to a /proc that hides everyones data i don't really see the point of this request I must say.

  2. pabs3 commented on Sep 29, 2021

    @pabs3
    Author
  3. poettering commented on Sep 29, 2021

    @poettering
    Member

    So system-wide hidepid= doesn't work on general purpose distros, you have stuff such as polkit that needs to be able to look into /proc.

    per-service hidepid= (i.e. ProtectProc=) makes a lot of sense, but it's implemented via mount namespacing. But if you do mount namespacing I'd really hide the whole dir coredump anyway.

  4. pabs3 commented on Sep 30, 2021

    @pabs3
    Author
  5. danielzgtg commented on Oct 27, 2022

    @danielzgtg
    Contributor

    basically information roughly similar to what other users see in "ps" too, i.e. stuff you can mostly see from /proc/ while the process is running. I am not convinced we need stricter controls here.

    This ignores forward secrecy regardless of and separate from procfs' hidepid. If a program crashes at one moment in the past leaving a crashdump, another user 1 second in the future should not be able to see the program name in the present. Even if they are authorized to see the program names in general, they might have not been authorized to log in at the previous time.

    Therefore to fix forward secrecy, we need to implement this. How about ~/.local/lib/systemd/coredump or $XDG_RUNTIME_DIR/lib/systemd/coredump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestcoredump

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions