Live data from Hacker News

WordPress 5.2: Mitigating Supply-Chain Attacks

paragonie.com

11–20 of 39 posts

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#11

I set up a WordPress site for a family member a couple years ago and threw wordfence on there just to see what the ecosystem is like. I get near daily alerts of attempted hacks mostly from Eastern Europe. Most common thing is trying to brute force the login page. Any improvements to WordPress security are welcome. It's got such a huge target painted on its back. Reminds me of windows in the 90s. As for what I learned…

> I get near daily alerts of attempted hacks mostly from Eastern Europe.

Everything you put on the Internet gets daily attempted attacks. The issue is... nobody should care about attempted attacks. Of course people will try to bruteforce your passwords. If you have any kind of software that warns you about these attacking attempts that's not helpful at all. What you want is to make these attacks do nothing. In case of bruteforce attempts it's clear how to do that: don't use insecure or reused passwords.

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#12
post #8
post #6

Earlier quoted context omitted.

That’s good info, thanks. I just happen to be looking into WP security right now. Would you recommend wordfence in addition to the changes you mentioned?

I highly recommend wordfence. I have it set to immediately block anyone after a single failed login attempt.

to offer a counter opinion I found wordfence highly obtrusive, annoying and full of dark patterns in an attempt to upsell you to premium. They present in their dashboard ALL attacks within their entire network as if those were attacks on your site in particular which is misleading. If the project permits the best practice is to convert the site into fully static HTML (WP2Static, SimplyStatic) and keep the backend site/database separate and local only.

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#13

I set up a WordPress site for a family member a couple years ago and threw wordfence on there just to see what the ecosystem is like. I get near daily alerts of attempted hacks mostly from Eastern Europe. Most common thing is trying to brute force the login page. Any improvements to WordPress security are welcome. It's got such a huge target painted on its back. Reminds me of windows in the 90s. As for what I learned…

If you have enough control of the server it resides on, one of the best things you can do is to deny it access to write to the PHP files of the Wordpress install (which requires that you use WP-CLI via command line to do updates), and setup automatic updates by calling WP-CLI through a cron job or however you want to automate that.

When a Wordpress install has write access to its own PHP files, then a vulnerability can do more harm obviously since it can modify the Wordpress install itself and thus more easily "infect" the installation. Denying write access cuts off many attacks from doing significant harm. BTW WP-CLI can also do checksums of your install.

I wouldn't fret too much about seeing attempted hack attempts. If you have enough logging turned on for a public web server, you'll see a constant stream of hack attempts for all types of languages / frameworks. I did this the other day and saw what I recognized as a variety of different attacks targeted at PHP, Rails, and Java.

Regarding usernames: note that Wordpress will, by default, expose those usernames in things like posts (author's username is revealed). I had to modify my theme to make that stop, and even then I'm not 100% sure it's not leaking somewhere I missed. Maybe you want to do all content editing with a user that has reduced privileges and only use your admin user when necessary.

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#14
I have old WordPress blogs sitting around. They got hacked of course. Because they are so old, it would be a huge pain to upgrade. I restored from backup and chmod 550 the whole WP installation. Much easier than upgrading and less time than migrating to static blog framework.

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#15
I think this is very good because it reduces the attack surface for people who track current code.

It's important to remember a large set of un-updated nodes will remain. Not that anyone can do much, but equally not that the entire surface of bad Wordpress will go away. I would be interested how big the long tail is. one third? more?

It is also worth thinking about the code signing problem firefox just had, and reflecting on the possibility of the hack in the head still taking place: either a denial-of-service or a bad code intrusion risk remains.

Its far far less likely, and it can be mitigated, but this is the reality of distributed systems: You can only do the best you can, nothing is guaranteed. (even TMR units fail)

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#16
post #6

I set up a WordPress site for a family member a couple years ago and threw wordfence on there just to see what the ecosystem is like. I get near daily alerts of attempted hacks mostly from Eastern Europe. Most common thing is trying to brute force the login page. Any improvements to WordPress security are welcome. It's got such a huge target painted on its back. Reminds me of windows in the 90s. As for what I learned…

That’s good info, thanks. I just happen to be looking into WP security right now. Would you recommend wordfence in addition to the changes you mentioned?

I'm really happy with ninjafirewall. Here's a comparison: https://translate.googleusercontent.com/translate_c?depth=1&...

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#17
post #8
post #6

Earlier quoted context omitted.

That’s good info, thanks. I just happen to be looking into WP security right now. Would you recommend wordfence in addition to the changes you mentioned?

I highly recommend wordfence. I have it set to immediately block anyone after a single failed login attempt.

So if I know the username of someone who admins your website I could shut them out with a single POST request? Seems a bit risky.

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#18
post #10
post #9

Earlier quoted context omitted.

It's fairly resource-intensive, though. I've seen whole servers brought to their knees because of plugins like WordFence -- an unintentional DoS, so to speak. Many of the defenses employed by WordFence would be orders of magnitude more efficient if implemented at the level of the http daemon or firewall. Unfortunately, WordPress plugins must cater to the lowest common denominator, shared hosting.

If what you’re dealing with is thousands of attempted brute force attacks on a daily or weekly basis, a wordpress plugin might not be the solution.

Sure, but you don't know that until the attacks actually begin, and anyone can attack any site for any reason these days. Meanwhile, most people who run WordPress sites don't know how to do anything more complicated than installing a plugin. Being a developer who caters to that market has its own charms and challenges.

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#19

I set up a WordPress site for a family member a couple years ago and threw wordfence on there just to see what the ecosystem is like. I get near daily alerts of attempted hacks mostly from Eastern Europe. Most common thing is trying to brute force the login page. Any improvements to WordPress security are welcome. It's got such a huge target painted on its back. Reminds me of windows in the 90s. As for what I learned…

This plugin allows you to rename the login page - https://wordpress.org/plugins/rename-wp-login/. It says untested with the last three versions of WordPress, but we use it on all our sites and have had no issues. It also doesn't redirect non-logged-in requests for /wp-admin/ to the login URL like the standard setup, so it doesn't make the new login URL available in any way. We were experiencing server slowdowns because of brute force attacks and this plugin really helped.

The best thing to do after that is to set up an .htaccess rule to return a 401 Forbidden error for /wp-login.php, because even with the plugin above the request is processed by PHP, which can still slow things down depending on the intensity of the attack.

This is obviously just security through obscurity, and you need other security measures in place too. Having said that, I find plugins like WordFence are overkill and often confusing, although we build WP sites from scratch so we control a lot of that side of things ourselves, and use a WP-focused hosting service which takes care of the other things like server-level security.

Re: WordPress 5.2: Mitigating Supply-Chain Attacks

#20
The update mechanism itself is still insecure, as the wordpress instance must have the ability to exchange its own source code - something you'd at least call risky. Web applications should run with the least possible privileges, ie. only with permissions to write to dedicated locations on the filesystem (user uploads), and read permissions for the code.

PHP has composer, a dependency management system. There's an option to build a wordpress project using composer.

Even more, there's even a boilerplate project that you can use to bootstrap your new wordpress setup - see https://roots.io/bedrock/

Post reply on HN