Can WordPress Developers and Security Researchers get along?
Tags: wordpress, security, devops, opensource
Published: 2019-07-23 15:49:44

The relationship between WordPress developers and security researchers has been strained for some time now. Recently it is so bad that vulnerability reporters are going rogue which is affecting site owners. In the past months we’ve seen multiple researchers drop 0-day information (vulnerability details with no current patch available) which has resulted in our security staff being in emergency mode to ensure plugins are getting updated quickly, before sites get hacked. In some rare occasions where sites get hacked before we can patch, we’re putting in even more time handling incident response and cleanup for every affected site.

This is <em>not</em> a healthy scenario for anyone involved. Developers are being rushed to produce patches, sites are getting hacked due to no fault of the site owners, security teams are putting in more time than normal towards remediation of hacks, and researchers are getting [bad] press over their actions.

Here are two articles from this week that in one shows a security researcher with great patience facing months of non-communication from the developers they reported a vulnerability to, and a second where it's shown a different security researcher has stopped being nice and is now choosing to go full disclosure before attempting to contact plugin authors about vulnerabilities:
<ul>
 	<li><a href="https://www.rcesecurity.com/2019/06/about-a-sucuri-rce-and-how-not-to-handle-bug-bounty-reports/">RCESecurity "About a Sucuri RCE ... and How Not to Handle Bug Bounty Reports"</a> June 20, 2019</li>
 	<li><a href="https://www.zdnet.com/article/disgruntled-security-firm-discloses-zero-days-in-facebooks-wordpress-plugins/">ZDNet "Disgruntled security firm discloses zero-days in Facebook's WordPress plugins"</a> June 17, 2019</li>
</ul>
This scenario the WordPress and Security communities have got themselves in is a net loss for everyone involved (except the hackers), and it’s really quite saddening. <a href="https://pagely.com/solutions/secure-wordpress-hosting/">Pagely's Security</a> Team has a strong background of doing the right thing in these cases, be it with <a href="https://pagely.com/blog/the-php-object-injection-odyssey/">reporting of vulnerabilities</a> (including those in WordPress core and plugins) as well as received and triage vulnerability reports on behalf of others. We know that the process of reporting vulnerabilities can be a net-positive and does not have to go down the road that leads to sites being compromised.

Here we have four recommendations for Developers, <em>plus an offer</em> for Security Researchers and Developers alike.

<!--more-->

<hr />

<h2>These are our four recommendations:</h2>
<h3>1. Have a point of contact.</h3>
It would be surprising that one of the biggest hurdles for the security researchers may be simply finding out who to contact. The WP.org plugin repository understandably (for anti-spam and privacy reasons) does not include your email address or a contact form on plugin pages. Nor is it acceptable to publish details of a security finding in the plugin forums (this is the same as releasing the vulnerability since it’s a public discussion forum).

So take a minute to think. How do you want to receive security reports? Maybe include a security point of contact in the plugin’s readme/source files, or if you have a development website that you’re linking to from the plugin description page on WP.org, be sure to have either a generic contact form or specific page detailing instructions on how people can report security issues found in your code.
<p style="padding-left: 40px;">If you’re a development shop that has some funding, you also may wish to consider signing up for a bug bounty program like <a href="https://www.hackerone.com/" target="_blank" rel="noopener noreferrer">hackerone</a> or <a href="https://www.bugcrowd.com/" target="_blank" rel="noopener noreferrer">bugcrowd</a>, and use that as your point of contact.</p>
<p style="padding-left: 40px;">What happens if a security researcher can’t find out how to contact a plugin author? Well, then they will reach out to the WP.org plugin team to act as liaisons to receive, triage, and report the issue to you, the developer.</p>
<p style="padding-left: 40px;"><strong>Pro-tip:</strong> If the plugin team confirms a vulnerability, they will likely remove your plugin from the WP.org repo until you have a patch available.</p>

<h3>2. Be appreciative.</h3>
Reading a report of a security flaw in your code base can bring up some negative emotions, especially if you’ve got your ego tied up in your code. Try to let any negative emotions slide away if they bubble up.

It helps to take a second before you start reading the report to imagine the reporting party as someone who already contributed multiple hours of their own time towards your project, free of charge. Treat them as you would someone who had a great idea or pull request that improved your code, not as a threat.
<p style="padding-left: 40px;">This is the step I see things break down the most. A developer gets, what they perceive as, a nasty email from a researcher. They take personal insult because they believe they’re being told their code is bad. Their reaction to this is to send an email maybe downplaying or demeaning the report which starts a negative downward spiral from where there is no positive outcome.</p>
<p style="padding-left: 40px;">As a developer, imagine spending hours contributing to a project free of charge and when you unveil your improvements, the project lead acts dismissive or negatively towards your contribution. Would you feel comfortable contributing your time towards that project ever again? Probably not. Is it possible you may even have feelings of wanting to get even? Possibly.</p>
<p style="padding-left: 40px;">Now imagine that contribution was a security finding? That security researcher has their means of getting even right there in the report they sent to the project in good faith. By making that same security report public, makes it an 0-day, sites get hacked, the project’s reputation is tarnished, and the developer still has to write and push a patch.</p>

<h3>3. Communicate.</h3>
Don’t leave the reporter out of the loop while you work on a patch or review their report. Share your progress and timeline if you have one, even if it’s a long way off. Ask questions if you have any (some of these vulnerabilities are confusing the first time you read about them, it took me some time to really understand object injection and its risk).

If you inform the reporter you’re squeezed for time, or you’re having trouble understanding the issue, or maybe even just ask them their opinion of the proposed patch, sometimes they may offer to help.
<p style="padding-left: 40px;">Keep in mind the person reporting the vulnerability may have an internal timeline they assumed is sufficient (maybe 30, 90 or 180 days , but it's always an arbitrary timeline until both parties communicate their expectations) and if the researcher doesn't hear anything from the developer in that time frame, they may just report the vulnerability publicly so they can close the case and move on to finding more vulnerabilities. It doesn’t hurt to keep up communications, ask questions or share timelines and/or knowledge.</p>

<h3>4. Transparency.</h3>
This last bit is for the users of your code. Be sure when you have a security release ready, you include a note in the changelog that the release contains a security related patch. Your users need to know that the version released addresses a security issue, so they know to update ASAP. Hiding or neglecting to include security notes from your code’s changelog, doesn’t mean the security issue never existed.
<p style="padding-left: 40px;">Neglecting to include a note that a version of the software includes a security patch is simply a disservice to a project’s users. If users don’t see there is a security patch in that release, then some will not bother to update their sites. Sites not getting security patches results in sites being compromised. The worst part is, during the incident response phase to clean up the mess the hack causes, it will be pointed out your plugin insecurity as the fault of the hack.</p>
<p style="padding-left: 40px;">When Pagely customer’s experience a compromise we perform a <a href="https://pagely.com/kb/en/pagely-incident-response-program/">detailed incident response</a> which, is more than just a cleanup because, 99% of the time we will include details on what the initial attack vector was. It’s very common that if the cause of the hack was a plugin whose developer ignored or played down a security issue, the site owner chooses to remove the plugin from the site entirely. Understandably so, as the site owner feels betrayed and loses trust that the project’s developers will be honest with them about security concerns.</p>


<hr />

That’s the basics. I hope developers reading this take to heart some of the considerations. I believe nothing recommended above would harm a project’s reputation and, in fact, I would argue they improve the project’s reputation as being ran by mature developers who have earned their user’s trust.

<em>For the few security researchers who may be reading this, especially if you agree with the importance of the above four points, here is our offer:</em>

I know some of you have faced some difficulties when reporting vulnerabilities to the WordPress development community in the past. We would like to offer an olive branch in the form of assistance.

If you have had a bad experience reporting vulnerabilities to the WordPress development community (core, themes, plugins, whatever), and would like us to help, please reach out (contact us via the <a href="https://pagely.com/contact/">Pagely support contact form</a>, and someone will route notification to our security team).

We will be glad to help you find the point of contact for a plugin (we have connections in the community) and even act as mediators, reviewing/confirming your report and reaching out to the plugin author on your behalf!

This would be a win-win. You can spend more time finding vulnerabilities and less time writing emails, while we help the affected project be more secure.

This offer has already been put into play, we helped <a href="http://medium.com/websec">Slavco Mihajloski</a> just last week with reporting a vulnerability he found in <a href="https://wordpress.org/plugins/nextgen-gallery/">NextGen Gallery</a>. We would look forward to helping anyone else (both developers and researchers alike) who want to work towards a solution where vulnerabilities are patched, credit is properly attributed, and sites don't get hacked.

We hope that this dilemma can be addressed, hopefully our offer to help act as mediators will get both security researchers and WordPress developers away from the road that leads to 0-days being released and sites being hacked, and onto a road of collaboration and mutual understanding (and where hackers have to do their own damned work to find vulnerabilities in the WordPress ecosystem).

Original post was published by Pagely's Head of Security at https://pagely.com/blog/wordpress-developers-security-researchers/