Repository navigation
[14.5-stable] debug: upgrade OpenSSH to 10.6p2 - #7049
Conversation
Review: OpenSSH 10.6p2 backport to 14.5-stable
This is a well-constructed, security-focused backport. The approach is sound and I verified the key safety properties below. I posted 2 low-severity inline notes asking to confirm intentional behavior changes; no blocking issues found. Verified correct
Inline notes (non-blocking, confirm intent)
Couldn't verify
View job run · branch |
a2ebfbc to
2de3a02
Compare
| RUN /usr/bin/install -c -m 0755 -s sshd-session /out/usr/lib/ssh/sshd-session | ||
| RUN /usr/bin/install -c -m 0755 -s sshd-auth /out/usr/lib/ssh/sshd-auth | ||
| RUN /usr/bin/install -c -m 0755 -s ssh-pkcs11-helper /out/usr/lib/ssh/ssh-pkcs11-helper | ||
| RUN /usr/bin/install -c -m 0755 -s ssh-sk-helper /out/usr/lib/ssh/ssh-sk-helper |
There was a problem hiding this comment.
ssh-keysign is no longer installed here — the previous build installed it setuid (-m 4711). Dropping it disables hostbased authentication (and removes a setuid binary). This is almost certainly intentional given EVE's publickey-only policy, but it isn't mentioned in the PR description (which only lists adding sshd-auth and realigning the helper dir). Please confirm the removal is deliberate.
| --with-default-path='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \ | ||
| --with-privsep-user=sshd \ | ||
| --with-ssl-engine | ||
| --with-privsep-user=sshd |
There was a problem hiding this comment.
--with-ssl-engine was dropped from the configure flags in this change. The OpenSSL ENGINE API is deprecated under OpenSSL 3.x, so this is reasonable, but it's an undocumented behavior change (not listed in the PR description). Confirm it's intentional — if any deployment relied on an OpenSSL engine for key operations, this removes that path.
|
Claude finished @shjala's task in 3m 56s —— View job Review: OpenSSH 10.6p2 backport to 14.5-stableReviewed A few points posted as inline comments:
The password-bypass regression test, publickey/SFTP checks, and the production |
|
|
||
| WORKDIR /usr/src | ||
| ADD https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src | ||
| ADD --checksum=sha256:9ae44872090cf2f06b3cf9ff147e7f16f309671340763ed2f99248398ae29d5b https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src |
There was a problem hiding this comment.
ADD --checksum=... for a remote URL requires the Dockerfile frontend ≥ 1.6. This file still pins # syntax=docker/dockerfile-upstream:1.5.0-rc2-labs (line 1, unchanged by this PR). With that older frontend, BuildKit rejects the --checksum flag (unknown flag: checksum) and the build fails before the GPG verify even runs.
Please bump the # syntax= directive to a version that supports ADD --checksum (e.g. docker/dockerfile:1.9 / ...-labs), and confirm the master PR #7046 did the same. If local builds passed, double-check they weren't using an implicitly newer frontend than the pinned directive.
| # key. Two of them then collide and apk frees a still-referenced package | ||
| # (SIGSEGV); a single one makes apk commit a DB truncated at that record. No .apk | ||
| # file exists to hash, so derive a stable synthetic SHA-1 from name and version. | ||
| PKG_CSUM="Q1$(printf '%s' "${PKG_NAME}-${PKG_VERSION}" | sha1sum | cut -d' ' -f1 | xxd -r -p | base64)" |
There was a problem hiding this comment.
This relies on xxd -r -p, but xxd is not in this stage's BUILD_PKGS (abuild curl tar make linux-headers patch g++ git gcc gpg ncurses-dev autoconf openssl-dev zlib-dev jq pciutils usbutils lsblk). In Alpine, xxd is a separate package (it appears in pkg/alpine/mirrors/3.16/main), not guaranteed to be symlinked from busybox on every supported arch. If it's absent, register-sbom-pkg.sh (invoked at Dockerfile line 117) fails under set -e and breaks the whole build.
Since this script was carried over unchanged from master, please verify xxd is actually present in the 14.5-stable debug build image, or add xxd to BUILD_PKGS. An alternative that avoids the dependency: openssl dgst -sha1 -binary | base64 (openssl is already available here).
| RUN /usr/bin/install -c -m 0755 -s sshd-session /out/usr/lib/ssh/sshd-session | ||
| RUN /usr/bin/install -c -m 0755 -s sshd-auth /out/usr/lib/ssh/sshd-auth | ||
| RUN /usr/bin/install -c -m 0755 -s ssh-pkcs11-helper /out/usr/lib/ssh/ssh-pkcs11-helper | ||
| RUN /usr/bin/install -c -m 0755 -s ssh-sk-helper /out/usr/lib/ssh/ssh-sk-helper |
There was a problem hiding this comment.
Alongside the /usr/libexec → /usr/lib/ssh relocation, the previously-installed setuid ssh-keysign helper (install -m 4711 ... ssh-keysign) is no longer installed. ssh-keysign is only needed for client-side hostbased authentication, so dropping it is reasonable (and removes a setuid-root binary), but please confirm this is intentional and that nothing in EVE relies on hostbased auth from the debug container.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 14.5-stable #7049 +/- ##
===============================================
+ Coverage 24.97% 32.18% +7.20%
===============================================
Files 8 14 +6
Lines 1185 2663 +1478
===============================================
+ Hits 296 857 +561
- Misses 820 1806 +986
+ Partials 69 0 -69 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Upgrade this branch's existing source build from 9.8p1 to the verified 10.6p2 release, which fixes the musl password-authentication bypass. Alpine 3.16's patched 9.0p1 package would downgrade the existing OpenSSH. This is a standalone branch-specific change, independent of the Alpine 3.22 package update on master. Retain detached-signature verification, remove the utmpx patch included upstream, install sshd-auth and align helper paths with SFTP configuration. Record the source-built version in the SBOM and add the isolated password bypass, public-key login and SFTP regression tests. Preserve this branch's existing public-key-only authentication and refresh the debug image pin. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
2de3a02 to
1bfb386
Compare
|
Claude finished @shjala's task in 3m 57s —— View job Review: OpenSSH 10.6p2 backport to 14.5-stable
I reviewed Two actionable issues posted inline:
Still standing from the earlier automated review (behavior changes, please confirm intent — no new inline comments added to avoid duplication): dropping the setuid Couldn't verify here: the pinned SHA-256 and the |
|
|
||
| WORKDIR /usr/src | ||
| ADD https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src | ||
| ADD --checksum=sha256:9ae44872090cf2f06b3cf9ff147e7f16f309671340763ed2f99248398ae29d5b https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src |
There was a problem hiding this comment.
Build-breaking: ADD --checksum= for a remote URL requires the Dockerfile frontend ≥ 1.6, but line 1 still pins # syntax=docker/dockerfile-upstream:1.5.0-rc2-labs (predates --checksum). BuildKit will reject it with unknown flag: checksum before the GPG verify ever runs.
Notably, this is not how master #7046 is structured: master's pkg/debug/Dockerfile does not use ADD --checksum for the OpenSSH archive at all — it relies on the detached-signature (.asc) GPG verification on the following lines (and uses abuild -F checksum for its own sources). So there is no precedent that --checksum works under this pinned frontend.
Two safe options:
- Drop
--checksumand rely on the retainedgpg --verify openssh-*.tar.gz.ascon lines 75–76, which already guarantees integrity/authenticity (this matches master's approach), or - Bump the
# syntax=directive to a frontend that supports--checksum(e.g.docker/dockerfile:1.9/-labs) — but that is a broader change to the whole image build and should be validated.
If local builds passed, confirm they weren't silently using a newer default frontend than the pinned directive.
| # key. Two of them then collide and apk frees a still-referenced package | ||
| # (SIGSEGV); a single one makes apk commit a DB truncated at that record. No .apk | ||
| # file exists to hash, so derive a stable synthetic SHA-1 from name and version. | ||
| PKG_CSUM="Q1$(printf '%s' "${PKG_NAME}-${PKG_VERSION}" | sha1sum | cut -d' ' -f1 | xxd -r -p | base64)" |
There was a problem hiding this comment.
This line depends on xxd -r -p, which is not in this stage's BUILD_PKGS. Context worth flagging: on master this helper lives in the eve-alpine base image (pkg/alpine/, copied to /bin/) and runs there; this branch instead carries a local copy and runs it in the debug build stage against a different eve-alpine pin (80c5dbe1…). So master's successful builds don't prove xxd is present here.
In Alpine xxd is usually available as a busybox applet, so this likely works — but it's an unverified assumption that breaks the whole build under set -e if wrong. Since openssl is already available in this stage (the test script uses openssl passwd), a dependency-free alternative avoids the risk entirely:
| PKG_CSUM="Q1$(printf '%s' "${PKG_NAME}-${PKG_VERSION}" | sha1sum | cut -d' ' -f1 | xxd -r -p | base64)" | |
| PKG_CSUM="Q1$(printf '%s' "${PKG_NAME}-${PKG_VERSION}" | openssl dgst -sha1 -binary | base64)" |
Please either confirm xxd is present in this build image or switch to the above.
|
Claude finished @shjala's task in 2m 22s —— View job Review: OpenSSH 10.6p2 backport to 14.5-stable
I reviewed Verified correct
Findings (inline)
Couldn't verify here
|
|
|
||
| WORKDIR /usr/src | ||
| ADD https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src | ||
| ADD --checksum=sha256:9ae44872090cf2f06b3cf9ff147e7f16f309671340763ed2f99248398ae29d5b https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src |
There was a problem hiding this comment.
Build-breaking risk. ADD --checksum= for a remote URL requires Dockerfile frontend ≥ 1.6, but line 1 still pins # syntax=docker/dockerfile-upstream:1.5.0-rc2-labs, which predates the flag. Under that frontend BuildKit rejects the directive (unknown flag: checksum) before the GPG verify runs. I grepped the repo: this is the only ADD --checksum usage, and master also pins 1.5.0-rc2-labs, so there is no precedent that it works here.
The PR says CI image builds passed — please confirm the pkg/debug image was actually rebuilt in that run (not a cache hit), since that would contradict the frontend limitation.
Note the detached-signature verify on lines 75–76 (gpg --verify openssh-*.tar.gz.asc) already guarantees integrity + authenticity, so --checksum is redundant here. Safest fix (matches master):
| ADD --checksum=sha256:9ae44872090cf2f06b3cf9ff147e7f16f309671340763ed2f99248398ae29d5b https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src | |
| ADD https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz /usr/src |
Alternatively bump the # syntax= directive to a frontend that supports --checksum (e.g. docker/dockerfile:1.9), but that is a broader change to validate.
| # key. Two of them then collide and apk frees a still-referenced package | ||
| # (SIGSEGV); a single one makes apk commit a DB truncated at that record. No .apk | ||
| # file exists to hash, so derive a stable synthetic SHA-1 from name and version. | ||
| PKG_CSUM="Q1$(printf '%s' "${PKG_NAME}-${PKG_VERSION}" | sha1sum | cut -d' ' -f1 | xxd -r -p | base64)" |
There was a problem hiding this comment.
xxd -r -p is not in this stage's BUILD_PKGS. In Alpine xxd is a busybox applet (busybox ≥ 1.30), so this likely works in the eve-alpine base — but it's an unverified assumption that would break the whole build under set -e if the applet is absent or the pinned busybox lacks -r -p. Since openssl is already available in this stage, a dependency-free equivalent removes the risk entirely:
| PKG_CSUM="Q1$(printf '%s' "${PKG_NAME}-${PKG_VERSION}" | sha1sum | cut -d' ' -f1 | xxd -r -p | base64)" | |
| PKG_CSUM="Q1$(printf '%s' "${PKG_NAME}-${PKG_VERSION}" | openssl dgst -sha1 -binary | base64)" |
| RUN /usr/bin/install -c -m 0755 -s sshd-session /out/usr/lib/ssh/sshd-session | ||
| RUN /usr/bin/install -c -m 0755 -s sshd-auth /out/usr/lib/ssh/sshd-auth | ||
| RUN /usr/bin/install -c -m 0755 -s ssh-pkcs11-helper /out/usr/lib/ssh/ssh-pkcs11-helper | ||
| RUN /usr/bin/install -c -m 0755 -s ssh-sk-helper /out/usr/lib/ssh/ssh-sk-helper |
There was a problem hiding this comment.
Two undocumented behavior changes landed alongside the /usr/libexec → /usr/lib/ssh relocation — both reasonable for a publickey-only debug container, but please confirm they're deliberate and add a line to the PR description:
- The setuid
ssh-keysignhelper (previouslyinstall -m 4711 … ssh-keysign) is no longer installed, which disables client-side hostbased authentication (and drops a setuid-root binary). --with-ssl-enginewas dropped from./configure(line 95). The OpenSSL ENGINE API is deprecated under OpenSSL 3.x so this is fine, but it removes any path that relied on an OpenSSL engine for key operations.
OpenSSH 10.6p2 treats seccomp setup failures as fatal. QEMU user-mode cannot install the filter, so the upstream connection tests block 14.5-stable publishing after lf-edge#7049. Keep the production sandbox enabled and run the RISC-V tests in a full-system VM before publishing. Preserve the existing amd64 and arm64 test step. Check the upstream suite, SSHole regression and production authentication settings in the guest, and require an explicit success marker. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
OpenSSH 10.6p2 aborts when seccomp setup fails under QEMU user-mode, causing the upstream connection tests to block RISC-V publishing after lf-edge#7049. Remove the in-build upstream make tests invocation, matching 13.4-stable. Keep the SSHole regression and debug test stage unchanged. Refresh the installer debug-image pin. No OpenSSH source or production sandbox configuration changes. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
OpenSSH 10.6p2 aborts when seccomp setup fails under QEMU user-mode, causing the upstream connection tests to block RISC-V publishing after lf-edge#7049. Skip that upstream test step only for the riscv64 target; retain it for amd64 and arm64. Keep the SSHole regression and debug test stage unchanged. Refresh the installer debug-image pin. No OpenSSH source or production sandbox configuration changes. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
OpenSSH 10.6p2 aborts when seccomp setup fails under QEMU user-mode, causing the upstream connection tests to block RISC-V publishing after #7049. Skip that upstream test step only for the riscv64 target; retain it for amd64 and arm64. Keep the SSHole regression and debug test stage unchanged. Refresh the installer debug-image pin. No OpenSSH source or production sandbox configuration changes. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
Description
Standalone OpenSSH security upgrade for 14.5-stable. This is not a cherry-pick of #7046: master uses Alpine 3.22 packages, while this branch retains its existing source build. Alpine 3.16 now has a patched 9.0p1 package, but using it would downgrade this branch from 9.8p1.
This PR combines both required protections:
Keep this branch's existing OpenSSH source build and detached-signature verification. Upgrade to the checksum-pinned 10.6p2 archive, remove the utmpx patch already included upstream, install the new sshd-auth helper, and align the helper installation directory with the shipped SFTP configuration. No custom changes to upstream OpenSSH functions. Carry an unchanged copy of master's register-sbom-pkg.sh because the branch lacks that helper, so the SBOM records OpenSSH 10.6p2.
Update the installer debug-image pin to the hash built by this branch. The test accounts and keys are confined to disposable test stages; they are not shipped.
PR dependencies
None. This standalone source upgrade does not depend on master PR #7046. Password-authentication hardening is already merged on this branch.
How to test and validate this PR
make check-docker-hashes-consistencypasses locally; the installer debug-image pin was also independently compared withlinuxkit pkg show-tag pkg/debug(older branch checkers exclude that Dockerfile).sshd -Tstill reportsPasswordAuthentication noandKbdInteractiveAuthentication no.docker build --target test pkg/debug.ssh -Vreports 10.6p2.Local amd64 validation: the isolated branch-specific OpenSSH build, bypass regression, public-key login, SFTP and production authentication settings passed. A completed full debug test build is not claimed for this branch. Docker's fetch of the pre-existing lshw archive previously failed with an HTTP/2 stream error. The repository URL is unchanged.
GitHub CI package and full EVE image builds passed for amd64 and arm64. SPDX, Docker hash consistency and Yetus checks passed. Eden/evetest remains pending; Go Tests is still running. No physical-device or RISC-V execution is claimed.
Changelog notes
Upgrade OpenSSH to 10.6p2 to fix the musl password-authentication bypass. SSH access is public-key only.
PR Backports
This is an independent change for 14.5-stable; do not cherry-pick the Alpine 3.22 package change from #7046. Related fixes: master #7046, 17.0-stable #7047, 16.0-stable #7048, 14.5-stable #7049 and 13.4-stable #7050. No hotfix branches are targeted.
Checklist