Am I affected?

This record states its affected versions in a form that can't be compared automatically.

3.0.1 and up affected
6.0.1 not affected
5.5.2.1 not affected
5.2.11.8 not affected
every other version: unknown

Description

Exposure of Sensitive Information to an Unauthorized Actor vulnerability in Erlang OTP ssh (ssh_sftpd module) allows File Discovery.

The SSH_FXP_READLINK handler in ssh_sftpd sends the raw result of file:read_link/2 to the client without calling chroot_filename/2 to strip the backend root prefix. An authenticated SFTP client can create a symlink inside the chroot pointing to /; ssh_sftpd resolves the target to the absolute backend root and stores it on disk. Reading the symlink back via SSH_FXP_READLINK returns that absolute path, for example /data/sftp, instead of the chrooted value /.

The information disclosed is the absolute filesystem path of the SFTP root directory and of any symlink targets within it. No file contents, credentials, or access to paths outside the root directory are obtainable through this issue alone.

This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl.

This issue affects OTP from OTP 17.0 before OTP 29.0.2, OTP 28.5.0.2 and OTP 27.3.4.13, corresponding to ssh from 3.0.1 before 6.0.1, 5.5.2.1 and 5.2.11.8.

Weaknesses & attack patterns

Weakness

CWE-200 · Exposure of Sensitive Information to an Unauthorized Actor in catalog → MITRE ↗

Attack patterns

CAPEC-116 · Excavation MITRE ↗

Affected — Erlang / ssh Repository ↗

3.0.1 and up affected
6.0.1 not affected
5.5.2.1 not affected
5.2.11.8 not affected
every other version: unknown
default status unknown
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules ssh_sftpd
source files src/ssh_sftpd.erl
routines ssh_sftpd:handle_op/4

Affected — GitHub / erlang/otp Repository ↗

17.0 and up affected
29.0.2 not affected
28.5.0.2 not affected
27.3.4.13 not affected
0822579 < 8f4224a affected
every other version: unknown
default status unknown
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules ssh_sftpd
source files lib/ssh/src/ssh_sftpd.erl
routines ssh_sftpd:handle_op/4

Workarounds

  • Use OS-level chroot to run the Erlang VM/SFTP server process in an isolated filesystem environment, eliminating reliance on the application-level root option.
  • Ensure that the SFTP server port is not reachable from untrusted machines.
  • Ensure that no sensitive information (usernames, project names, mount topology) is inferrable from the absolute path of the configured root directory.

Configurations

The SFTP subsystem must be enabled on the SSH server and the root option must be configured in the ssh_sftpd:subsystem_spec/1 call. Deployments without the root option are not affected.

References

Credits

Jonatan Männchen / EEF Finder Remediation developer
Michał Wąsowski Remediation developer
Jakub Witczak Remediation reviewer

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
« All CVEs