Regression in 2.3.4-4+deb8u1build0.16.04.1 on scp command parsing

Bug #1815935 reported by Iyyappa Murugandi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rssh (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Package: rssh
Version: 2.3.4-4+deb8u1build0.16.04.1

We are using libssh2(v1.5) client to download files in our product. After rssh got auto patched, our download scenario is broken. This happens only for users that are created with default rssh shell login.

Steps to repro:

1. sudo useradd -s /usr/bin/rssh -r -N -c "test" -G testgroup test
2. sudo passwd test
3. sudo usermod -a -G rsshusers test

4. Build libssh2
5. Run scp example
./example/example-scp 127.0.0.1 test test /tmp/f1.txt

Stuck and fails to read the file.

Libssh2 logs indicate rssh returned following error

insecure scp option not allowed.
This account is restricted by rssh.
Allowed commands: scp sftp

Looking at sshd debug mode logs indicated that scp is called "-pf" argument, but the new validation
"static int scp_okay( char **vec )" did't take that into account causing the failure.

It could be great if you could fix this issue.

Revision history for this message
Iyyappa Murugandi (mitsmiles) wrote :

Also libssh2 scp_send() uses "-pt" option.

Revision history for this message
Russ Allbery (rra-debian) wrote :

Thanks for the report! While I don't use or maintain the Ubuntu version of rssh, it looks like Ubuntu is importing the Debian security fixes, and this is indeed a regression in Debian as well. I'm working on a fix now, and checking with the Debian security team to confirm that it's worth a regression update. Presumably Ubuntu would then pull it in.

Please note that rssh is orphaned upstream and both upstream and I agree that its security model is not maintainable going forward, largely due to this sort of problem and the complexity of trying to analyze command lines for other programs that constantly change. The next stable release of Debian (and hence probably Ubuntu) will not contain the package, so you may want to start evaluating alternatives.

Revision history for this message
Iyyappa Murugandi (mitsmiles) wrote :

Thanks for looking into it.
Do you have any suggestion for the alternative solutions?
If we decide to not use rssh tomorrow, the user we created that was meant only for file transfer would be a regular user, that would solve current issue and remove dependency on rssh. But that will be step down from the security provided by rssh. We will definitely look into alternative solution, but let me also know if you have other solutions in mind.

Revision history for this message
Russ Allbery (rra-debian) wrote :

sftp is natively supported by sshd (with ForceCommand internal-sftp and ChrootDirectory), so that avoids the problem that rssh has where ssh keeps adding new features that add new security vulnerabilities in the rssh model. That's probably the best solution if you're currently using scp.

Revision history for this message
Iyyappa Murugandi (mitsmiles) wrote :

Sounds good. We will keep that as an option for the long term solution.
It would be great if you could provide a fix for the regression.
Thanks again!

Revision history for this message
Iyyappa Murugandi (mitsmiles) wrote :

Russ,

Please let us know if there is an update on this bug.
This regression is having a huge impact on our business, so it would be good if you could provide us with an update (https://blogs.msdn.microsoft.com/azureservicefabric/2019/02/07/known-issue-for-service-fabric-linux-clusters/ ).

It would be great if you could provide us with the fix :)

Thanks!

Revision history for this message
Russ Allbery (rra-debian) wrote :

Debian has released the fix for both stable and oldstable. As I said above, I personally don't use Ubuntu, don't maintain the Ubuntu package, and don't have upload rights to Ubuntu, so I'm afraid I can't help with fixing the bug in Ubuntu. Presumably you need to find someone who works on Ubuntu to import the fix from Debian, if that doesn't happen automatically.

The fixed Debian packages are available from:

https://packages.debian.org/source/stable/updates/rssh
https://packages.debian.org/source/oldstable/updates/rssh

It's possible that one or the other may install unmodified on your Ubuntu system; I don't know.

Revision history for this message
Iyyappa Murugandi (mitsmiles) wrote :

Thanks for fixing it in Debian.
I'll request someone from Ubuntu to import the fix.

Revision history for this message
Manfred Hampl (m-hampl) wrote :

Confirmed the bug based on the Debian report.

Changed in rssh (Ubuntu):
status: New → Confirmed
Revision history for this message
Iyyappa Murugandi (mitsmiles) wrote :

Thanks!
Do you know when will the new package be released?

Revision history for this message
Mike Salvatore (mikesalvatore) wrote :

Fixes were released today. Please upgrade (sudo apt-get update && sudo apt-get upgrade).

Revision history for this message
Iyyappa Murugandi (mitsmiles) wrote :

That's great news. Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.