WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5994 closed defect (bug) (fixed)

Autoupgrade plugins Should have SFTP option

Reported by: technosailor Owned by: ryan
Priority: normal Milestone: 2.7
Component: Security Version: 2.5
Severity: normal Keywords:
Cc:

Description

Not critical for WP 2.5, but I think that the plugin autoupgrade routine should provide the option for SFTP. FTP is a security risk and we should enable users to be security minded whenever possible.

Attachments (2)

filesystem-manage-page.diff (3.0 KB) - added by technosailor 5 years ago.
hook to override filesystem credentials form
req_cred_hook.diff (596 bytes) - added by ryan 5 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 lloydbudd5 years ago

  • Version set to 2.5

My understanding is that the current approach is to test the FTP experience -- most common -- first, and then integrate the less common (more secure) experiences.

comment:2 technosailor5 years ago

I figured as much, just lodging my wish for 2.6. I don't even have FTP turned on so using the upgrade feature isn't an option for me, but I realize I'm in a minority.

comment:3 follow-up: ryan5 years ago

Anyone want to create a new filesystem class that abstracts ssh2_sftp?

comment:4 in reply to: ↑ 3 technosailor5 years ago

Replying to ryan:

Anyone want to create a new filesystem class that abstracts ssh2_sftp?

I'll take a stab at it. Are you looking for WP 2.5 or 2.6? Just so I can figure out my timeline.

comment:5 technosailor5 years ago

  • Owner changed from anonymous to technosailor
  • Status changed from new to assigned

comment:6 DD325 years ago

SFTP should be available if you enable the "Secure" selection & its using the FTP Extension & SSL is supposed:

http://trac.wordpress.org/browser/trunk/wp-admin/includes/class-wp-filesystem-ftpext.php#L64

64	        if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') ) {
65	            $this->link = ftp_ssl_connect($this->options['hostname'], $this->options['port'],$this->timeout);
66	        } else {
67	            $this->link = ftp_connect($this->options['hostname'], $this->options['port'],$this->timeout);
68	        }

Note however, that it silently falls back to non-ssl if it cant connect with ssl.
SSL shouldnt really be needed though IMO, As it'll only be connecting to localhost, Not another server, Therefor, there's no network nodes in the middle which may be listening in. While the local computer (the www server) could be, it would require root priv. in which case, it could access all the data regardless. I'm just pointing out the fact that 'secure' isnt really needed on that connection, whilst some will still want it anyway.

comment:7 follow-up: technosailor5 years ago

SFTP != FTP/SSL.

SFTP is FTP over SSH.

comment:8 in reply to: ↑ 7 DD325 years ago

Replying to technosailor:

SFTP != FTP/SSL.

SFTP is FTP over SSH.

oops. FTPS is the Secure version of FTP(which the previous statement applies to)

comment:9 technosailor5 years ago

Attached is a patch (one of several /methinks) that will allow plugin authors to create their own admin page form for custom filesystems.

I am currently proceeding under the assumption that an ssh2_sftp filesystem will be plugin territory due to PHP 5/external module/ time constraints for 2.5 release, so I will need hooks to make this possible.

technosailor5 years ago

hook to override filesystem credentials form

comment:10 follow-up: DD325 years ago

hook to override filesystem credentials form

Bit of a hackish method there IMO.

Perhaps maybe just having a callback that can be run to display the form required or somesuch.

comment:11 in reply to: ↑ 10 technosailor5 years ago

Replying to DD32:

hook to override filesystem credentials form

Bit of a hackish method there IMO.

Perhaps maybe just having a callback that can be run to display the form required or somesuch.

I'm easy, if you want to write that code? I'm not 100% sure what you're envisioning? Maybe get_credentials_form() that would have a hook for plugin authors to insert new filesystems to choose from?

comment:12 zamoose5 years ago

Oughtn't the password field be an <input type="password"> so that we're not showing the password in the clear? 'Twas a bit startling to see my password typed out there in plain text...

comment:13 ryan5 years ago

  • Owner changed from technosailor to ryan
  • Status changed from assigned to new

ryan5 years ago

comment:14 ryan5 years ago

  • Milestone changed from 2.6 to 2.5

Patch does a little short circuit trick with apply_filters that we use in some other places. If the filter callback returns anything other than empty an empty string, return. Otherwise, fall through the default code.

comment:15 ryan5 years ago

Accidentally committed in [7460]. I'll leave it in for now so you can try it out.

comment:16 ryan5 years ago

  • Milestone changed from 2.9 to 2.7
  • Resolution set to fixed
  • Status changed from new to closed

comment:17 ydekproductions5 years ago

Are we getting anywhere on the actual SFTP option? FTP over SSH.

I see in the trunk, the FTP/SSL option, but no SFTP. This would really be handy for people who don't have FTP turned on. We only use SFTP on my server.

comment:18 DD325 years ago

I see in the trunk, the FTP/SSL option, but no SFTP. This would really be handy for people who don't have FTP turned on. We only use SFTP on my server.

If you have the PHP SSH extension loaded, then #7690 is the ticket that implemented it.

comment:19 ydekproductions5 years ago

Ahh, thank you, I didn't have the ssh2 module installed so I didn't see the option. :) All good now.

Note: See TracTickets for help on using tickets.