Transcript

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

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

    • Jesus_666@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      If you want a bunch of stuff that’s not in core or extra and you don’t want to intensely babysit the AUR, you could try Chaotic-AUR. It hosts prebuilt packages for a bunch of AUR packages which are actively maintained by the Chaotic team.

      I consider it to be more secure than the AUR proper since they actually care for their packages and review nontrivial changes. For instance, the recent takeover attacks didn’t hit Chaotic-AUR builds since the changed packages didn’t make it past the review.

      It’s still an unofficial third-party repository and closer to the AUR than to extra but I consider it a major step up.

    • Azzu@leminal.space
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      I mean how often do you install AUR packages? Usually takes like a minute or so to skim through PKGbuild and the pkg comments and look for obvious issues. And most updates are just a sha hash and version change, taking like 5s to check.

  • Digit@lemmy.today
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 months ago

    I realised…

    I wasn’t going to do that.

    And I was only using Artix for the AUR.

    So I stopped using Artix.

    Not responsible enough.

    Responsible enough to stop.

  • MalReynolds@slrpnk.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months 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
      1
      ·
      2 months 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.

      • MalReynolds@slrpnk.net
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months 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
          1
          ·
          2 months 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.

  • KernelTale@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    If it’s endorsed by the project team I might as well. At that point it’s the same as downloading from GitHub and if I am in AUR I’ve probably not found it in standard repos nor flathub.

    • printf("%s", name);@piefed.blahaj.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 months ago

      This video taught me a lot.

      Check the list of dependencies. If you really want to vet the package, look through all of the dependencies listed and read their package descriptions on their source page (github, gitlab, codeberg, whathaveyou). Check also the URL, from which makepkg (or yay or whatever) is going to pull some of the data. Is the URL legit?

      PKGBUILD of localsend
      # Maintainer: NourEddineX  
      # Contributor: Nixuge  
      # Contributor: Noah Vogt <noah@noahvogt.com>  
      # Contributor: SpieringsAE (aarch64 addition)  
      
      # Note: 
      # using the .deb instead of the .tar.gz as it already contains the icons as well as the .desktop file.  
      
      pkgname=localsend-bin  
      pkgver=1.18.0  
      pkgrel=1  
      pkgdesc='An open source cross-platform alternative to AirDrop'  
      
      LOOK HERE  
      url=https://github.com/localsend/LOCALSEND  
      LOOK HERE  
      
      arch=('x86_64' 'aarch64')  
      license=(Apache-2.0)  
      
      LOOK HERE  
      depends=(fuse2 xdg-user-dirs libayatana-appindicator)  
      LOOK HERE  
      
      conflicts=('localsend')  
      provides=('localsend')  
      options=(!debug)  
      source_x86_64=("${url}/releases/download/v${pkgver}/LocalSend-${pkgver}-linux-x86-64.deb")  
      source_aarch64=("${url}/releases/download/v${pkgver}/LocalSend-${pkgver}-linux-arm-64.deb")  
      sha256sums_x86_64=('dae68192ad43a59a68df06454eb5fa4e9a9f86a343fe430165efd8b18863d0f4')  
      sha256sums_aarch64=('eb24e724fbdf830c8fb07dfc66b76b8a649923d083278305a63d5d539db4b606')  
      _pkgdesktop="localsend_app.desktop"  
      
      
      prepare() {  
      	tar -xf data.tar.zst  
      }  
      
      build() {  
      	sed -i -E \  
      		"s|Exec=localsend_app|Exec=localsend|" \  
      		"${srcdir}/usr/share/applications/${_pkgdesktop}"  
      
      	# Adjust .desktop to have it point to the correct icon  
      	sed -i -E 's/^Icon=.+/Icon=localsend/' "${srcdir}/usr/share/applications/${_pkgdesktop}"  
      }  
      
      package() {  
      	# Desktop  
      	install -Dm644 "${srcdir}/usr/share/applications/${_pkgdesktop}" "${pkgdir}/usr/share/applications/${pkgname%-*}.desktop" 
      	
      
      	# Icons  
      	install -dm644 "${pkgdir}/usr/share/icons/"  
      	cp -a "${srcdir}/usr/share/icons" "${pkgdir}/usr/share"  
      	# Dirty - rename icons to localsend  
      	for res in "128x128" "256x256"; do  
      		mv "${pkgdir}/usr/share/icons/hicolor/${res}/apps/localsend_app.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/localsend.png"  
      	done  
      
      
      	# Executable  
      	install -dm755 "${pkgdir}/opt/${pkgname%-*}/"  
      	cp -a "${srcdir}/opt/localsend_app/." "${pkgdir}/opt/${pkgname%-*}"  
      	# Same as icons - rename to localsend  
      	mv "${pkgdir}/opt/${pkgname%-*}/localsend_app" "${pkgdir}/opt/${pkgname%-*}/localsend"  
      
      	# Symlink executable  
      	install -dm755 "${pkgdir}/usr/bin"  
      	ln -s \  
      		"/opt/${pkgname%-*}/${pkgname%-*}" \  
      		"${pkgdir}/usr/bin/${pkgname%-*}"  
      }  
      
  • zitrone 🍋@europe.pub
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    just use nix instead

    we have super secure mechanisms in place to prevent supply chain attacks

    /s (nix just hasn’t been targeted yet (as far as we know 💀💀))

    • Euphoma@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      Yeah, I just update all 20 flakes that I sourced from github and pray that none of them were hacked

    • chortle_tortle@mander.xyz
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      /s (nix just hasn’t been targeted yet (as far as we know 💀💀))

      Isn’t the real security through obscurity just being such a fringe market no one bothers? 🤔

  • Kangae_Hishiryo@scribe.disroot.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    I once found a Rust program that streamlined the PKGBUILD reviewing process a lot by, first of all, giving you a really neat list of patterns and behaviours that would make a PKGBUILD suspicios or even plain dangerous, then having a scriptable rule-based engine that would either abort that operation, or show warns and workarounds to you.

    I forgot its name, unfortunately, and I installed it on my previous installation (Garuda, now I’m on CachyOS).

    Very dumb of my part not to try to write that down before the OS change lol.

  • Nalivai@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I’m running Arch daily since 2015, was on Debian before. I install and try a lot of stuff. Never had anything bad happened to me once. Worst case scenario the shit I just installed didn’t work so I have to debug it.
    Not endorsing this apparently dangerous lifestyle, but also a little bit maybe

    • yeehaw@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I get why we need to do this but most people are not programmers either and probably don’t understand wtf they’re looking at.

      While I understand some of what um looking at, when in just trying to get the updates over with its super annoying to review each aur pkgbuild.

      • Nalivai@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        You really don’t need to be a programmer to check for obvious bullshitery, you just need to read like four pages explaining what part means what there.

        • yeehaw@lemmy.ca
          link
          fedilink
          arrow-up
          1
          ·
          2 months ago

          I disagree.

          Picture… I dunno, a plumber. Hates computers but he knows to click the thing to update.

          • Nalivai@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            2 months ago

            Now picture a different, more computer-curious plumber. He doesn’t hate computers, so he reads two pages on a wiki and now can at least spot when the url has changed or when the diff added some new step that wasn’t there before. You don’t need computer science degree to see that there is a new command that weren’t previously, and google that command.