Rclone is not working outside of the root of crypt remote

Hello, im stumbled across an problem while using rclone with an crypt remote.
Im syncing my backups with an off site server in another building. For that i created an sftp remote and an crypt remote on top of that with the following config

type = crypt
remote = sftp:
filename_encryption = standard
directory_name_encryption = true
password = *password*
password2 = *salt_password*

type = sftp
host = *static_ip_adress*
user = *username*
port =
pass = *password*
key_file =
use_insecure_cipher =
disable_hashcheck =

I created an cronjob and syncing to the remote “secret” is working as it should.
I can then get an listing of all the files via “rclone ls secret:” or the folder listing via “rclone lsd secret:” but if i try to do an listing of any subfolder i get an error.

“rclone lsd secret: --crypt-show-mapping” outputs the following

2018/09/05 10:09:07 NOTICE: folder1: Encrypts to "vpolgk8brbhn72pnmaeb99rvmo"
2018/09/05 10:09:07 NOTICE: folder2: Encrypts to "tnjn5sd8j4mb14n0a8lgqbopbc"
2018/09/05 10:09:07 NOTICE: folder3: Encrypts to "p7r25ioa0sirse14iebc59810g"
2018/09/05 10:09:07 NOTICE: folder4: Encrypts to "ianv9d6m715hu83mga896t2lmc"
      -1 2018-08-31 19:36:15        -1 folder1
      -1 2018-09-03 10:59:57        -1 folder2
      -1 2018-09-03 10:59:53        -1 folder3
      -1 2018-09-03 10:36:07        -1 folder4

but “rclone ls secret:folder1” just throws me the following error:

2018/09/05 10:11:57 ERROR : : error listing: directory not found
2018/09/05 10:11:57 Failed to ls: directory not found

aswell as “rclone ls secret:vpolgk8brbhn72pnmaeb99rvmo”:

2018/09/05 12:00:18 ERROR : : error listing: directory not found
2018/09/05 12:00:18 Failed to ls: directory not found

if i try it with the sftp remote on the other hand it works as expected.
so “rclone ls sftp:vpolgk8brbhn72pnmaeb99rvmo” outputs:

12141 vpolgk8brbhn72pnmaeb99rvmo/43dnpbllsb818r9h8hhg3u6m84plhvhs5j4g5d05si8ihve9hvbg
6631270 vpolgk8brbhn72pnmaeb99rvmo/4aiu8khe216p7gm8j44p4m04pvqlabe8m8j3u8eeknccv4sla2114qu8beiq4ou7khu6upu17o8u7atpe398n2meuotcb7ebhfg9pt8
142694 vpolgk8brbhn72pnmaeb99rvmo/5mhgd4kn81e1q63icojj0vkois

and so on.

Is this a bug or am i doing something wrong?

This sounds like a bug, as your example shows the encrypted folder name exists.

I have a suspicion, this is the result of using a plain remote sftp: in crypt and insufficient path cleaning/validation in the sftp remote.

If you can, please open a GitHub issue for this.

Okay i’ve done a quick test and can confirm that this is indeed the problem. I will open an GitHub issue.
Thank you for your nearly instant response.