{"article":{"slug":"security-advisory-openssh-server-password-authentication-bypass","title":"Security advisory: openssh-server password authentication bypass","subtitle":null,"summary":"Alpine Linux warns that an attacker reaching sshd could log in without a password on affected openssh-server packages, explains the conditions and cause, lists fixed package versions, and advises updating and restarting sshd or disabling password logins.","content_type":"announcement","language":"en","canonical_url":"https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/","author":{"name":"Alpine Linux","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"Alpine Linux","url":"https://alpinelinux.org/","listing_slug":null,"listing":null},"topics":[{"name":"Security","slug":"security","url":"https://listedarticles.com/topics/security"},{"name":"Linux","slug":"linux","url":"https://listedarticles.com/topics/linux"},{"name":"Open Source","slug":"open-source","url":"https://listedarticles.com/topics/open-source"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":1085,"reading_minutes":5,"published_at":"2026-11-05T00:00:00.000Z","added_at":"2026-11-05T20:10:26.758Z","updated_at":"2026-11-05T20:10:26.758Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/security-advisory-openssh-server-password-authentication-bypass","markdown_url":"https://listedarticles.com/articles/security-advisory-openssh-server-password-authentication-bypass.md","example":false,"citation":"Alpine Linux, Alpine Linux. \"Security advisory: openssh-server password authentication bypass.\" 5 Nov 2026. https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/ (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/"},"body_markdown":"# Security advisory: openssh-server password authentication bypass\n\n**If you run `sshd` on Alpine Linux, update `openssh` now and restart `sshd`.**\nUpgrading the package alone does not replace the running daemon.\n\nIf you cannot update yet, at least disable password logins: set\n`PasswordAuthentication no` in your sshd configuration and restart `sshd`.\nEither one closes the hole.\n\n## What is the problem?\n\nAn attacker who can reach your SSH port can log in without knowing any password. It takes one connection, works every time, and needs no retries.\n\nThe attacker needs the name of an account whose password field is `*`\n(an account with no password set, which is normal for key-only accounts), and\nneeds the machine to have at least one other account with a `$5$` or `$6$`\npassword hash. The attacker then sends a very long password (257 to 1024\nbytes). One user with a password is enough: it makes every account without\none reachable.\n\nDetails are in the [OpenSSH 10.6p2 release\nnotes](https://www.openssh.com/releasenotes.html). No CVE identifier had been\nassigned at the time of writing.\n\n## Who is affected?\n\nYou are affected if all of the following are true:\n\n- You run the Alpine `openssh-server` package, which is built without PAM, or\nyou run`openssh-server-pam` with`UsePAM no` . (`openssh-server-pam` with`UsePAM yes` is not affected.)\n- `PasswordAuthentication` is`yes` (the OpenSSH default, unless you changed it).\n- The machine has an account whose password field is `*` . This includes:\n  - `root` , which ships as`root:*` in the base image since about Alpine 3.16.\nOpenSSH’s default`PermitRootLogin prohibit-password` protects root, so\nroot is only reachable if`PermitRootLogin yes` is set. That does not help if\nanother account that can log in is able to become root, for example\nthrough`doas` .\n  - Any key-only user created with `adduser` without a password, or with`usermod -p '*'` .\n  - Users coming from a directory service through musl-nscd (nslcd, winbind, sssd), since they have no shadow entry.\n  - The `alpine` user in the official**tiny-cloud** images (see below).\n- At least one local account has a `$5$` or`$6$` password hash.\n\nAffected releases: every Alpine release we checked, 3.21 through 3.24 and edge, and the older releases that no longer receive regular updates (3.16 to 3.20).\n\n### Who is not affected?\n\n- **Docker and other container users** that do not run`sshd` in the\ncontainer.\n- Systems with `PasswordAuthentication no` .\n- Systems using `openssh-server-pam` with`UsePAM yes` (with`UsePAM no` you are affected).\n- Locked accounts: those with `!` as the password field in`/etc/shadow` (a line starting`user:!:` ). They cannot log in with a password or a key.\n- Systems where no account has a `$` -style password hash.\n- Cloud images configured through cloud-init, which writes\n`PasswordAuthentication no` .\n\n## How can I fix it?\n\n### 1. Update\n\n```\napk upgrade -U -a\n```\nAlpine 3.21.10, 3.22.8, 3.23.8 and 3.24.4 contain the fixed package (see the\n[release announcement](/posts/alpine-3.21.10-3.22.8-3.23.8-3.24.4-released/)).\nThe fixed package versions are:\n\n| Branch | Fixed `openssh` version | \n|---|---|\n| edge | 10.6_p2-r0 | \n| 3.24 | 10.3_p1-r2 | \n| 3.23 | 10.2_p1-r1 | \n| 3.22 | 10.0_p1-r11 | \n| 3.21 | 9.9_p2-r1 | \n| 3.20 | 9.7_p1-r6 | \n| 3.19 | 9.6_p1-r3 | \n| 3.18 | 9.3_p2-r4 | \n| 3.17 | 9.1_p1-r7 | \n| 3.16 | 9.0_p1-r6 | \n\n**Restart `sshd` after upgrading** (`rc-service sshd restart`). Upgrading the\npackage does not restart a running `sshd`, so you must do it after.\n\n### 2. If you cannot update: disable password authentication\n\nBefore you start, make sure your SSH key login works, and keep your current session open until you have tested a new login.\n\nRun these as root. The first two commands create a drop-in file. Alpine’s\ndefault `sshd_config` reads that directory from 3.19 onward; older releases\nignore it. The `sed` command changes `yes` to `no` on every\n`PasswordAuthentication` line in `/etc/ssh/sshd_config`, whatever the spacing,\nincluding lines inside a `Match` block. It also adds `PasswordAuthentication no` at the top of the file, for the case where there was no such line, and\nsaves the original as `/etc/ssh/sshd_config.bak`. The last two commands check\nthe configuration, restart the daemon, and show the result:\n\n```\nmkdir -p /etc/ssh/sshd_config.d\necho 'PasswordAuthentication no' > /etc/ssh/sshd_config.d/00-no-passwords.conf\nsed -i.bak -e '1i PasswordAuthentication no' \\\n  -e 's/^\\(\\s*PasswordAuthentication[^y#]*\\)yes/\\1no/i' \\\n  /etc/ssh/sshd_config\nsshd -t && rc-service sshd restart\nsshd -T | grep -i passwordauthentication\n```\nThe last command should print `passwordauthentication no`. To undo, delete\n`/etc/ssh/sshd_config.d/00-no-passwords.conf` and copy\n`/etc/ssh/sshd_config.bak` back over `/etc/ssh/sshd_config`.\n\n## Cloud images (tiny-cloud)\n\nThe official tiny-cloud images (the qcow2, VHD and AMI artifacts) from\n**3.18.11 through 3.24.3** ship an `alpine` user with a `*` password field and\npasswordless `doas`. They are safe on first boot. They become exploitable as\nsoon as any `$6$` hash exists on the machine, for example when an admin sets a\nconsole password, or user-data adds a user with `hashed_passwd`. An attacker\nthen gets a shell as `alpine` and can use `doas` to become root.\n\nImages built from 3.21.10, 3.22.8, 3.23.8, 3.24.4 and later include the fixed\npackage. Images from earlier point releases do not, so on every running\ninstance, update `openssh` or disable password authentication.\n\n## Releases that are no longer supported (3.21 and older)\n\nThese releases have the same bug. 3.21 reached its end of support on 2026-11-01, but we have published fixed packages for each release all the way back to 3.16.\n\n## How do I know if I was attacked?\n\nLook in `/var/log/messages` for `sshd` lines reading `Accepted password for`\nan account that has no password (`alpine`, `root`, or any key-only user).\nReview `doas` use and recently created users, files and authorized keys on\nexposed machines. If you cannot rule out a login, treat the machine as\ncompromised.\n\n## How could this happen?\n\nWhen sshd is built without PAM, it checks a password by hashing the attempt\nwith `crypt()` (the C library function that turns a password into its stored\nhash) and comparing the result to the stored password field. For an account\nwhose stored field is too short to contain a salt (the random prefix of a\nhash), sshd borrows the salt of another account.\n\nmusl’s `crypt()` returns the string `*` as an error indicator when the key is\nover 256 bytes long. `*` is also exactly what the stored field contains for\nevery account with no password, so the “hash” matches and the login succeeds.\n\nOpenSSH 10.6p2 avoids the problem in sshd. The stable-branch packages above carry a patch for the same problem.\n\n## Credits\n\nReported by Özgün Kültekin of [Wakefield](https://wakefield.co). Thanks to\nDamien Miller and Darren Tucker of the OpenSSH project for the fix and the\n10.6p2 release, to Timo Teräs for help analyzing the issue, and to Natanael\nCopa, who built and uploaded the updated packages.","body_html":"<h1 id=\"security-advisory-openssh-server-password-authentication-bypass\">Security advisory: openssh-server password authentication bypass</h1>\n<p><strong>If you run <code>sshd</code> on Alpine Linux, update <code>openssh</code> now and restart <code>sshd</code>.</strong>\nUpgrading the package alone does not replace the running daemon.</p>\n<p>If you cannot update yet, at least disable password logins: set\n<code>PasswordAuthentication no</code> in your sshd configuration and restart <code>sshd</code>.\nEither one closes the hole.</p>\n<h2 id=\"what-is-the-problem\">What is the problem?</h2>\n<p>An attacker who can reach your SSH port can log in without knowing any password. It takes one connection, works every time, and needs no retries.</p>\n<p>The attacker needs the name of an account whose password field is <code>*</code>\n(an account with no password set, which is normal for key-only accounts), and\nneeds the machine to have at least one other account with a <code>$5$</code> or <code>$6$</code>\npassword hash. The attacker then sends a very long password (257 to 1024\nbytes). One user with a password is enough: it makes every account without\none reachable.</p>\n<p>Details are in the <a href=\"https://www.openssh.com/releasenotes.html\" rel=\"nofollow ugc noopener\">OpenSSH 10.6p2 release\nnotes</a>. No CVE identifier had been\nassigned at the time of writing.</p>\n<h2 id=\"who-is-affected\">Who is affected?</h2>\n<p>You are affected if all of the following are true:</p>\n<ul><li><p>You run the Alpine <code>openssh-server</code> package, which is built without PAM, or</p><p>you run<code>openssh-server-pam</code> with<code>UsePAM no</code> . (<code>openssh-server-pam</code> with<code>UsePAM yes</code> is not affected.)</p></li><li><code>PasswordAuthentication</code> is<code>yes</code> (the OpenSSH default, unless you changed it).</li><li><p>The machine has an account whose password field is <code>*</code> . This includes:</p><ul><li><p><code>root</code> , which ships as<code>root:*</code> in the base image since about Alpine 3.16.</p><p>OpenSSH’s default<code>PermitRootLogin prohibit-password</code> protects root, so\nroot is only reachable if<code>PermitRootLogin yes</code> is set. That does not help if\nanother account that can log in is able to become root, for example\nthrough<code>doas</code> .</p></li><li>Any key-only user created with <code>adduser</code> without a password, or with<code>usermod -p &#39;*&#39;</code> .</li><li>Users coming from a directory service through musl-nscd (nslcd, winbind, sssd), since they have no shadow entry.</li><li>The <code>alpine</code> user in the official<strong>tiny-cloud</strong> images (see below).</li></ul></li><li>At least one local account has a <code>$5$</code> or<code>$6$</code> password hash.</li></ul>\n<p>Affected releases: every Alpine release we checked, 3.21 through 3.24 and edge, and the older releases that no longer receive regular updates (3.16 to 3.20).</p>\n<h3 id=\"who-is-not-affected\">Who is not affected?</h3>\n<ul><li><p><strong>Docker and other container users</strong> that do not run<code>sshd</code> in the</p><p>container.</p></li><li>Systems with <code>PasswordAuthentication no</code> .</li><li>Systems using <code>openssh-server-pam</code> with<code>UsePAM yes</code> (with<code>UsePAM no</code> you are affected).</li><li>Locked accounts: those with <code>!</code> as the password field in<code>/etc/shadow</code> (a line starting<code>user:!:</code> ). They cannot log in with a password or a key.</li><li>Systems where no account has a <code>$</code> -style password hash.</li><li><p>Cloud images configured through cloud-init, which writes</p><p><code>PasswordAuthentication no</code> .</p></li></ul>\n<h2 id=\"how-can-i-fix-it\">How can I fix it?</h2>\n<h3 id=\"1-update\">1. Update</h3>\n<pre><code>apk upgrade -U -a</code></pre>\n<p>Alpine 3.21.10, 3.22.8, 3.23.8 and 3.24.4 contain the fixed package (see the\n<a href=\"/posts/alpine-3.21.10-3.22.8-3.23.8-3.24.4-released/\">release announcement</a>).\nThe fixed package versions are:</p>\n<div class=\"table-wrap\"><table><thead><tr><th>Branch</th><th>Fixed <code>openssh</code> version</th></tr></thead><tbody><tr><td>edge</td><td>10.6_p2-r0</td></tr><tr><td>3.24</td><td>10.3_p1-r2</td></tr><tr><td>3.23</td><td>10.2_p1-r1</td></tr><tr><td>3.22</td><td>10.0_p1-r11</td></tr><tr><td>3.21</td><td>9.9_p2-r1</td></tr><tr><td>3.20</td><td>9.7_p1-r6</td></tr><tr><td>3.19</td><td>9.6_p1-r3</td></tr><tr><td>3.18</td><td>9.3_p2-r4</td></tr><tr><td>3.17</td><td>9.1_p1-r7</td></tr><tr><td>3.16</td><td>9.0_p1-r6</td></tr></tbody></table></div>\n<p><strong>Restart <code>sshd</code> after upgrading</strong> (<code>rc-service sshd restart</code>). Upgrading the\npackage does not restart a running <code>sshd</code>, so you must do it after.</p>\n<h3 id=\"2-if-you-cannot-update-disable-password-authentication\">2. If you cannot update: disable password authentication</h3>\n<p>Before you start, make sure your SSH key login works, and keep your current session open until you have tested a new login.</p>\n<p>Run these as root. The first two commands create a drop-in file. Alpine’s\ndefault <code>sshd_config</code> reads that directory from 3.19 onward; older releases\nignore it. The <code>sed</code> command changes <code>yes</code> to <code>no</code> on every\n<code>PasswordAuthentication</code> line in <code>/etc/ssh/sshd_config</code>, whatever the spacing,\nincluding lines inside a <code>Match</code> block. It also adds <code>PasswordAuthentication no</code> at the top of the file, for the case where there was no such line, and\nsaves the original as <code>/etc/ssh/sshd_config.bak</code>. The last two commands check\nthe configuration, restart the daemon, and show the result:</p>\n<pre><code>mkdir -p /etc/ssh/sshd_config.d\necho &#39;PasswordAuthentication no&#39; &gt; /etc/ssh/sshd_config.d/00-no-passwords.conf\nsed -i.bak -e &#39;1i PasswordAuthentication no&#39; \\\n  -e &#39;s/^\\(\\s*PasswordAuthentication[^y#]*\\)yes/\\1no/i&#39; \\\n  /etc/ssh/sshd_config\nsshd -t &amp;&amp; rc-service sshd restart\nsshd -T | grep -i passwordauthentication</code></pre>\n<p>The last command should print <code>passwordauthentication no</code>. To undo, delete\n<code>/etc/ssh/sshd_config.d/00-no-passwords.conf</code> and copy\n<code>/etc/ssh/sshd_config.bak</code> back over <code>/etc/ssh/sshd_config</code>.</p>\n<h2 id=\"cloud-images-tiny-cloud\">Cloud images (tiny-cloud)</h2>\n<p>The official tiny-cloud images (the qcow2, VHD and AMI artifacts) from\n<strong>3.18.11 through 3.24.3</strong> ship an <code>alpine</code> user with a <code>*</code> password field and\npasswordless <code>doas</code>. They are safe on first boot. They become exploitable as\nsoon as any <code>$6$</code> hash exists on the machine, for example when an admin sets a\nconsole password, or user-data adds a user with <code>hashed_passwd</code>. An attacker\nthen gets a shell as <code>alpine</code> and can use <code>doas</code> to become root.</p>\n<p>Images built from 3.21.10, 3.22.8, 3.23.8, 3.24.4 and later include the fixed\npackage. Images from earlier point releases do not, so on every running\ninstance, update <code>openssh</code> or disable password authentication.</p>\n<h2 id=\"releases-that-are-no-longer-supported-3-21-and-older\">Releases that are no longer supported (3.21 and older)</h2>\n<p>These releases have the same bug. 3.21 reached its end of support on 2026-11-01, but we have published fixed packages for each release all the way back to 3.16.</p>\n<h2 id=\"how-do-i-know-if-i-was-attacked\">How do I know if I was attacked?</h2>\n<p>Look in <code>/var/log/messages</code> for <code>sshd</code> lines reading <code>Accepted password for</code>\nan account that has no password (<code>alpine</code>, <code>root</code>, or any key-only user).\nReview <code>doas</code> use and recently created users, files and authorized keys on\nexposed machines. If you cannot rule out a login, treat the machine as\ncompromised.</p>\n<h2 id=\"how-could-this-happen\">How could this happen?</h2>\n<p>When sshd is built without PAM, it checks a password by hashing the attempt\nwith <code>crypt()</code> (the C library function that turns a password into its stored\nhash) and comparing the result to the stored password field. For an account\nwhose stored field is too short to contain a salt (the random prefix of a\nhash), sshd borrows the salt of another account.</p>\n<p>musl’s <code>crypt()</code> returns the string <code>*</code> as an error indicator when the key is\nover 256 bytes long. <code>*</code> is also exactly what the stored field contains for\nevery account with no password, so the “hash” matches and the login succeeds.</p>\n<p>OpenSSH 10.6p2 avoids the problem in sshd. The stable-branch packages above carry a patch for the same problem.</p>\n<h2 id=\"credits\">Credits</h2>\n<p>Reported by Özgün Kültekin of <a href=\"https://wakefield.co\" rel=\"nofollow ugc noopener\">Wakefield</a>. Thanks to\nDamien Miller and Darren Tucker of the OpenSSH project for the fix and the\n10.6p2 release, to Timo Teräs for help analyzing the issue, and to Natanael\nCopa, who built and uploaded the updated packages.</p>","headings":[{"level":1,"text":"Security advisory: openssh-server password authentication bypass","id":"security-advisory-openssh-server-password-authentication-bypass"},{"level":2,"text":"What is the problem?","id":"what-is-the-problem"},{"level":2,"text":"Who is affected?","id":"who-is-affected"},{"level":3,"text":"Who is not affected?","id":"who-is-not-affected"},{"level":2,"text":"How can I fix it?","id":"how-can-i-fix-it"},{"level":3,"text":"1. Update","id":"1-update"},{"level":3,"text":"2. If you cannot update: disable password authentication","id":"2-if-you-cannot-update-disable-password-authentication"},{"level":2,"text":"Cloud images (tiny-cloud)","id":"cloud-images-tiny-cloud"},{"level":2,"text":"Releases that are no longer supported (3.21 and older)","id":"releases-that-are-no-longer-supported-3-21-and-older"},{"level":2,"text":"How do I know if I was attacked?","id":"how-do-i-know-if-i-was-attacked"},{"level":2,"text":"How could this happen?","id":"how-could-this-happen"},{"level":2,"text":"Credits","id":"credits"}]}}