News for hackers. Stuff that matters.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by dawnerd on Wednesday June 23, 2021 @11:35PM (#27613673)
This actually got me a while ago but with redis and some script kiddy turning my dev server into a bitcoin miner.

Anyone else running docker and using iptables really needs to read this https://docs.docker.com/network/iptables/

Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by qbasic_forever on Wednesday June 23, 2021 @11:50PM (#27613781)
The insidious thing is that there's no indication, failure, log or anything to tell you something is out of the ordinary either. It would be one thing if it just exploded and failed to run, but it's even worse that it silently interacts with iptables & ufw to allow all the traffic through. The exact opposite of what you want or intended.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by dawnerd on Thursday June 24, 2021 @12:13AM (#27613912)
Only reason I noticed was a command was taking slightly longer than normal and I checked htop and saw redis using 100% cpu. Absolutely insane this is the Docker default.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by bushbaba on Thursday June 24, 2021 @12:13AM (#27613911)
I’m kind of shocked this is even deemed acceptable architecture. You’d think docker wouldn’t even touch iptables unless explicitly told to.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by qbasic_forever on Thursday June 24, 2021 @12:17AM (#27613938)
It's how they can make containers feel like isolated little subnets without resorting to vxlan or other kernel-level stuff. It's a great development experience and I'd be sad to see it go. But.... it really needs to proactively detect and warn users. The issue has been known for many years. A quick little check and error out on startup if you're running on Ubuntu or have ufw enabled would probably save 99% of the pain people have had with it over the years.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by 1337shadow on Thursday June 24, 2021 @03:01AM (#27614691)
It works fine when users create docker networks for their containers to communicate, which docker-compose does by default, instead of publishing ports on 0.0.0.0 like yolo
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by AtNightWeCode on Thursday June 24, 2021 @12:52AM (#27614094)
I would say that this is the expected behavior. Also, I don't think one should rely on firewalls in this way.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by Shank on Thursday June 24, 2021 @01:01AM (#27614125)
Relying on firewalls to do what firewalls do and have done and continue to do seems perfectly acceptable. Yes, your database should have authentication enabled too, but expecting ports to not be unexpectedly open is the entire point of firewalls.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by AtNightWeCode on Thursday June 24, 2021 @03:00AM (#27614689)
Kind of what I said. Firewalls are for blocking unwanted traffic. It should not be used as a replacement for other security measures. "unexpectedly open", well, there I simply disagree.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by Aeolun on Thursday June 24, 2021 @07:41AM (#27616206)
So if you have a firewall set to block everything, and you run a docker container that listens to your global IP, you expect it to magic your firewall for you?
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by AtNightWeCode on Thursday June 24, 2021 @09:02AM (#27616828)
Yes. I would assume that any service platform or services for that matter may have open ports as default and that you should place it in a private network with a proxy in front of it.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by js4ever on Thursday June 24, 2021 @12:24AM (#27613970)
Redis can be exploited to run executables ???
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by bigiain on Thursday June 24, 2021 @02:48AM (#27614643)
From antirez the guy who wrote redis's blog:

'The Redis security model is: “it’s totally insecure to let untrusted clients access the system, please protect it from the outside world yourself”.' -- http://antirez.com/news/96

That blog post also helpfully shows how to write you own key into .ssh/authorized_keys to you can log in as the redis user over ssh. From there use your favourite lunar priv escalation bug to p0wn the box completely. (Or just run your cryptominer as the redis user...)

Note: that's about 5 years old now...

Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by js4ever on Thursday June 24, 2021 @12:50PM (#27620285)
Holy shit! thanks for the details
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by dawnerd on Thursday June 24, 2021 @12:40AM (#27614044)
Yeah - kinda crazy theres no auth by default AND eval is allowed. Pretty trivial for someone to have it download a script and run it pretty much with free reign.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by slavak on Thursday June 24, 2021 @01:15AM (#27614193)
Redis doesn't accept unauthenticated external connections by default for a while now, specifically to try and eliminate this footgun.

https://github.com/redis/redis/commit/edd4d555df57dc84265fdf...

Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by SilverRed on Thursday June 24, 2021 @01:20AM (#27614221)
I had an issue where I used the redis docker image and didn't understand docker networking properly so I set the network mode as host so my other container could connect. Not knowing this had exposed redis to the world unauthenticated (in about 2018).

Eventually a kind script set a password on redis which caused me to notice and fix this issue.

Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by dawnerd on Thursday June 24, 2021 @01:19AM (#27614214)
Interesting, this definitely happened with a more recent version... Wonder if theres some other exploit at play too (could also be the containerized version?)
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by dento on Thursday June 24, 2021 @04:06AM (#27615055)
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by qbasic_forever on Thursday June 24, 2021 @12:38AM (#27614038)
It can execute Lua, I'm sure there's plenty of fun for hackers to have with this: https://redis.io/commands/eval
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by tpetry on Thursday June 24, 2021 @02:17AM (#27614518)
I guess most people have faced this. I got years ago too but after a few seconds some internal monitoring system alerted me that new ports have been exposed.

I am not sure anymore how i solved it but after some time (and none of the documented solutions working) i decided to let docker do to iptables whatever it wants to and used another firewall which filtered the traffic again after iptables was done "filtering" it.

Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by squeaky-clean on Wednesday June 23, 2021 @11:43PM (#27613731)
Almost exactly the same thing has happened to me except Selenium and they were trying to log into Playstation Network accounts.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by frakkingcylons on Wednesday June 23, 2021 @11:53PM (#27613802)
Same exact thing happened to my test redis instance two years ago.
Re:Hacker deleted all of NewsBlur’s Mongo data and is now ho... by Aeolun on Thursday June 24, 2021 @07:38AM (#27616191)
What is this black magic? Why is docker concerned with iptables at all?

And these docs read a lot like: “We are going to totally ignore any of your firewall rules unless you follow all these steps exactly and do a lot of manual work.”