Hacker News new | ask | show | jobs
by jgil 10 days ago
Vanilla OpenWrt is not necessarily more secure than a vendor fork (though dropping the cloud/remote-access layer obviously reduces the attack surface). It really depends on the build and config options.

For example, by default (in OpenWrt):

- The web UI serves plaintext HTTP and doesn't redirect to HTTPS, even though it generates a self-signed cert for 443 on first boot. [1]

- The router generates a persistent DUID from its LAN MAC and sends it to your ISP. [2][3]

- Userspace is FORTIFY_SOURCE=1 and PIE/ASLR are not enabled on all binaries. BusyBox (which runs the WAN DHCP and NTP clients) isn't built with PIE unless you set PKG_ASLR_PIE_ALL. [4]

There are other defaults and unneeded packages that can be changed or removed. I spent a lot of time tuning the configs and switching some daemons to Rust before ultimately deciding that a NixOS gateway + separate AP was more viable.

[1] https://github.com/openwrt/openwrt/blob/main/package/network...

[2] https://github.com/openwrt/openwrt/blob/main/package/base-fi...

[3] https://github.com/openwrt/openwrt/blob/main/package/network...

[4] https://github.com/openwrt/openwrt/blob/main/config/Config-b...

5 comments

> The web UI serves plaintext HTTP and doesn't redirect to HTTPS, even though it generates a self-signed cert for 443 on first boot.

How much does that matter? I suppose it provides confidentiality in the face of a passive local attacker, but the moment they do an active MITM I don't think a self-signed cert will be very useful

> I spent a lot of time tuning the configs and switching some daemons to Rust before ultimately deciding that a NixOS gateway + separate AP was more viable.

On the same (tiny) hardware? Have you published it anywhere? (Or did you move to a "big" gateway with less-trusted APs?)

> but the moment they do an active MITM I don't think a self-signed cert will be very useful

In my experience, it's TOFU (Trust On First Use): once you accept the self-signed certificate the first time, Firefox will store its hash and no longer warn you as long as the certificate doesn't change. An active MITM after that point should still warn about an untrusted certificate, since the certificate would no longer be the same as the stored exception.

(And the same would happen if you initially accepted the self-signed certificate while under an active MITM, and the attack later stops; the only way to avoid a warning would be to have the attack be running continuously since the first use.)

Except browsers periodically rewarn about such certs, and users will accept it. It will not work as a protection in practice.
I've never seen Firefox re-warn about the self-signed certificate of my OpenWRT router, and I've been using the same self-signed certificate for over a year.
How does HTTPS even work in this case? HTTPS relies on a valid SSL cert, which either sign the site is really foo.com But in the case of a router, you have a configurable IP address. Obviously the router can't self-sign a cert that the configindeed lives a whatever address you set
you just blindly trusts the router self-signed cert upon first login, and if you're paranoid enough, add it to your system keychain so subsequent logins can be locally verified.
Afaik trusting a root cert is not something you can just do with a click (and rightly so). The only usecase for trusting a locally signed cert is dev work imo, and not something a user should be ever asked to do.
> The web UI serves plaintext HTTP and doesn't redirect to HTTPS, even though it generates a self-signed cert for 443 on first boot.

This would be easier if every browser in existence didn't freak the fuck out and throw a tantrum if it ever sees a self signed cert and did its damndest to stop the user from ever reaching the site, putting up warning walls with tiny camouflaged links to override it. It's ruined local web apps that can no longer use half of the browser's functionality as they are forced onto HTTP to be usable.

Vanilla gets patches though, fork is a crapshoot
Care to share your nixos config?
> The web UI serves plaintext HTTP

Nobody is expected to use HTTPS in a LAN. This isn't supposed to be exposed to the Internet.

So we just assume there's never an adversary in the LAN that might want to move laterally? Maybe I'm stupid, but that seems like a bad idea.