Skip to contentSkip to conversation

dropbear: Fix CVE-2020-36254

PATCH Superseded Ernst Sjöstrand 3 participants 5 messages Dec 21, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/1 dropbear: Fix CVE-2020-36254

Dropbear shares a lot of code with other SSH implementations, so this is a port of CVE-2018-20685 to dropbear.

Reference:
https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff

---
Rename the patch file to make sure cve-check picks it up.

 meta/recipes-core/dropbear/dropbear.inc       |  4 +++-
 .../dropbear/dropbear/CVE-2020-36254.patch    | 23 +++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch
meta/recipes-core/dropbear/dropbear.inc +3 -1
index d41e8b36dc..b949a9a337 100644
@@ -22,7 +22,9 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
            file://dropbear.socket \
            file://dropbear.default \
            ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
-           ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} "
+           ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \
+           file://CVE-2020-36254.patch \
+           "
 
 PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
                file://0006-dropbear-configuration-file.patch \
meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch new file +23 -0
new file mode 100644
index 0000000000..72ac3e6630
@@ -0,0 +1,23 @@
+From c96c48d62aefc372f2105293ddf8cff2d116dc3a Mon Sep 17 00:00:00 2001
+From: Haelwenn Monnier <[email protected]>
+Date: Mon, 25 May 2020 14:54:29 +0200
+Subject: [PATCH] scp.c: Port OpenSSH CVE-2018-20685 fix (#80)
+
+---
+ scp.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scp.c b/scp.c
+index 742ae00..7b8e7d2 100644
+--- a/scp.c
++++ b/scp.c
+@@ -935,7 +935,8 @@ sink(int argc, char **argv)
+ 			size = size * 10 + (*cp++ - '0');
+ 		if (*cp++ != ' ')
+ 			SCREWUP("size not delimited");
+-		if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
++		if (*cp == '\0' || strchr(cp, '/') != NULL ||
++		    strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
+ 			run_err("error: unexpected filename: %s", cp);
+ 			exit(1);
+ 		}
Signature · 1 line
2.34.0
#2 lore raw
Quoted 7 lines · Ernst Sjöstrand

Dropbear shares a lot of code with other SSH implementations, so this is a port of CVE-2018-20685 to dropbear.

Reference:
https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff

This is missing an Upstream-Status entry - in this case that should be "Upstream-Status: Backport"

Quoted 63 lines

---
Rename the patch file to make sure cve-check picks it up.

  meta/recipes-core/dropbear/dropbear.inc       |  4 +++-
  .../dropbear/dropbear/CVE-2020-36254.patch    | 23 +++++++++++++++++++
  2 files changed, 26 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch

meta/recipes-core/dropbear/dropbear.inc +3 -1
index d41e8b36dc..b949a9a337 100644
@@ -22,7 +22,9 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
             file://dropbear.socket \
             file://dropbear.default \
             ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
-           ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} "
+           ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \
+           file://CVE-2020-36254.patch \
+           "
 
  PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
                 file://0006-dropbear-configuration-file.patch \
meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch new file +23 -1
new file mode 100644
index 0000000000..72ac3e6630
@@ -0,0 +1,23 @@
+From c96c48d62aefc372f2105293ddf8cff2d116dc3a Mon Sep 17 00:00:00 2001
+From: Haelwenn Monnier <[email protected]>
+Date: Mon, 25 May 2020 14:54:29 +0200
+Subject: [PATCH] scp.c: Port OpenSSH CVE-2018-20685 fix (#80)
+
+---
+ scp.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scp.c b/scp.c
+index 742ae00..7b8e7d2 100644
+--- a/scp.c
++++ b/scp.c
+@@ -935,7 +935,8 @@ sink(int argc, char **argv)
+ 			size = size * 10 + (*cp++ - '0');
+ 		if (*cp++ != ' ')
+ 			SCREWUP("size not delimited");
+-		if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
++		if (*cp == '\0' || strchr(cp, '/') != NULL ||
++		    strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
+ 			run_err("error: unexpected filename: %s", cp);
+ 			exit(1);
+ 		}
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#159916): https://lists.openembedded.org/g/openembedded-core/message/159916
Mute This Topic: https://lists.openembedded.org/mt/87876568/3647476
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
Quoted 5 lines · Konrad Weihmann
Quoted 3 lines · Ernst Sjöstrand

Dropbear shares a lot of code with other SSH implementations, so this is a port of CVE-2018-20685 to dropbear.

Quoted 7 lines
Quoted 4 lines

Reference:
https://urldefense.com/v3/__https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff__;!!BFCLnRDDbM3FOmw!qe9UYrBIPEc6nPIeOuTW0e0hW6_XwL0XE4vWFFUg-UeQcxixYMRQ__QllRTD9Iw88H1k2OWm0g$

This is missing an Upstream-Status entry - in this case that should be "Upstream-Status: Backport"

Should that line go in the .patch file, the commit message or both? I guess both?

#4 lore raw
Quoted 10 lines · Ernst Sjöstrand
Quoted 8 lines · Konrad Weihmann
Quoted 6 lines · Ernst Sjöstrand

Dropbear shares a lot of code with other SSH implementations, so this is a port of CVE-2018-20685 to dropbear.

Reference:
https://urldefense.com/v3/__https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff__;!!BFCLnRDDbM3FOmw!qe9UYrBIPEc6nPIeOuTW0e0hW6_XwL0XE4vWFFUg-UeQcxixYMRQ__QllRTD9Iw88H1k2OWm0g$

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

This is missing an Upstream-Status entry - in this case that should be "Upstream-Status: Backport"

Should that line go in the .patch file, the commit message or both? I guess both?

See the "Patch name convention and commit message" section at:

https://wiki.yoctoproject.org/wiki/Security

Thanks for helping out with CVE fixes!

Steve

Quoted 8 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159918): https://lists.openembedded.org/g/openembedded-core/message/159918
Mute This Topic: https://lists.openembedded.org/mt/87876568/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw

PATCH v3 1/1 dropbear: Fix CVE-2020-36254

Dropbear shares a lot of code with other SSH implementations, so this is a port of CVE-2018-20685 to dropbear by the dropbear developers.

Reference:
https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff

CVE: CVE-2020-36254
Upstream-Status: Backport

---
 meta/recipes-core/dropbear/dropbear.inc       |  4 ++-
 .../dropbear/dropbear/CVE-2020-36254.patch    | 29 +++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch
meta/recipes-core/dropbear/dropbear.inc +3 -1
index d41e8b36dcd..b949a9a3372 100644
@@ -22,7 +22,9 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
            file://dropbear.socket \
            file://dropbear.default \
            ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
-           ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} "
+           ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \
+           file://CVE-2020-36254.patch \
+           "
 
 PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
                file://0006-dropbear-configuration-file.patch \
meta/recipes-core/dropbear/dropbear/CVE-2020-36254.patch new file +29 -0
new file mode 100644
index 00000000000..64d0d96486c
@@ -0,0 +1,29 @@
+From c96c48d62aefc372f2105293ddf8cff2d116dc3a Mon Sep 17 00:00:00 2001
+From: Haelwenn Monnier <[email protected]>
+Date: Mon, 25 May 2020 14:54:29 +0200
+Subject: [PATCH] scp.c: Port OpenSSH CVE-2018-20685 fix (#80)
+
+Reference:
+https://github.com/mkj/dropbear/commit/8f8a3dff705fad774a10864a2e3dbcfa9779ceff
+
+CVE: CVE-2020-36254
+Upstream-Status: Backport
+
+---
+ scp.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scp.c b/scp.c
+index 742ae00..7b8e7d2 100644
+--- a/scp.c
++++ b/scp.c
+@@ -935,7 +935,8 @@ sink(int argc, char **argv)
+ 			size = size * 10 + (*cp++ - '0');
+ 		if (*cp++ != ' ')
+ 			SCREWUP("size not delimited");
+-		if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
++		if (*cp == '\0' || strchr(cp, '/') != NULL ||
++		    strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
+ 			run_err("error: unexpected filename: %s", cp);
+ 			exit(1);
+ 		}
Signature · 1 line
2.34.1