Skip to contentSkip to conversation

libcurl: Incorrect fix for CVE-2016-8625

PATCH Superseded Jeroen Roovers 3 participants 9 messages Nov 3, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover libcurl: Incorrect fix for CVE-2016-8625

CVE-2016-8625 (IDNA 2003 makes curl use wrong host) was fixed by switching from libidn to libidn2.

Jeroen Roovers (2):
libidn2: new package
libcurl: Use libidn2 instead of libidn

 package/Config.in            |  1 +
 package/libcurl/libcurl.mk   |  2 +-
 package/libidn2/Config.in    |  5 +++++
 package/libidn2/libidn2.hash |  2 ++
 package/libidn2/libidn2.mk   | 12 ++++++++++++
 5 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 package/libidn2/Config.in
 create mode 100644 package/libidn2/libidn2.hash
 create mode 100644 package/libidn2/libidn2.mk
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/2 libidn2: new package

An implementation of the IDNA2008 specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893)

---
 package/Config.in            |  1 +
 package/libidn2/Config.in    |  5 +++++
 package/libidn2/libidn2.hash |  2 ++
 package/libidn2/libidn2.mk   | 12 ++++++++++++
 4 files changed, 20 insertions(+)
 create mode 100644 package/libidn2/Config.in
 create mode 100644 package/libidn2/libidn2.hash
 create mode 100644 package/libidn2/libidn2.mk
package/Config.in +1 -0
index 9ed296f..7ffb756 100644
@@ -1198,6 +1198,7 @@ menu "Networking"
 	source "package/libgsasl/Config.in"
 	source "package/libhttpparser/Config.in"
 	source "package/libidn/Config.in"
+	source "package/libidn2/Config.in"
 	source "package/libiscsi/Config.in"
 	source "package/libldns/Config.in"
 	source "package/libmbus/Config.in"
package/libidn2/Config.in new file +5 -0
new file mode 100644
index 0000000..ce0a841
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_LIBIDN2
+	bool "libidn2"
+
+	help
+	  An implementation of the IDNA2008 specifications (RFCs 5890, 5891, 5892, 5893)
package/libidn2/libidn2.hash new file +2 -0
new file mode 100644
index 0000000..5aedde0
@@ -0,0 +1,2 @@
+# Calculated locally after checking signature
+sha256  3d301890bdbb137424f5ea495f82730a4b85b6a2549e47de3a34afebeac3e0e3  libidn2-0.10.tar.gz
package/libidn2/libidn2.mk new file +12 -0
new file mode 100644
index 0000000..7adc1d8
@@ -0,0 +1,12 @@
+################################################################################
+#
+# libidn2
+#
+################################################################################
+
+LIBIDN2_VERSION = 0.10
+LIBIDN2_SITE = ftp://alpha.gnu.org/gnu/libidn
+LIBIDN2_SOURCE = libidn2-$(LIBIDN2_VERSION).tar.gz
+LIBIDN2_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))
Signature · 1 line
2.10.2
#2 lore raw

PATCH 1/2 libidn2: new package

Hi Jeroen,

package/libidn2/Config.in line 3

Quoted 9 lines · Jeroen Roovers
package/libidn2/Config.in new file +3 -0
new file mode 100644
index 0000000..ce0a841
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_LIBIDN2
+	bool "libidn2"
+

A redundant empty line.

Quoted 16 lines
package/libidn2/Config.in new file +2 -0
+	help
+	  An implementation of the IDNA2008 specifications (RFCs 5890, 5891, 5892, 5893)
package/libidn2/libidn2.hash new file +2 -0
new file mode 100644
index 0000000..5aedde0
@@ -0,0 +1,2 @@
+# Calculated locally after checking signature
+sha256  3d301890bdbb137424f5ea495f82730a4b85b6a2549e47de3a34afebeac3e0e3  libidn2-0.10.tar.gz
package/libidn2/libidn2.mk new file +0 -0
new file mode 100644
index 0000000..7adc1d8

package/libidn2/libidn2.mk line 7

Quoted 7 lines
package/libidn2/libidn2.mk new file +7 -0
@@ -0,0 +1,12 @@
+################################################################################
+#
+# libidn2
+#
+################################################################################
+
+LIBIDN2_VERSION = 0.10

Why not version 0.11?

package/libidn2/libidn2.mk line 9

Quoted 2 lines
package/libidn2/libidn2.mk new file +2 -0
+LIBIDN2_SITE = ftp://alpha.gnu.org/gnu/libidn
+LIBIDN2_SOURCE = libidn2-$(LIBIDN2_VERSION).tar.gz

This is the default.

package/libidn2/libidn2.mk line 12

Quoted 3 lines
package/libidn2/libidn2.mk new file +3 -0
+LIBIDN2_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#3 lore raw

PATCH 1/2 libidn2: new package

Quoted 3 lines · Baruch Siach
Quoted 1 line

+LIBIDN2_VERSION = 0.10

Why not version 0.11?

Interesting. That didn't exist yet until a few moments ago.

Regards,
jer

#4 lore raw

PATCH 1/2 libidn2: new package

In reply to Jeroen Roovers
Quoted 32 lines · Jeroen Roovers

An implementation of the IDNA2008 specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893)

---
 package/Config.in            |  1 +
 package/libidn2/Config.in    |  5 +++++
 package/libidn2/libidn2.hash |  2 ++
 package/libidn2/libidn2.mk   | 12 ++++++++++++
 4 files changed, 20 insertions(+)
 create mode 100644 package/libidn2/Config.in
 create mode 100644 package/libidn2/libidn2.hash
 create mode 100644 package/libidn2/libidn2.mk
package/Config.in +1 -0
index 9ed296f..7ffb756 100644
@@ -1198,6 +1198,7 @@ menu "Networking"
 	source "package/libgsasl/Config.in"
 	source "package/libhttpparser/Config.in"
 	source "package/libidn/Config.in"
+	source "package/libidn2/Config.in"
 	source "package/libiscsi/Config.in"
 	source "package/libldns/Config.in"
 	source "package/libmbus/Config.in"
package/libidn2/Config.in new file +0 -0
new file mode 100644
index 0000000..ce0a841

package/libidn2/Config.in line 5

Quoted 5 lines
package/libidn2/Config.in new file +5 -0
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_LIBIDN2
+	bool "libidn2"
+
+	help
+	  An implementation of the IDNA2008 specifications (RFCs 5890, 5891, 5892, 5893)

The line is too long (wrap at 72 characters).

Upstream URL is missing. Just use http://www.gnu.org/software/libidn/

Shouldn't there be a BR2_PACKAGE_LIBIDN2_BINARY option like for libidn?
Although it looks like the binary is pretty small so not worth it.

package/libidn2/libidn2.hash line 1

Quoted 7 lines
package/libidn2/libidn2.hash new file +1 -0
new file mode 100644
index 0000000..5aedde0
@@ -0,0 +1,2 @@
+# Calculated locally after checking signature

You should add the URL of the signature you checked.

Quoted 7 lines
package/libidn2/libidn2.hash new file +1 -0
+sha256  3d301890bdbb137424f5ea495f82730a4b85b6a2549e47de3a34afebeac3e0e3  libidn2-0.10.tar.gz
package/libidn2/libidn2.mk new file +0 -0
new file mode 100644
index 0000000..7adc1d8

package/libidn2/libidn2.mk line 8

Quoted 8 lines
package/libidn2/libidn2.mk new file +8 -0
@@ -0,0 +1,12 @@
+################################################################################
+#
+# libidn2
+#
+################################################################################
+
+LIBIDN2_VERSION = 0.10
+LIBIDN2_SITE = ftp://alpha.gnu.org/gnu/libidn

My first reaction was: shouldn't we instead upgrade libidn? But it looks like
the API is completely different. It's weird to use an alpha version for security reasons, but that's what upstream curl does so OK.

package/libidn2/libidn2.mk line 10

Quoted 2 lines
package/libidn2/libidn2.mk new file +2 -0
+LIBIDN2_SOURCE = libidn2-$(LIBIDN2_VERSION).tar.gz
+LIBIDN2_INSTALL_STAGING = YES

I haven't tried, but it looks like documentation can't be disabled and the
examples are always installed. Doesn't it need to be patched to allow building in a minimal environment (i.e. without texinfo)?

Regards,
Arnout

Quoted 3 lines
package/libidn2/libidn2.mk new file +2 -0
+
+$(eval $(autotools-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH 2/2 libcurl: Use libidn2 instead of libidn

In reply to Jeroen Roovers

Since 7.51.0 libcurl uses libidn2 instead of libidn

---
 package/libcurl/libcurl.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/libcurl/libcurl.mk +1 -1
index d60000a..f5433ef 100644
@@ -9,7 +9,7 @@ LIBCURL_SOURCE = curl-$(LIBCURL_VERSION).tar.bz2
 LIBCURL_SITE = http://curl.haxx.se/download
 LIBCURL_DEPENDENCIES = host-pkgconf \
 	$(if $(BR2_PACKAGE_ZLIB),zlib) \
-	$(if $(BR2_PACKAGE_LIBIDN),libidn) \
+	$(if $(BR2_PACKAGE_LIBIDN2),libidn2) \
 	$(if $(BR2_PACKAGE_RTMPDUMP),rtmpdump)
 LIBCURL_LICENSE = ISC
 LIBCURL_LICENSE_FILES = COPYING
Signature · 1 line
2.10.2
#6 lore raw

cover libcurl: Incorrect fix for CVE-2016-8625

In reply to Jeroen Roovers

Hi Jeroen,

Quoted 2 lines · Jeroen Roovers

CVE-2016-8625 (IDNA 2003 makes curl use wrong host) was fixed by switching from libidn to libidn2.

I could not find any mention of libidn2 in the CVE-2016-8625 advisor at
https://curl.haxx.se/docs/adv_20161102K.html .

baruch

Quoted 4 lines

Jeroen Roovers (2):
libidn2: new package
libcurl: Use libidn2 instead of libidn

Quoted 9 lines
 package/Config.in            |  1 +
 package/libcurl/libcurl.mk   |  2 +-
 package/libidn2/Config.in    |  5 +++++
 package/libidn2/libidn2.hash |  2 ++
 package/libidn2/libidn2.mk   | 12 ++++++++++++
 5 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 package/libidn2/Config.in
 create mode 100644 package/libidn2/libidn2.hash
 create mode 100644 package/libidn2/libidn2.mk

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#8 lore raw

cover libcurl: Incorrect fix for CVE-2016-8625

Hi Jeroen,

Quoted 7 lines · Jeroen Roovers
Quoted 2 lines · Baruch Siach

I could not find any mention of libidn2 in the CVE-2016-8625 advisor at
https://curl.haxx.se/docs/adv_20161102K.html .

Indeed. The commit that switched to libidn2 does mention the advisory.

https://github.com/curl/curl/commit/9c91ec778104ae3b744b39444d544e82d5ee9ece

Please mention that in the libidn to libidn2 commit log.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -