Popular WordPress plugin comes with a backdoor, steals site admin credentials
news.softpedia.com
news.softpedia.com
What's to stop any theme author from inserting an on-page credit card number scraper into an obfuscated javascript file or a modified version of jQuery? Just look for common WooCommerce field names on every page load, and if you find something, wait for the visitor to enter their card information and then phone home by loading an image or something else innocuous. I'm not aware of anything that any of the theme distribution channels would be doing to detect or prevent this kind of thing.
Given how easy it would be to construct this kind of attack, given how hurriedly theme-based WordPress sites are built, and given the budget limitations of people setting up theme-based WordPress sites, I tend to think that the main reason we don't hear more about these kinds of attacks is that no one is seriously looking for them.
But we don't hear about it more because most examples presumably get caught in theme/plugin review shortly after submission. The process isn't perfect, but the moderators do catch most attempts to do stuff like this.
And it's not happening through third party sites, because most people are advised to steer clear of free themes and plugins hosted outside the official directory.
I worry that, if it's hidden well enough, and if the attacker is smart enough not to be too greedy, a scraper could be there for years without anyone realizing it. The signature that such an exploit would leave behind--unlike what is described in the article--would be minimal if it were detectable at all.
Furthermore, I'm not as confident as you are that people who are acquiring themes are necessarily getting them from sites that are doing the kind of review that is necessary to prevent this. Even if people are avoiding free themes (and I'm not sure that they are) there are dozens if not hundreds of paid sites out there.
https://wordpress.org/plugins/about/guidelines/
And for stuff like phoning home without informed consent. Presumably the WordPress team has to check every line of code to do that, so they catch out any of said attacks during that check.
It's not a total ban, either: "However, note that some systems, like Paypal donation buttons, use encoded code as part of their normal operating mechanism. This is not considered to be 'obfuscated' as this is simply how these types of systems operate and it is not a choice by the plugin author."
That seems like a reasonably-sized loophole.
The "Paypal" loophole is specifically because the first version of the guidelines had people constantly emailing us asking if this Paypal code snippet was okay. All the Paypal code snippet does (or used to do) is to include the relevant form data for "who to pay" in a base64 encoded mechanism instead of including the email address directly in the HTML code snippet. People didn't know what the code was, or if it was okay, and I wanted them to stop asking.
We still look for suspect code, and obfuscation that makes no sense is right out. We even reject minified JS, unless the minified JS is distributed from upstream code and can be verified to be unmodified from the original upstream source.
http://premium.wpmudev.org/blog/free-wordpress-themes-ultima...
The part about searching for themes in Google says that you get better results now than you used to.
As for what stops third party sites doing this? Well for paid ones, reputation. You allow through themes with lots of security issues and backdoors, and customers start getting hacked and well... people might start steering clear of you in future. So the marketplaces and theme shops have an incentive not to act like scumbags.
For free sites? Guess reputation there too. You're right that we could see this happen in some cases, but not doing the proper review process is a losing proposition for the site as well as the users.
"The plugin has been updated to 0.9.8.9, which is a copy of 0.9.8.6 (the last good version). This will remove the malicious code from the plugin, but not any code that was added to sites in the meantime. Please follow through with the Mitigation steps given by Denis in the post."
[1] https://blog.sucuri.net/2016/03/when-wordpress-plugin-goes-b...
Another reason why autoupdates are a double edged sword.
Once part of wp-core it opens the road for plugins to extend on this functionality much easier, since all can depend on it being there.
I recently bought the developer version of ACF and migrated a Drupal 6 site with many custom content types and fields to Wordpress. Quite a bit of work, but loads of fun to do.
So far, I'm quite happy with the result, and I much prefer the simplicity and familiarity that it provides for the client (the content 'admin'), among other things.
But the fact that ACF relies on one single developer makes me a bit nervous. I'd also love for it to become part of core...
https://codex.wordpress.org/Post_Types
You should be defining them in your theme anyways for source control.
And I do think even though this API exists, it should definitely be improved upon and given a built in interface. I mean, don't other CMS scripts like Drupal provide a way to add custom fields and things in core, via a visual interface?
If you are changing your theme and using custom post types, you still have to modify the theme to support the custom post types. So copy and paste, or isolate the custom post types to a separate file and include in your functions.php.
If you're doing it any other way, then you honestly don't really know what you are doing.
And the way I suggest is also what a lot of WordPress experts suggest, as seen here:
http://justintadlock.com/archives/2013/09/14/why-custom-post...
http://www.wpbeginner.com/opinion/wordpress-custom-post-type...
https://www.smashingmagazine.com/2012/11/complete-guide-cust...
Personally, I much prefer to put functionality in a plugin and the theme limited to the frontend presentation. To suggest that I don't know what I'm doing is, well... Incorrect.
Syncing production, staging, and dev is an unrelated and solved problem.