The Wire · Showcase
GO CRYPTO FIXES RSA KEY INTEROP WHILE RUNTIME CATCHES ARM64 SCANNING BUG
By RepoJournal · Filed · About Go
The crypto/ssh package is raising its RSA modulus limit to 16384 bits to accept keys that OpenSSH actually generates, while the runtime team patches a critical garbage collection miss on ARM64.
The ssh package [1] had capped RSA modulus at 8192 bits to bound CPU costs, but that rejected valid keys from ssh-keygen. This limit is now raised to 16384 bits across both the public key parser and OpenSSH private key parser, with prime factors capped at 8192. Alongside this, ssh error messages [2] are being sanitized to prevent control character injection from untrusted peers, and the server no longer tears down connections [3] when it encounters an unparseable public key, allowing clients to fall back to other authentication methods. On the runtime side, ARM64 systems have a critical bug [6] where small frames created during async preemption aren't scanned for pointers, meaning objects referenced by R30 can be garbage collected prematurely. The HTTP/3 implementation [4] now properly handles the 100 Continue expectation, and the compiler [5] removed a now-useless ABIConfig.Copy method that was treating returns as fresh copies when it was just returning itself.
Action items
- → Update golang/crypto immediately if you use ssh with RSA keys larger than 8192 bits golang/crypto [immediate]
- → Upgrade to latest golang/go if running ARM64 in production to patch the GC scanning miss golang/go [immediate]
- → Review ssh error handling if you parse untrusted public keys golang/crypto [plan]
References
- [1] ssh: raise the RSA modulus limit to 16384 bits golang/crypto
- [2] ssh: sanitize various error messages golang/crypto
- [3] ssh: don't close the connection on an unparseable public key golang/crypto
- [4] internal/http3: prevent request body read when 100 status was not sent golang/net
- [5] cmd/compile: remove no-op ABIConfig.Copy golang/go
- [6] runtime: be sure to scan small frame introduced by (*sigctxt).pushCall golang/go