Skip to content

[Go 1.23.0] CVE-2026-39832: ssh/agent: reject keys with unsupported confirm constraint - #12

Open
Atharva-Shinde wants to merge 1 commit into
openshift-sustaining:sustaining-v0.41.0from
Atharva-Shinde:sustaining-v0.41.0
Open

[Go 1.23.0] CVE-2026-39832: ssh/agent: reject keys with unsupported confirm constraint#12
Atharva-Shinde wants to merge 1 commit into
openshift-sustaining:sustaining-v0.41.0from
Atharva-Shinde:sustaining-v0.41.0

Conversation

@Atharva-Shinde

@Atharva-Shinde Atharva-Shinde commented Jul 31, 2026

Copy link
Copy Markdown

Process

# branch_setup.py — checked out upstream/sustaining-v0.41.0
# git am failed — patch context mismatch, user resolved manually

Conflicts

  • ssh/agent/keyring.go: Patch expected ConstraintExtensions rejection check to already exist — v0.41.0 does not have it. User applied ConfirmBeforeUse check manually.
  • ssh/agent/keyring_test.go: Patch expected TestAddKeyWithConstraintExtensions test — not present in v0.41.0. User added new test manually.

Patch Source

https://go-review.googlesource.com/changes/crypto~778642/revisions/3/patch?download&raw

v0.41.0-GO-2026-5006-0.patch

Verification

Runtime gates: none

Unit tests output
crypto git:(sustaining-v0.41.0) go test ./...
?       golang.org/x/crypto/acme/autocert/internal/acmetest  [no test files]
?       golang.org/x/crypto/acme/internal/acmeprobe [no test files]
?       golang.org/x/crypto/cryptobyte/asn1     [no test files]
?       golang.org/x/crypto/internal/testenv    [no test files]
?       golang.org/x/crypto/internal/wycheproof/internal/dsa [no test files]
?       golang.org/x/crypto/openpgp/errors      [no test files]
ok      golang.org/x/crypto/acme        9.473s
ok      golang.org/x/crypto/acme/autocert       3.739s
ok      golang.org/x/crypto/argon2      4.389s
ok      golang.org/x/crypto/bcrypt      2.253s
ok      golang.org/x/crypto/blake2b     3.931s
ok      golang.org/x/crypto/blake2s     2.614s
ok      golang.org/x/crypto/blowfish    1.790s
ok      golang.org/x/crypto/bn256       5.340s
ok      golang.org/x/crypto/cast5       2.823s
ok      golang.org/x/crypto/chacha20    3.051s
ok      golang.org/x/crypto/chacha20poly1305    1.385s
ok      golang.org/x/crypto/cryptobyte  4.803s
ok      golang.org/x/crypto/curve25519  5.600s
ok      golang.org/x/crypto/ed25519     6.005s
ok      golang.org/x/crypto/hkdf        5.058s
ok      golang.org/x/crypto/internal/alias      5.105s
ok      golang.org/x/crypto/internal/poly1305   5.045s
ok      golang.org/x/crypto/internal/wycheproof 6.581s
ok      golang.org/x/crypto/md4 5.322s
ok      golang.org/x/crypto/nacl/auth   5.648s
ok      golang.org/x/crypto/nacl/box    5.232s
ok      golang.org/x/crypto/nacl/secretbox      5.459s
?       golang.org/x/crypto/poly1305    [no test files]
ok      golang.org/x/crypto/nacl/sign   5.457s
ok      golang.org/x/crypto/ocsp        5.495s
ok      golang.org/x/crypto/openpgp     6.432s
ok      golang.org/x/crypto/openpgp/armor       5.477s
?       golang.org/x/crypto/ssh/terminal        [no test files]
ok      golang.org/x/crypto/openpgp/clearsign   14.068s
ok      golang.org/x/crypto/openpgp/elgamal     5.432s
ok      golang.org/x/crypto/openpgp/packet      5.404s
ok      golang.org/x/crypto/openpgp/s2k 6.399s
ok      golang.org/x/crypto/otr 5.081s
ok      golang.org/x/crypto/pbkdf2      4.882s
ok      golang.org/x/crypto/pkcs12      5.023s
ok      golang.org/x/crypto/pkcs12/internal/rc2 5.191s
ok      golang.org/x/crypto/ripemd160   5.484s
ok      golang.org/x/crypto/salsa20     5.870s
ok      golang.org/x/crypto/salsa20/salsa       5.837s
ok      golang.org/x/crypto/scrypt      5.878s
ok      golang.org/x/crypto/sha3        7.299s
ok      golang.org/x/crypto/ssh 7.003s
ok      golang.org/x/crypto/ssh/agent   5.485s
ok      golang.org/x/crypto/ssh/internal/bcrypt_pbkdf5.551s
ok      golang.org/x/crypto/ssh/knownhosts      4.933s
ok      golang.org/x/crypto/ssh/test    7.203s
ok      golang.org/x/crypto/tea 5.262s
ok      golang.org/x/crypto/twofish     5.440s
ok      golang.org/x/crypto/x509roots/nss       5.443s
ok      golang.org/x/crypto/xtea        5.443s
ok      golang.org/x/crypto/xts 5.450s

The in-memory keyring supports the "lifetime" constraint but does not
implement the "confirm" constraint. Previously, keyring.Add silently
ignored ConfirmBeforeUse: the key was stored, advertised through List,
and used for signing without any interactive confirmation, potentially
misleading callers into believing this security measure was enforced.

Return an error when ConfirmBeforeUse is set instead of silently
downgrading the caller's security expectations. Implementing real
confirm-before-use in an in-memory library keyring is infeasible (there
is no UI or confirmation callback), so failing closed is the correct
behavior; adding actual confirm support would require an API addition
and is out of scope.

This is a deliberate behavior change: keyring.Add previously accepted
and ignored ConfirmBeforeUse and now returns an error. This change also
updates the keyring doc comments to document the supported constraints.

This issue was found during a security audit by NCC Group Cryptography
Services, sponsored by Teleport.

Fixes CVE-2026-39833
Updates golang/go#47533
Fixes golang/go#79436

Change-Id: I1b3a286f0c1e4a4e08ac37109f7e491692ca90ae
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/778642
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-by: Neal Patel <neal@golang.org>
Auto-Submit: Neal Patel <nealpatel@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants