I have a few Linux servers at home that I regularly remote into in order to manage, usually logged into KDE Plasma as root. Usually they just have several command line windows and a file manager open (I personally just find it more convenient to use the command line from a remote desktop instead of directly SSH-ing into the system), but if I have an issue, I’ve just been absentmindedly searching stuff up and trying to find solutions using the preinstalled Firefox instance from within the remote desktop itself, which would also be running as root.

I never even thought to install uBlock Origin on it or anything, but the servers are all configured to use a PiHole instance which blocks the vast majority of ads. However, I do also remember using the browser in my main server to figure out how to set up the PiHole instance in the first place, and that server also happens to be the most important one and is my main NAS.

I never went on any particularly shady websites, but I also don’t remember exactly which websites I’ve been on as root, though I do seem to remember seeing ads during the initial pihole setup, because it didn’t go very smoothly and I was searching up error messages trying to get it to work.

This is definitely on me, but it never crossed my mind until recently that it might be a bad idea to use a browser as root, and searching online everyone just states the general cybersecurity doctrine to never do it (which I’m now realizing I shouldn’t have) but no one seems to be discussing how risky it actually is. Shouldn’t Firefox be sandboxing every website and not allowing anything to access the base system? Between “just stop doing it” and “you have to reinstall the OS right now there’s probably already a virus on there,” how much danger do you suppose I’m in? I’m mainly worried about the security/privacy of my personal data I have stored on the servers. All my servers run Fedora KDE Spin and have Intel processors if that makes a difference?

  • MimicJar@lemmy.world
    link
    fedilink
    arrow-up
    37
    ·
    1 year ago

    https://www.mozilla.org/en-US/security/advisories/mfsa2023-56/

    That’s a link to the most recent release of Firefox and the security vulnerabilities that were fixed.

    You’ll notice the first one listed says, “This issue could allow an attacker to perform remote code execution and sandbox escape.”

    So if you visited a site that exploited that bug, it escaped the sandbox and ran whatever code it wanted to. Since you were running as root it could do anything it wants. Your device is now the property of someone else. Potentially all your data has been stolen. You probably didn’t even notice.

    Now. Realistically. You probably didn’t get exploited. Your device may not be vulnerable to that particular bug. But new bugs are found, and fixed, and created every day. Can you be sure you weren’t exploited?

    Let’s look at it a different way. Think of it like driving a car with no seatbelt or airbags. As long as you don’t crash, you’re fine. The car still works fine without seatbelts and you have more freedom to move your arms around.

    Let’s look at it a different way. Do you ever lock the door to your home/apartment? Heck do you even close the door? Why not leave it wide open?

    At the end of the day security is about layers and the trade offs for convenience. You can run KDE as root, and you can run Firefox as root. You’ll probably be fine. It’s like driving without a seatbelt or leaving your front door wide open, but you can do it. If you do drive with a seatbelt and at least close your front door, you can probably run KDE and Firefox as a regular user.

  • FishFace@lemmy.world
    link
    fedilink
    arrow-up
    22
    ·
    1 year ago

    An overarching principle of security is that of minimum privilege: everything (every process, every person) should have the minimum privileges it needs to do what it does, and where possible, that privilege should be explicitly granted temporarily and then dropped.

    This means that any issue: a security breach or a mistake can’t access or break anything except whatever the component or person who had the issue could access or break, and that that access is minimal.

    Suppose that you hit a page which exploits the https://www.hkcert.org/security-bulletin/mozilla-firefox-remote-code-execution-vulnerability_20230913 vulnerability in Firefox, or one like it, allowing remote code execution. If Firefox is running as root, the remote attacker now completely controls that machine. If you have SSH keys to other servers on there, they are all compromised. Your personal data could be encrypted for ransom. Anything that server manages, such as a TV or smart home equipment, could be manipulated arbitrarily, and possibly destroyed.

    The same is true for any piece of software you use, because this is a general principle. Most distributions I believe don’t let you ssh in as root for that reason.

    In short: don’t log in to anything as root; log in as a regular user and use sudo to temporarily perform administrator actions.

    P.S. your description of the situation shows you don’t know the nature of vulnerabilities and security - if you’re running servers then this is something you should learn more about in short order.

  • taladar@sh.itjust.works
    link
    fedilink
    arrow-up
    20
    ·
    1 year ago

    but no one seems to be discussing how risky it actually is.

    That is because people stopped doing it ages ago.

    But shouldn’t Firefox be sandboxing every website and not allowing anything to access the base system?

    Security is always a matter of layers. Any given layer can fail some of the time but you want to set up your security so situations where all the layers fail together are rare.

  • Falcon@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    I have no clue how dangerous running Firefox as root is, but it begs the question…why would you do that?

    Create a user account for managing things and create a separate user for each service and/or containers.

    For managing things use tmux with ssh, if you want to manage files etc. just use ranger/lf/mc. One can also mount the file system with sshfs.

  • BigTrout75@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    1 year ago

    This is like removing a safety feature in your car. Like removing seatbelts or maybe anti-lock brakes.

  • GustavoM@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    1 year ago

    That’d be the same as asking if leaving your house front door open is dangerous – it depends. If an ill-intended individual sees it open however, s/he won’t think twice to trash your home.

  • hottari@lemmy.ml
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    1 year ago

    You should learn how to use ssh. Running Firefox on top of Xorg is a disaster waiting to happen.

  • danielfgom@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    3
    ·
    1 year ago

    It should be ok because nothing will run on your system without a permission prompt at least. So they that should ring some bells of system is asking for your password when you didn’t try to install anything.

    But best practice would be log in as a regular user and use sudo to do any admin tasks.

  • gnuhaut@lemmy.ml
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    1 year ago

    On a typical home user desktop linux setup, there’s virtually no difference between your regular user and root.

    Access to your data, emails, passwords, installing software (in /home), access to LAN and so on are already possible without root permissions, so there really is not a whole lot that an attacker cannot do even without root.

    And then, if you use sudo or su (or whatever) to switch to root with a password, escalating to root privileges is basically trivial for an attacker. An attacker can divert your PATH to compromised binaries. They could just replace “sudo” with their own little script that steals your password.