Transcript

Image of a man pointing a gun at his own foot.

Caption: Installing an AUR package without reading it’s PKGBUILD.

  • MalReynolds@slrpnk.net
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 days ago

    If possible do it in a distrobox and down networking before running, yes that won’t stop the curl | sh in the install, but at least you can blow it away without hurting your main install and it will likely infect only the distrobox. Bonus points for an immutable main OS.

    As the whole supply chain attack vector gets more sophisticated, and probably subtler in effect, these are going to be harder and harder to spot and likely start making it into main repos. Keep sharp people.

    Not real fun for a linuxmemes post, but I think it needs saying.

    • N.E.P.T.R@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 days ago

      Distrobox is not an isolated environment, it is quite the opposite. They say so themselves on their page:

      Security implications

      Isolation and sandboxing are not the main aims of the project, on the contrary it aims to tightly integrate the container with the host. The container will have complete access to your home, pen drive, and so on, so do not expect it to be highly sandboxed like a plain docker/podman container or a Flatpak.

      I would argue that Docker isn’t a good way to stop malware either, since it is highly vulnerable to sandbox escape leveraging the shared host-guest kernel, like the many of LPEs that have been found in the last few months (example using copy-fail).

      Docker is not a secure sandbox, Podman is not a secure sandbox, Flatpak is not a secure sandbox. Use a VM, or better yet, don’t use the AUR.

        • N.E.P.T.R@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          2
          ·
          17 hours ago

          Things sandboxed by Firejail share the same host kernel. Therefore, kernel vulnerabilities could allow for privilege escalation.

          Firejail itself is a security-hole. It is a massive root SetUID binary which can and has been used for privilege escalation. I avoid it entirely. Unprivileged sandboxes are better, but lack the built-in profiles provided by Firejail.

          If I was trying to sandbox malware, I would use sydbox. It is memory safe (unlike Firejail or Bubblewrap), unprivileged (unlike Firejail), secure sandbox by default (unlike Bubblewrap), extensively uses all relevant Linux security features/modules (more than any other), and actually helps to stop LPE by re-implementing or denying dangerous syscalls like in the case of many of the recent vulnerabilities. Biggest caveat is that it’s not for beginners, even though it abstracts a lot of the complexity. I’d also neverbrun malware in just a sandbox, but use that alongside a proper VM.

          TL;DR No sandbox will save you from good malware. Firejail might be enough for script kiddies, but could make your system more vulnerable to privilege escalation attacks. Avoid installing things you don’t need.

      • MalReynolds@slrpnk.net
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        Distrobox is not an isolated environment

        True, you’ll note I didn’t say it is sandboxed or isolated, but it is a different environment. Paths that point to normal things like /usr etc. will be in the distrobox environment. That said, unless you use a custom home for the distrobox (you should anyway), your home directory is hosed. At this point I expect the malware to not be distrobox aware and use things like distrobox-host-exec, that may change.

        A VM is absolutely a better approach, if significantly more frictional.

        • N.E.P.T.R@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 day ago

          You don’t need to say the words “sandboxed” or “isolated” to say effectively the same thing. Your goal with distrobox was to keep the AUR malware separate from your normal system, no?

          Security through obscurity is not security. The malware can do the same data exfiltration regardless of root access because the AUR malware has been about stealing secrets in user-readable directories. Setting a custom home for distrobox does not disallow access to the normal one.

          Say for example that your default user home is /home/user and you set the distrobox home to /tmp/home

          If you run ls $HOME inside distrobox it will list files in /tmp/home, but just as easily you could run ls /home/$USER and it would list in your default home. Or alternatively just use the find command and steal secrets without targeting the user home.

          This is because changing the user home through distrobox doesn’t do anything about preventing directory traversal to your default home.

          If your goal is to create a different environment and you don’t care that it won’t stop malware, use Incus or Podman directly. Distrobox is the wrong choice.

          My point was simple: when dealing with malware, distrobox is not an effective method of creating a “different environment” because that is antithetical to its stated goals.

          You can do whatever you want, I am not here to police your choice on your personal system. I only take issue with recommending this strategy to others.

    • MonkderVierte@lemmy.zip
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Btw, login uses /bin/sh (or respective), script headers also, all fixed paths; would anything break, if you do alias sh=echo in your session setup script?