Am I affected?

type your erlang.org/otp version to check

Description

Observable Timing Discrepancy vulnerability in Erlang/OTP ssh (ssh_auth, ssh_options modules) allows unauthenticated remote username enumeration via timing side-channel in password authentication.

When the SSH daemon is configured with the user_passwords or password option, ssh_auth:check_password/3 performs a PBKDF2-SHA256 computation with 600,000 iterations (~300ms) for valid usernames, but returns immediately (~0ms) for invalid usernames via the ssh_options:get_password_option/2 path. This timing difference is detectable in a single authentication attempt and allows an unauthenticated attacker to distinguish valid from invalid usernames.

The user_passwords and password options are documented as intended for test purposes; the recommended alternative is pwdfun, which is not affected by this vulnerability.

This vulnerability is associated with program files lib/ssh/src/ssh_auth.erl and lib/ssh/src/ssh_options.erl.

This issue affects OTP from OTP 29.0 before OTP 29.0.2, corresponding to ssh from 6.0 before 6.0.1.

Weaknesses & attack patterns

Weakness

CWE-208 · Observable Timing Discrepancy in catalog → MITRE ↗

Attack patterns

CAPEC-116 · Excavation MITRE ↗

Affected — Erlang

29.0 < 29.0.2 affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules ssh_auth · ssh_options
source files lib/ssh/src/ssh_auth.erl · lib/ssh/src/ssh_options.erl
routines ssh_auth:check_password/3 · ssh_options:get_password_option/2

Affected — Erlang / ssh Repository ↗

6.0 < 6.0.1 affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules ssh_auth · ssh_options
source files src/ssh_auth.erl · src/ssh_options.erl
routines ssh_auth:check_password/3 · ssh_options:get_password_option/2

Affected — GitHub / erlang/otp Repository ↗

032d1bc < c342092 affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules ssh_auth · ssh_options
source files lib/ssh/src/ssh_auth.erl · lib/ssh/src/ssh_options.erl
routines ssh_auth:check_password/3 · ssh_options:get_password_option/2

Workarounds

  • Use the pwdfun option instead of user_passwords for password authentication. The pwdfun callback gives full control over timing behavior and is not affected by this vulnerability. Implementations should take care to execute in approximately constant time regardless of username validity.
  • Restrict SSH port access to trusted networks only via firewall rules, reducing the set of potential attackers who can perform timing measurements.

Configurations

The SSH daemon must be configured with the user_passwords or password option for password authentication. Systems using the pwdfun option instead are not affected.

References

Credits

Zhang Delong Finder
Jakub Witczak Remediation developer
Ingela Anderton Andin Remediation reviewer
Michał Wąsowski Remediation reviewer

CVSS breakdown

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