Repository navigation
Conversation
|
Claude finished @shjala's task in 4m 34s —— View job Code Review: Upgrade OpenSSH to 10.6p2
SummarySolid, well-contained change. Key correctness checks pass review:
Inline findings (both low severity)
Cross-cutting considerations (non-blocking)
No blocking issues found. |
d66fefe to
8553375
Compare
|
Claude finished @shjala's task in 2m 56s —— View job Code Review: Upgrade OpenSSH to 10.6p2
VerdictNo blocking issues. The change is well-contained and the security-relevant invariants hold. The two findings from the earlier review pass are resolved on the current commit ( What I verified
Non-blocking notes
I can't formally approve or submit a GitHub review (not permitted for this app), but from a correctness/security standpoint this looks ready. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7046 +/- ##
==========================================
+ Coverage 29.07% 29.59% +0.52%
==========================================
Files 548 559 +11
Lines 99033 100628 +1595
==========================================
+ Hits 28793 29782 +989
- Misses 67969 68619 +650
+ Partials 2271 2227 -44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Alpine released the fix, let's pick from Alpine: https://pkgs.alpinelinux.org/package/v3.22/main/x86_64/openssh https://gitlab.alpinelinux.org/alpine/aports/-/tree/3.22-stable/main/openssh |
|
Actually, PR #7029 should pick the new version already.... I think it will cover this issue.... |
8553375 to
9beff29
Compare
|
Claude finished @shjala's task in 3m 8s —— View job Code Review: OpenSSH password-authentication fix
Context noteThe implementation changed since the PR was opened (commit What holds up well
Findings (both posted inline, non-blocking)
CIAll completed checks pass (Yetus, docker-hash consistency, SBOM coverage, commit-lint, security review); No blocking issues found. |
| # Alpine 3.22 backported the upstream password-authentication fix in r11. | ||
| # Install its signed APKs without rebuilding the shared Alpine package cache. | ||
| # Pin every architecture's archives to keep builds reproducible. | ||
| ENV OPENSSH_VERSION="10.0_p1-r11" |
There was a problem hiding this comment.
The implementation now ships Alpine's backported openssh-10.0_p1-r11, but the PR title ("Upgrade OpenSSH to 10.6p2"), description (from-source build + manual GPG verification), the changelog note ("Update OpenSSH to 10.6p2"), and the validation step ("confirm ssh -V reports 10.6p2") all still describe the previous from-source approach. Please update the PR body/changelog/commit so the release notes match what actually ships — otherwise the published changelog will be wrong, and the two earlier inline review comments on this file (manual GPG, rm -f ssh-keysign) are now stale and no longer apply.
Note this is also a lower OpenSSH base version (10.0 vs 10.6); that's acceptable since Alpine backports the security fix, but it should be called out explicitly given the "upgrade" framing.
One upside worth noting: unlike the from-source variant, apk add here verifies the official Alpine package signatures against the keys in /out at build time (no --allow-untrusted), so signature checking is now reproduced in-build rather than being a manual step.
| echo wrong-password | ||
| exit 0 | ||
| fi | ||
| awk 'BEGIN { for (i=0; i<300; i++) printf "A"; print "" }' |
There was a problem hiding this comment.
The regression was validated to reproduce the bypass against unmodified upstream 10.6p1 (per the original PR notes), but the shipped package is now 10.0_p1. Please confirm this test still reproduces the bypass against the unpatched Alpine 10.0_p1 (i.e. pre-r11) and not only the fixed build — otherwise, if 10.0_p1's code path differs, the test could pass trivially and give a false sense of security without actually guarding the version you ship. A one-line note in the commit message stating the negative-control result against pre-r11 would make this a trustworthy regression guard.
|
@shjala , I confirmed that with this PR #7054 Alpine will pick the fixed version of openssh. For master I prefer to follow this approach (and not merge this PR), because it also gets other updates (that also fixes other CVEs). For stable branches, we need to discuss, maybe we can keep your approach. |
Install Alpine 3.22 OpenSSH 10.0_p1-r11, which backports the upstream musl password-authentication bypass fix. Use signed, SHA-256-pinned APKs for amd64, arm64 and riscv64 without rebuilding the shared package cache. Alpine package metadata supplies the installed version to the SBOM. Keep public-key-only authentication. Add an isolated regression that requires rejection of the bypass and checks public-key login, SFTP and production authentication settings. Refresh the installer debug image pin. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
9beff29 to
558cb14
Compare
|
Claude finished @shjala's task in 3m 4s —— View job Code Review: OpenSSH password-authentication fix
The current commit ( Findings (both posted inline, non-blocking):
What holds up:
Cross-cutting: Per @rene's comment, master is expected to pick up Alpine's fix via #7054 rather than merge this; the manual pin is effectively redundant there. The pin is more relevant for the stable backports (14.5/13.4 need source upgrades since their Alpine would downgrade). No blocking issues found. |
| # Local APK filenames and ADD checksums pin every package version. | ||
| # hadolint ignore=DL3018 | ||
| RUN set -eu; \ | ||
| apk add --no-network --no-cache --root /out /tmp/openssh/*.apk; \ |
There was a problem hiding this comment.
OpenSSH is now installed twice: openssh-client/openssh-server are still in PKGS (line 50, unchanged from master) so eve-alpine-deploy.sh installs whatever version the pinned eve-alpine cache resolves to, and then this step force-installs the pinned r11 APKs on top.
Consequences worth addressing:
- Redundant / confusing source of truth. The effective version depends on both the base cache and the pin. To make the pinned APKs authoritative, drop
openssh-client openssh-serverfromPKGSso there is a single install path. - Fragility if the base ever moves ahead of r11. If a future
eve-alpinebump ships openssh >10.0_p1-r11, thisapk addof the older local files may not take effect, and thegrep -Fxguard would then fail the build on a confusing basis rather than cleanly pinning.
Given maintainer feedback in the thread (rely on Alpine's own fix via #7054 for master, since Alpine now ships the backport), the manual pin is effectively redundant on master. If this lands on stable branches instead, removing openssh from PKGS here would make the pin the single, deterministic source.
| # Password authentication is deliberately ON here: test the upstream fix, | ||
| # independently of EVE's production publickey-only mitigation. | ||
| if DISPLAY=:0 SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/ssh-test/askpass \ | ||
| chroot "$root" /usr/bin/ssh -F /dev/null -p 22222 \ | ||
| -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ | ||
| -o PreferredAuthentications=password -o PubkeyAuthentication=no \ | ||
| -o NumberOfPasswordPrompts=2 ssh-test@127.0.0.1 true; then | ||
| echo 'ERROR: password bypass succeeded' >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
This regression only asserts that password auth is rejected for the * (locked) account. A correctly-behaving sshd rejects that regardless of whether the bypass bug is present, so the test has value only if this exact sequence (salt-priming attempt + 300-char password on the same connection) genuinely reproduces the bypass against the unpatched code path you ship — i.e. Alpine 10.0_p1 pre-r11, not upstream 10.6p1 which the earlier from-source variant was validated against.
Please confirm the negative control: that this test fails (bypass succeeds) when run against 10.0_p1-r0..r10, and note that result in the commit message. Otherwise, if the exploit technique doesn't apply to 10.0_p1's code, the test passes trivially on both vulnerable and fixed builds and gives false assurance for the version actually shipped.
|
Confirmed we already have this version on master, so this PR is not needed (let's avoid introduce more complexity and pin versions manually on master): ~/eve$ docker run --rm -it `make alpine-show-tag` /bin/sh
Unable to find image 'lfedge/eve-alpine:61283a3a978a7cdc9073a1ba678717fc3ea1fe97' locally
61283a3a978a7cdc9073a1ba678717fc3ea1fe97: Pulling from lfedge/eve-alpine
4f1eab66c075: Pull complete
Digest: sha256:402cead0919744d55a270f697d1b2e103f6819b74a2d5856088d2c71df8e4f9a
Status: Downloaded newer image for lfedge/eve-alpine:61283a3a978a7cdc9073a1ba678717fc3ea1fe97
/ # apk add openssh
(1/10) Installing openssh-keygen (10.0_p1-r11)
(2/10) Installing ncurses-terminfo-base (6.5_p20250503-r0)
(3/10) Installing libncursesw (6.5_p20250503-r0)
(4/10) Installing libedit (20250104.3.1-r1)
(5/10) Installing openssh-client-common (10.0_p1-r11)
(6/10) Installing openssh-client-default (10.0_p1-r11)
(7/10) Installing openssh-sftp-server (10.0_p1-r11)
(8/10) Installing openssh-server-common (10.0_p1-r11)
(9/10) Installing openssh-server (10.0_p1-r11)
(10/10) Installing openssh (10.0_p1-r11)
Executing busybox-1.37.0-r20.trigger
OK: 14 MiB in 26 packages
/ # |
rene
left a comment
There was a problem hiding this comment.
This PR is not needed on master.
Description
Use Alpine’s fixed OpenSSH packages on master.
Install Alpine 3.22 OpenSSH 10.0_p1-r11, which includes the upstream musl password-authentication bypass fix. The upstream version number stays 10.0p1 because Alpine backported the fix in package revision r11: Alpine patch.
Use official signed APKs pinned by version and SHA-256 for amd64, arm64 and riscv64, without rebuilding the shared Alpine package cache. Architecture-specific
ADD --checksumstages fetch the APKs; installation runs offline, matching LinuxKit’s network-disabled build steps. Alpine's package database supplies the SBOM version. Update the installer debug-image pin.Password and keyboard-interactive authentication remain disabled. The isolated SSH test deliberately enables password authentication for disposable accounts to check the bypass, public-key login and SFTP. Test accounts and keys are not shipped.
How to test and validate this PR
--network=nonepassed, including SSH regression, public-key login, SFTP, production authentication settings and collect-info tests.make check-docker-hashes-consistencyand SPDX checks passed. Independently compared the installer pin againstlinuxkit pkg show-tag pkg/debug.docker build --network=none --target test pkg/debug.apk info -vreportsopenssh-server-10.0_p1-r11;ssh -Valone does not show Alpine's patch revision.Changelog notes
Fix the OpenSSH musl password-authentication bypass using Alpine's patched packages. SSH access remains public-key only.
PR Backports
Checklist