flysystem-sftp icon indicating copy to clipboard operation
flysystem-sftp copied to clipboard

PathPrefix is ignored

Open SamMousa opened this issue 5 years ago • 4 comments

It seems this adapter fully ignores a configured path prefix.

SamMousa avatar Oct 17 '18 13:10 SamMousa

Correct, I saw it last week. I've got it on my list for Friday. If you need it sooner a PR is welcome (with tests).

frankdejonge avatar Oct 17 '18 14:10 frankdejonge

Side note, the option is not really documented. Is path prefix supposed to be a guarantee from a security perspective?

SamMousa avatar Oct 17 '18 14:10 SamMousa

The path prefix is to facilitate scoping, which is not provided now but will be when implemented. Path traversal prevention is done at a different level, the path passed to the Filesystem instance is checked for this.

frankdejonge avatar Oct 17 '18 14:10 frankdejonge

Alternative fix would be to have another look at my old PR for a decorator: https://github.com/thephpleague/flysystem/pull/799.

The approach of a decorator is cleaner, more secure and will work for any adapter not the ones that happen to implement it.

SamMousa avatar Oct 17 '18 14:10 SamMousa