Skip to contentSkip to conversation

package/putty: patch CVE-2026-4885{0, 1, 2}

PATCH Applied Thomas Perale via buildroot 1 participant 2 messages May 27 – May 29

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/putty: patch CVE-2026-4885{0, 1, 2}

- CVE-2026-48850:
PuTTY 0.72 before 0.84 has a double free in RSA KEX.

For more information, see:
- https://www.cve.org/CVERecord?id=CVE-2026-48850

- CVE-2026-48851:
PuTTY 0.77 before 0.84 uses a copy of the PuTTY icon as a trust indication for TELNET data but the trust status is not cleared between proxy authentication and the main session.

For more information, see:
- https://www.cve.org/CVERecord?id=CVE-2026-48851

- CVE-2026-48852:
PuTTY 0.71 before 0.84 has an assertion failure in ECDSA signature verification.

For more information, see:
- https://www.cve.org/CVERecord?id=CVE-2026-48852

---
 package/putty/0002-CVE-2026-48850.patch |  53 ++++++++++++
 package/putty/0003-CVE-2026-48851.patch | 108 ++++++++++++++++++++++++
 package/putty/0004-CVE-2026-48852.patch |  90 ++++++++++++++++++++
 package/putty/putty.mk                  |   7 ++
 4 files changed, 258 insertions(+)
 create mode 100644 package/putty/0002-CVE-2026-48850.patch
 create mode 100644 package/putty/0003-CVE-2026-48851.patch
 create mode 100644 package/putty/0004-CVE-2026-48852.patch
package/putty/0002-CVE-2026-48850.patch new file +53 -0
new file mode 100644
index 0000000000..1c7b378f1d
@@ -0,0 +1,53 @@
+From ba3ed53e0bf6682f89940bc2c3e83da6b1524024 Mon Sep 17 00:00:00 2001
+From: Simon Tatham <[email protected]>
+Date: Thu, 14 May 2026 18:15:56 +0100
+Subject: [PATCH] Don't call sfree after ssh_rsakex_freekey.
+
+ssh_rsakex_freekey(), given an RSAKey structure, calls freersakey() to
+free all the pieces dangling off it, and then finally frees the RSAKey
+itself. So calling ssh_rsakex_freekey() and _then_ sfree() is a double
+free.
+
+Upstream: https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=ba3ed53e0bf6682f89940bc2c3e83da6b1524024
+CVE: CVE-2026-48850
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ ssh/kex2-server.c | 4 +---
+ ssh/transport2.c  | 4 +---
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/ssh/kex2-server.c b/ssh/kex2-server.c
+index 570d7750..8c3dc2f4 100644
+--- a/ssh/kex2-server.c
++++ b/ssh/kex2-server.c
+@@ -321,10 +321,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted)
+         put_mp_ssh2(s->kex_shared_secret, K);
+         mp_free(K);
+ 
+-        if (s->rsa_kex_key_needs_freeing) {
++        if (s->rsa_kex_key_needs_freeing)
+             ssh_rsakex_freekey(s->rsa_kex_key);
+-            sfree(s->rsa_kex_key);
+-        }
+         s->rsa_kex_key = NULL;
+         s->rsa_kex_key_needs_freeing = false;
+ 
+diff --git a/ssh/transport2.c b/ssh/transport2.c
+index 64f40560..60a99c29 100644
+--- a/ssh/transport2.c
++++ b/ssh/transport2.c
+@@ -251,10 +251,8 @@ static void ssh2_transport_free(PacketProtocolLayer *ppl)
+     if (s->kex_shared_secret) strbuf_free(s->kex_shared_secret);
+     if (s->dh_ctx)
+         dh_cleanup(s->dh_ctx);
+-    if (s->rsa_kex_key_needs_freeing) {
++    if (s->rsa_kex_key_needs_freeing)
+         ssh_rsakex_freekey(s->rsa_kex_key);
+-        sfree(s->rsa_kex_key);
+-    }
+     if (s->ecdh_key)
+         ecdh_key_free(s->ecdh_key);
+     if (s->exhash)
+-- 
+2.54.0
+
package/putty/0003-CVE-2026-48851.patch new file +108 -0

108 lines not on this page · raw message

package/putty/0004-CVE-2026-48852.patch new file +90 -0

90 lines not on this page · raw message

package/putty/putty.mk +7 -0
index 617518e647..c061c02a96 100644
@@ -12,6 +12,13 @@ PUTTY_CPE_ID_VENDOR = putty
 PUTTY_DEPENDENCIES = host-pkgconf
 PUTTY_CONF_OPTS = -DPUTTY_GSSAPI=OFF
 
+# 0002-CVE-2026-48850.patch
+PUTTY_IGNORE_CVES += CVE-2026-48850
+# 0003-CVE-2026-48851.patch
+PUTTY_IGNORE_CVES += CVE-2026-48851
+# 0004-CVE-2026-48852.patch
+PUTTY_IGNORE_CVES += CVE-2026-48852
+
 ifeq ($(BR2_PACKAGE_LIBGTK3),y)
 PUTTY_DEPENDENCIES += libgtk3
 else ifeq ($(BR2_PACKAGE_LIBGTK2),y)
Signature · 6 lines
2.54.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

In reply of:

Quoted 14 lines

- CVE-2026-48850:
PuTTY 0.72 before 0.84 has a double free in RSA KEX.

For more information, see:
- https://www.cve.org/CVERecord?id=CVE-2026-48850

- CVE-2026-48851:
PuTTY 0.77 before 0.84 uses a copy of the PuTTY icon as a trust indication for TELNET data but the trust status is not cleared between proxy authentication and the main session.

For more information, see:
- https://www.cve.org/CVERecord?id=CVE-2026-48851

Quoted 8 lines

- CVE-2026-48852:
PuTTY 0.71 before 0.84 has an assertion failure in ECDSA signature verification.

For more information, see:
- https://www.cve.org/CVERecord?id=CVE-2026-48852

Applied to 2025.02.x. Thanks

Quoted 304 lines
---
 package/putty/0002-CVE-2026-48850.patch |  53 ++++++++++++
 package/putty/0003-CVE-2026-48851.patch | 108 ++++++++++++++++++++++++
 package/putty/0004-CVE-2026-48852.patch |  90 ++++++++++++++++++++
 package/putty/putty.mk                  |   7 ++
 4 files changed, 258 insertions(+)
 create mode 100644 package/putty/0002-CVE-2026-48850.patch
 create mode 100644 package/putty/0003-CVE-2026-48851.patch
 create mode 100644 package/putty/0004-CVE-2026-48852.patch
package/putty/0002-CVE-2026-48850.patch new file +53 -0
new file mode 100644
index 0000000000..1c7b378f1d
@@ -0,0 +1,53 @@
+From ba3ed53e0bf6682f89940bc2c3e83da6b1524024 Mon Sep 17 00:00:00 2001
+From: Simon Tatham <[email protected]>
+Date: Thu, 14 May 2026 18:15:56 +0100
+Subject: [PATCH] Don't call sfree after ssh_rsakex_freekey.
+
+ssh_rsakex_freekey(), given an RSAKey structure, calls freersakey() to
+free all the pieces dangling off it, and then finally frees the RSAKey
+itself. So calling ssh_rsakex_freekey() and _then_ sfree() is a double
+free.
+
+Upstream: https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=ba3ed53e0bf6682f89940bc2c3e83da6b1524024
+CVE: CVE-2026-48850
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ ssh/kex2-server.c | 4 +---
+ ssh/transport2.c  | 4 +---
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/ssh/kex2-server.c b/ssh/kex2-server.c
+index 570d7750..8c3dc2f4 100644
+--- a/ssh/kex2-server.c
++++ b/ssh/kex2-server.c
+@@ -321,10 +321,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted)
+         put_mp_ssh2(s->kex_shared_secret, K);
+         mp_free(K);
+ 
+-        if (s->rsa_kex_key_needs_freeing) {
++        if (s->rsa_kex_key_needs_freeing)
+             ssh_rsakex_freekey(s->rsa_kex_key);
+-            sfree(s->rsa_kex_key);
+-        }
+         s->rsa_kex_key = NULL;
+         s->rsa_kex_key_needs_freeing = false;
+ 
+diff --git a/ssh/transport2.c b/ssh/transport2.c
+index 64f40560..60a99c29 100644
+--- a/ssh/transport2.c
++++ b/ssh/transport2.c
+@@ -251,10 +251,8 @@ static void ssh2_transport_free(PacketProtocolLayer *ppl)
+     if (s->kex_shared_secret) strbuf_free(s->kex_shared_secret);
+     if (s->dh_ctx)
+         dh_cleanup(s->dh_ctx);
+-    if (s->rsa_kex_key_needs_freeing) {
++    if (s->rsa_kex_key_needs_freeing)
+         ssh_rsakex_freekey(s->rsa_kex_key);
+-        sfree(s->rsa_kex_key);
+-    }
+     if (s->ecdh_key)
+         ecdh_key_free(s->ecdh_key);
+     if (s->exhash)
+-- 
+2.54.0
+
package/putty/0003-CVE-2026-48851.patch new file +108 -0
new file mode 100644
index 0000000000..1985369061
@@ -0,0 +1,108 @@
+From 64712be3cbc4a02bda4a92ca97e8d4f294abbe9a Mon Sep 17 00:00:00 2001
+From: Simon Tatham <[email protected]>
+Date: Thu, 27 Feb 2025 12:51:18 +0000
+Subject: [PATCH] Non-SSH backends: delay setting trust status to false.
+
+A user reported recently that if you connect to a Telnet server via a
+proxy that requires authentication, and enter the auth details
+manually in the PuTTY terminal window, then the entire Telnet session
+is shown with trust sigils to its left.
+
+This happens because telnet.c calls seat_set_trust_status(false) as
+soon as it's called new_connection() to make the Socket. But the
+interactive proxy authentication dialogue hasn't happened yet, at that
+point. So the proxy resets the trust status to true and asks for a
+username and password, and then nothing ever resets it to false,
+because telnet.c thought it had already done that.
+
+The solution is to defer the Telnet backend's change of trust status
+to when we get the notification that the socket is properly connected,
+which arrives via plug_log(PLUGLOG_CONNECT_SUCCESS).
+
+The same bug occurs in raw.c and supdup.c, but not in rlogin.c,
+because Rlogin has an initial authentication exchange known to the
+protocol, and already delays resetting the trust status until after
+that has concluded.
+
+Upstream: https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=64712be3cbc4a02bda4a92ca97e8d4f294abbe9a
+CVE: CVE-2026-48851
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ otherbackends/raw.c    | 6 +++---
+ otherbackends/supdup.c | 4 +++-
+ otherbackends/telnet.c | 6 +++---
+ 3 files changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/otherbackends/raw.c b/otherbackends/raw.c
+index 9fc5e4c8..01c776e2 100644
+--- a/otherbackends/raw.c
++++ b/otherbackends/raw.c
+@@ -46,6 +46,9 @@ static void raw_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
+         raw->socket_connected = true;
+         if (raw->ldisc)
+             ldisc_check_sendok(raw->ldisc);
++
++        /* No local authentication phase in this protocol */
++        seat_set_trust_status(raw->seat, false);
+     }
+ }
+ 
+@@ -209,9 +212,6 @@ static char *raw_init(const BackendVtable *vt, Seat *seat,
+     if ((err = sk_socket_error(raw->s)) != NULL)
+         return dupstr(err);
+ 
+-    /* No local authentication phase in this protocol */
+-    seat_set_trust_status(raw->seat, false);
+-
+     loghost = conf_get_str(conf, CONF_loghost);
+     if (*loghost) {
+         char *colon;
+diff --git a/otherbackends/supdup.c b/otherbackends/supdup.c
+index f9680f30..8f814797 100644
+--- a/otherbackends/supdup.c
++++ b/otherbackends/supdup.c
+@@ -570,6 +570,9 @@ static void supdup_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
+         supdup->socket_connected = true;
+         if (supdup->ldisc)
+             ldisc_check_sendok(supdup->ldisc);
++
++        /* No local authentication phase in this protocol */
++        seat_set_trust_status(supdup->seat, false);
+     }
+ }
+ 
+@@ -812,7 +815,6 @@ static char *supdup_init(const BackendVtable *x, Seat *seat,
+      * We next expect a connection message followed by %TDNOP from the server
+      */
+     supdup->state = CONNECTING;
+-    seat_set_trust_status(supdup->seat, false);
+ 
+     /* Make sure the terminal is in UTF-8 mode. */
+     c_write(supdup, (unsigned char *)utf8, strlen(utf8));
+diff --git a/otherbackends/telnet.c b/otherbackends/telnet.c
+index 2f12722c..7f1e4977 100644
+--- a/otherbackends/telnet.c
++++ b/otherbackends/telnet.c
+@@ -632,6 +632,9 @@ static void telnet_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
+         telnet->socket_connected = true;
+         if (telnet->ldisc)
+             ldisc_check_sendok(telnet->ldisc);
++
++        /* No local authentication phase in this protocol */
++        seat_set_trust_status(telnet->seat, false);
+     }
+ }
+ 
+@@ -782,9 +785,6 @@ static char *telnet_init(const BackendVtable *vt, Seat *seat,
+     if ((err = sk_socket_error(telnet->s)) != NULL)
+         return dupstr(err);
+ 
+-    /* No local authentication phase in this protocol */
+-    seat_set_trust_status(telnet->seat, false);
+-
+     telnet->pinger = pinger_new(telnet->conf, &telnet->backend);
+ 
+     /*
+-- 
+2.54.0
+
package/putty/0004-CVE-2026-48852.patch new file +90 -0
new file mode 100644
index 0000000000..34cbb986ac
@@ -0,0 +1,90 @@
+From 65b8f37c34cd80680693e813e0081cdafaf58324 Mon Sep 17 00:00:00 2001
+From: Simon Tatham <[email protected]>
+Date: Sat, 28 Mar 2026 19:25:24 +0000
+Subject: [PATCH] Remove bogus assertion in ecc_weierstrass_add.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The comment next to the assertion says that it's checking for either
+identical inputs or mutually inverse ones: that is, input curve points
+with the same affine x-coordinate. But in that case we should have
+checked lambda_n, the _numerator_ of the slope of the line through the
+input points. Instead we were accidentally checking lambda_d, the
+denominator.
+
+ecc_weierstrass_add_general gets this right: it checks lambda_n to
+decide whether to use the output of the unequal-point addition formula
+or the doubling formula.
+
+The obvious fix is to replace the assertion with one checking
+lambda_n. But that doesn't work, because it's possible during
+legitimate operation to cause a call to ecc_weierstrass_add that would
+fail the fixed version of the assertion! Because of constant-time
+considerations, every time ecc_weierstrass_multiply consumes a bit of
+the exponent, it calculates both of two possible outputs of that
+iteration step, and then selects between them. And sometimes one of
+those outputs _does_ involve passing mutually inverse values to
+ecc_weierstrass_add. That's harmless if the result of that calculation
+is thrown away by the caller – except that it's not harmless if you
+fail an assertion and crash before getting back _to_ the caller!
+
+(With the current style of exponentiation loop, the case that would
+fail the 'right' assertion involves raising a point P to its own order
+minus 1, because we're consuming the exponent from the MSB downwards,
+so at every stage we choose between P^(2k) and P^(2k+1). But switching
+to the LSB-upwards style of repeatedly squaring to make P^{2^n} and
+conditionally multiplying in each of those, you'd still have the same
+failure, just in a different place – the failing case would involve
+raising P to the power of its own order with the leading 1 bit
+removed.)
+
+So that's why we can't replace the bogus assertion with a better one.
+Instead, the only thing to do is remove the assertion completely, and
+rely on callers to have already checked that exponents are in
+range (hence the precautionary fix in ecdsa_public in the previous
+commit).
+
+What about triggering the _actual_ wrong assertion? Guido Vranken
+reported this issue and included a test case that demonstrates that
+it's possible to trigger the bug deliberately. His example case is a
+P256 curve point P such that 10P and 11P have the same y-coordinate,
+and therefore trying to compute 21P will add those values together and
+fail the previous assertion. Worse, it's easy to construct a malicious
+P256 public key and signature such that attempting to verify that
+signature provokes the same crash – no matter what the message is. So
+this is a DoS vector for an on-path attacker, who can make PuTTY crash
+by substituting this fixed P256 key and signature in the cleartext
+initial key exchange of any SSH connection.
+
+(Only a DoS, though: PuTTY is always compiled with assertions enabled,
+so it won't do anything _worse_ than crash with an unhelpful message.)
+
+Upstream: https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=65b8f37c34cd80680693e813e0081cdafaf58324
+CVE: CVE-2026-48852
+[thomas: backport and remove tests]
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ crypto/ecc-arithmetic.c |  6 ------
+ 1 files changed, 6 deletions(-)
+
+diff --git a/crypto/ecc-arithmetic.c b/crypto/ecc-arithmetic.c
+index ed2abf39..23695369 100644
+--- a/crypto/ecc-arithmetic.c
++++ b/crypto/ecc-arithmetic.c
+@@ -308,12 +308,6 @@ WeierstrassPoint *ecc_weierstrass_add(WeierstrassPoint *P, WeierstrassPoint *Q)
+     ecc_weierstrass_add_prologue(
+         P, Q, &Px, &Py, &Qx, &denom, &lambda_n, &lambda_d);
+ 
+-    /* Never expect to have received two mutually inverse inputs, or
+-     * two identical ones (which would make this a doubling). In other
+-     * words, the two input x-coordinates (after putting over a common
+-     * denominator) should never have been equal. */
+-    assert(!mp_eq_integer(lambda_n, 0));
+-
+     /* Now go to the common epilogue code. */
+     ecc_weierstrass_epilogue(Px, Qx, Py, denom, lambda_n, lambda_d, S);
+ 
+-- 
+2.54.0
+
package/putty/putty.mk +7 -0
index 617518e647..c061c02a96 100644
@@ -12,6 +12,13 @@ PUTTY_CPE_ID_VENDOR = putty
 PUTTY_DEPENDENCIES = host-pkgconf
 PUTTY_CONF_OPTS = -DPUTTY_GSSAPI=OFF
 
+# 0002-CVE-2026-48850.patch
+PUTTY_IGNORE_CVES += CVE-2026-48850
+# 0003-CVE-2026-48851.patch
+PUTTY_IGNORE_CVES += CVE-2026-48851
+# 0004-CVE-2026-48852.patch
+PUTTY_IGNORE_CVES += CVE-2026-48852
+
 ifeq ($(BR2_PACKAGE_LIBGTK3),y)
 PUTTY_DEPENDENCIES += libgtk3
 else ifeq ($(BR2_PACKAGE_LIBGTK2),y)
Signature · 6 lines
2.54.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot