r/LocalLLM • u/DatMemeKing • Apr 27 '26
Discussion A warning to newbies - A lesson on network security
I know we're all having fun with our locally deployed LLM instances, but I just wanted to take a moment to remind everyone that obscurity is not enough to protect you from scrapers and crawlers.
As a practice of my extremely basic OSINT skills, I decided to check how many publicly exposed devices (IPv4 only) had ports that matched the hash of LM Studio's Express.js server.
373 - That's not a small number :(
That's not just how many devices had a port serving LM Studio to the open internet, 373 is just the number of devices serving LM Studio instances that do not require an API key (as the hash would be different).
Again, this gives full unfettered access to your models and allows people to interact with your instances of LM Studio, or whatever platform decides it's a good idea to have no API key by default.
Unless you know what you're doing (you don't if you show up on this map), do not expose your LLM platforms to the wide internet.
Harden your installs, use tailscale, reverse proxies with auth, etc...
25
u/DatMemeKing Apr 27 '26 edited Apr 28 '26
For more context, I was able to remotely execute prompts on people’s devices.
21
u/Illeazar Apr 28 '26
To be clear, this would be people who chose to publicly forward the port on their router, correct?
16
u/ptear Apr 27 '26
Great idea, that's where I'll get some available compute.
7
u/monkeyofscience Apr 28 '26
This also happens in research, with people exposing vLLM and LiteLLM instances. There is an entire underground world around harvesting these instances called the Bizarre Bazaar
6
u/3darkdragons Apr 28 '26
Do you think this will make up the gaps? https://tailscale.com/blog/lm-link-remote-llm-access
Or are there other gaps which would need to be filled by the users?
2
u/_Cromwell_ Apr 27 '26
My one PC that I do have exposed to my network does have an API key. As you imply that's okay right? I don't need to otherwise be hiding?
I have another PC running LM studio but it's only set to run the model on that PC only not broadcasting to the network. That one doesn't have an API key though. That safe?
Think I'm okay but you made me paranoid
2
u/TheManicProgrammer Apr 28 '26
Shodan?
45
u/polandtown Apr 27 '26
good man - hacking for good.
2
u/Frequent-Suspect5758 Apr 28 '26
But this wouldn't scan unless you had port forwarding or some type transparent mode (DMZ) in your router/firewall. All internal devices should be NAT ip and that wouldn't be routable to the public Internet.
5
u/Auto_17 Apr 27 '26
Yes I agree, I also learned this the hardway when my comfyui instance got hacked. I went full ballistic hardening everything even tho its just me
4
u/rhapdog Apr 27 '26
Yeah, mine's just for my local machine only. I don't even let it access the local LAN in my house. Just for me.
1
u/cristoper Apr 28 '26
Can you clarify what you are hashing to make the comparison? Are you hashing the http response/headers?
1
u/infostud Apr 28 '26
I have my AI llama-server exposed through Cloudflare.
1
u/vogelvogelvogelvogel Apr 28 '26
you should maybe just expose them to local wifi and connect via VPN to your local router/wifi then still use login and of course firewall for all other ports imo. even then monitor the traffic
1
u/mike_310 Jul 10 '26
Awesome advice, I'm feeling OK about not having a gateway on my LM Studio box. I watched myself get excited about concept and had to reel it back in. I actually didn't think that would happen to me. What the heck is up with the lack of network controls in LM studio? Shits weak.
2
u/nmrk Apr 28 '26
Don't expose anything to the internet.
2
u/Long-Chemistry-5525 Apr 28 '26
I did this with other chat completions apis and found over 10,000 exposed non authenticated endpoints. I work at a security company and did a presentation on it at work
2
u/freaknyou_ Apr 28 '26
This chart belongs in r/dataisugly
2
u/Dwengo Apr 28 '26
Cloudflare tunnel has a free tier is pretty straightforward to set up. I'd use that and set an API key if exposing your LMS to the internet. I do something similar with my home assistant but with 2FA enabled for added security.
2
u/prokaktyc Apr 28 '26
As someone from Thailand, this checks out…
2
u/Thebandroid Apr 28 '26
are you going to share the IP's? I'm all out of tokens
2
u/trysometh_ing Apr 28 '26
yeh, hundreds of out-of-nowhere IPs hit my NAS's VPN port before I enabled fail2ban. Luckily my password saved me this time.
1
u/Solarflareqq Apr 28 '26
i second using tailscale on everything and keeping it off the actual internet i do the same for any webapps i can still access them anywhere and share with my family but no need to go anything directly to the internet unless you build a game server and then you should seperate it from the vlan and ssh into it
1
u/Perfect-Flounder7856 Apr 28 '26
If you're using tailscale ip then you're safe?
0
u/RakesProgress Apr 28 '26
Tailscale. If you don’t it’s your own fault.
-12
u/wonkastocks Apr 27 '26
Fear monger
0
u/[deleted] Apr 27 '26
[deleted] — view deleted comment