Welp. My Forgejo instance got popped with an RCE two days ago by CVE-2026-60004. Luckily, I noticed the following morning and had the day free to figure out what happened. Let’s dive in!

As a homelab enthusiast, I found this a very interesting post. Here are my take aways from the post that I’m implementing myself:

  • Miner detection. I’ve updated monitoring rules to now watch the CPU on my hosts. If the same thing happened to me I would not have been alerted at all as I’m doing simple up / down monitoring. Fixed.
  • Access logging. I turned on access logging for my homelab Caddy instances.
  • Log retention. I have increased the amount and retention of my logging. The hope is this will help me reconstruct what happened after a breach.
  • Logs offsite. The VPS access logs now ride along with the normal backup process, which runs hourly. The homelab side still only gets caught by the weekly VM backup, so that’s next.
  • Closed an open signup. My webtrees instance (genealogy) had self registration enabled, which is the same door this guy got hit through. Oops. Fixed.
  • Built a tool. log-inventory.sh, so “could I actually reconstruct what happened” is a command I run instead of a thing I assume.
  • MonkeMischief@lemmy.today
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 hours ago

    Yiiiiiikes. This is why I’m gonna be stuck on tailscale or another VPN only access for quite a while. I know it’s not perfect, but exposing ports on today’s Internet is scary.

    I know I don’t have the mental overhead to secure literally everything, and have a solid contingency for when some botnet armed with a zero-day inevitably breaks it.

    Really glad this person wrote this write up about how that happens and what it looks like though. It’s REALLY interesting and I learned a lot!

  • irmadlad@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    4 hours ago

    About the only recent even I’ve had was when I was sitting at my desk reading an article. I noticed the mouse slightly move, but I hand no hand on the mouse. I sit there watching it, not manually moving the mouse or typing on the keyboard. It really freaked me out. Turns out, my old desk pad had a slight curl towards the edge the mouse was at, and the curl would make the mouse sense movement ever so slightly. I deployed a new desk pad, and things are back to normal. Whew!

  • PieMePlenty@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    9 hours ago

    My server got hacked once and was mining crypto! I noticed it when I heard the fans were at 100% when walking passed the room lol. Turns out, qbittorrent-nox used UPNP for its web admin endpoint enabled by default and qbittorrent can do many things like run custom scripts. My mistake was not changing its login credentials. Exposed my full system. Live and learn.

    • BorgDrone@feddit.nl
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 hours ago

      UPNP is a security nightmare, better to never enable it at all or if you must only for those networks where you need it.

  • chunkystyles@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    9
    ·
    14 hours ago

    I just recently went through a much more benign, but scary nonetheless version of this.

    I realized that my Ansible directory, that I had made public on GitHub to share as an example to some folks, had secrets committed and pushed.

    It was the direct URL and credentials of an app I developed to store non-PII customer data. Now, it wouldn’t be the end of the world if someone noticed this and scraped the data, but it wouldn’t be good, either.

    Luckily, I have Caddy access logs, and it appears no one ever accessed it.

    So I pulled the secrets out of the Ansible directory and made the repo private, I rotated the credentials, and installed Crowdsec to monitor Caddy access logs and ban bad actors.

    I only noticed the secrets because I had just setup Authelia as an OAuth2 provider for my homelab, and I was adding it to my backup scripts.

    • Appoxo@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 hours ago

      Ayy, just went through the same troubles with Authelia earlier this week.
      Only 4 services I could conmect ao far but still neat to have :)

  • Wispy2891@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    19 hours ago

    And detected mostly because the automated script kiddie set up a cryptominer to generate $0.0001

    There are way more valuable and destructive ways once you have RCE like:

    • Searching for committed API keys “anyway my repo is private”
    • Ransomware in case there were no backups
  • carrylex@lemmy.world
    link
    fedilink
    English
    arrow-up
    47
    arrow-down
    3
    ·
    edit-2
    1 day ago

    Not updating stuff + Public sign ups enabled (did you even read the setup guide?) + Unrestricted internet access

    Yeah I wonder what could possibly go wrong…

    But great writeup

  • gaylord_fartmaster@lemmy.world
    link
    fedilink
    English
    arrow-up
    87
    arrow-down
    1
    ·
    1 day ago

    I don’t think I will ever be convinced to leave anything on my home network open to the internet no matter how convenient it is.

    • lemmyvore@feddit.nl
      link
      fedilink
      English
      arrow-up
      28
      arrow-down
      1
      ·
      1 day ago

      It’s fairly safe as long as you add a strong enough form of access control. For example if you put it behind a VPN, or a SSH tunnel, or require mTLS. Even a key in a custom HTTP header or Basic HTTP auth can be good enough if the key is strong enough.

      You can further decrease the probability of drive-by bots reaching a publicly exposed service by merely scanning IPs and ports if you use a reverse proxy and hide your service FQDNs and IP.

      You can do this by using TLS certs on wildcard domains rather than explicit domains, using explicit CNAMEs for the service subdomains rather than a wildcard domain, and keeping the A/AAAA records on an obfuscated subdomain rather than the base domain. If the bots can’t figure out a FQDN they’re not getting past the reverse proxy even if they find the IP and port.

      This is obfuscation not real security but it cuts down tremendously on bot hits.

        • frongt@lemmy.zip
          link
          fedilink
          English
          arrow-up
          4
          arrow-down
          1
          ·
          21 hours ago

          The VPN service is open to the Internet. But it’s only one service, versus however many things you are running behind it.

      • hietsu@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        8
        ·
        1 day ago

        I have knockd listening on one very high port number, and only after accessing that reverse proxy whitelists the source ip. Sure some scanners might do a full port scan and try http only after that, but FQDN is required too. Plus I have geo ip list blocking all but my country. Oh and Crowdsec. So far so good…

    • leds@feddit.dk
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      1
      ·
      21 hours ago

      I gave up , don’t have the time to maintain it anymore. Changed DNS to make my domain point to local lan IP so everything still works but only at home.

      • village604@adultswim.fan
        link
        fedilink
        English
        arrow-up
        2
        ·
        14 hours ago

        I wonder if the person who downvoted you thought you pointed your public DNS record to a 192.168 network, instead of making a change to your local DNS server like I’m assuming you did.

        • jet@hackertalks.com
          link
          fedilink
          English
          arrow-up
          3
          ·
          9 hours ago

          If you want https it’s gotta be a external DNS record anyway, might as well point to internal ips

          Depending on how paranoid your setup is not everything will use the DHCP provided DNS servers

          • KubeRoot@discuss.tchncs.de
            link
            fedilink
            English
            arrow-up
            2
            ·
            5 hours ago

            If you want https it’s gotta be a external DNS record anyway

            Not sure what you mean by that, but off the top of my head, you can get certificates via challenges that prove DNS control (rather than checking if the DNS points to your server), and you can get wildcard certificates so you don’t even have to expose the existence of subdomains.

            And that’s ignoring the option of using your own CA, which only really works with your own devices, but for local access might be viable.

  • IanTwenty@piefed.social
    link
    fedilink
    English
    arrow-up
    12
    ·
    22 hours ago

    Firewalling containers’ outbound access seems to be rare but another powerful layer of protection

    • chaospatterns@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      21 hours ago

      Yeah it’s useful and I’ve been using it for my home lab, but too many of my containers want outbound connections to the Internet. Like Forgejo needs :443 to be able to mirror or remote push repositories, so either I have to identify and allow list github.com, gitlab.com, etc. or end up allowing 0.0.0.0/0:443 which is not very strong protection.

      I’d love for some kind of CNI or network plugin that filtered based on domain name.

  • antianarchist@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    21 hours ago

    I hate providers not offering me a latest tag. Is there any valid reason not to do that?

    Even worse, super stupid version tags such as MinIO is using: RELEASE.2025-09-07T16-13-09Z-cpuv1 (I wish I made that up)

    • ShortN0te@lemmy.ml
      link
      fedilink
      English
      arrow-up
      3
      ·
      19 hours ago

      My guess, auto updates for major versions is not good practice. Installations potentially corrupt and users come screaming to the project maintainers instead of searching the blame by themselfe.

      forgejo defined the lifecycle for every version so just add a calendar entry for when the supports runs out and then update the 3 characters in the docker compose file.

      • antianarchist@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        4
        ·
        13 hours ago

        I can get that and I also prefer sticking to major versions. However, I am chaotic and easily have 50 different docker images, checking all the release cycle of all of those gets exhausting.

        I believe I need to start generating notifications if a tag has not received an update for more than 30d.

  • snrkl@lemmus.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    20 hours ago

    I’d suggest hobbling those log links that point to active payloads etc - usually best practice when writing this stiff up, so someone doesn’t accidentally click on them…

  • glizzyguzzler@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    6
    ·
    22 hours ago

    The real takeaway is to run your containers ALL as read-only. There’s no way to run executables like this as read-only. They’d download to /tmp but not have executable access and womp womp.

    Many things aren’t read-only friendly, but so far I’ve found all containers can be beat into read-only mode! (Heimdall is one of the worst, shout out to it)

  • epyon22@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    19
    ·
    1 day ago

    Have you thought about log aggregation with something like Prometheus/graphana or ELK?

    Lol thinking about cpu notifications for myself. I get notified when the fans ramp up on my server.

  • tofu@lemmy.nocturnal.garden
    link
    fedilink
    English
    arrow-up
    6
    ·
    24 hours ago

    Good write up! Since you’re using Komodo already, are your compose stacks in git? Because if they are, check the renovate bot. It will read your files with their pinned image tags, check upstream for newer tags, and creates MRs (can also be set to auto merge) to update. Can be configured per stack.

  • Coolcoder360@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    ·
    1 day ago

    Nice write up, also glad to see someone using bear blog in the field! Adding your blog to my RSS reader!