Skip to contentSkip to conversation

curl: add option for libpsl, the Public Suffix List library

PATCH In review Ross Burton 2 participants 4 messages Jul 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 curl: add option for libpsl, the Public Suffix List library

Instead of hardcoding this to disabled, add a PACKAGECONFIG.

No behavioural changes in this patch.

---
 meta/recipes-support/curl/curl_8.21.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/curl/curl_8.21.0.bb +1 -1
index d245e7fe60f..399b915dee8 100644
@@ -55,6 +55,7 @@ PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap"
 PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,openldap"
 PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl"
 PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
+PACKAGECONFIG[libpsl] = "--with-libpsl,--without-libpsl,libpsl"
 PACKAGECONFIG[libssh] = "--with-libssh,--without-libssh,libssh"
 PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
 PACKAGECONFIG[mbedtls] = "--with-mbedtls,--without-mbedtls,mbedtls"
@@ -85,7 +86,6 @@ CURL_CA_BUNDLE_BASE_DIR:class-target = "${sysconfdir}"
 
 EXTRA_OECONF = " \
     --disable-libcurl-option \
-    --without-libpsl \
     --enable-optimize \
     --with-ca-bundle=${CURL_CA_BUNDLE_BASE_DIR}/ssl/certs/ca-certificates.crt \
     ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls openssl schannel', d) == '') else ''} \
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/3 curl: enable libpsl in target builds

The Public Suffix List[1] is a list of domains that people can register domains under, for example ".com" or ".co.uk". This is useful because it means browsers and other HTTP using tools can prevent malicious web sites from setting privacy-damaging "supercookies".

In the interest of being more secure out of the box, enable libpsl in target builds of curl.

[1] https://publicsuffix.org

---
 meta/recipes-support/curl/curl_8.21.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/curl/curl_8.21.0.bb +1 -1
index 399b915dee8..e8c024d18a7 100644
@@ -29,7 +29,7 @@ CVE_STATUS[CVE-2024-32928] = "ignored: CURLOPT_SSL_VERIFYPEER was disabled on go
 inherit autotools pkgconfig binconfig multilib_header ptest
 
 COMMON_PACKAGECONFIG = "basic-auth bearer-auth digest-auth ipfs negotiate-auth openssl proxy threaded-resolver verbose zlib"
-PACKAGECONFIG ??= "${COMMON_PACKAGECONFIG} ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} aws libidn"
+PACKAGECONFIG ??= "${COMMON_PACKAGECONFIG} ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} aws libidn libpsl"
 PACKAGECONFIG:class-native = "${COMMON_PACKAGECONFIG} ipv6"
 PACKAGECONFIG:class-nativesdk = "${COMMON_PACKAGECONFIG} ipv6"
 
Signature · 1 line
2.43.0
#2 lore raw

PATCH 3/3 wget: enable libpsl in target builds

In reply to Ross Burton

The Public Suffix List[1] is a list of domains that people can register domains under, for example ".com" or ".co.uk". This is useful because it means browsers and other HTTP using tools can prevent malicious web sites from setting privacy-damaging "supercookies".

In the interest of being more secure out of the box, enable libpsl in builds of wget (note that we never build wget-native, as it is provided by the host).

[1] https://publicsuffix.org

---
 meta/recipes-extended/wget/wget_1.25.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/wget/wget_1.25.0.bb +1 -1
index 10b2bc19a5d..1d202df9f42 100644
@@ -25,7 +25,7 @@ EXTRA_OECONF = "--without-libgnutls-prefix --without-libssl-prefix \
 EXTRA_OEMAKE += 'TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" \
                  DEBUG_PREFIX_MAP="${DEBUG_PREFIX_MAP}"'
 
-PACKAGECONFIG ??= "gnutls pcre2 zlib \
+PACKAGECONFIG ??= "gnutls pcre2 zlib libpsl \
                    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ares] = "--with-cares,--without-cares,c-ares"
 PACKAGECONFIG[gnutls] = "--with-ssl=gnutls,,gnutls"
Signature · 1 line
2.43.0
#3 lore raw
In reply to Ross Burton

Hello, Ross

Quoted 22 lines · Ross Burton via lists.openembedded.org

Instead of hardcoding this to disabled, add a PACKAGECONFIG.

No behavioural changes in this patch.

---
  meta/recipes-support/curl/curl_8.21.0.bb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/curl/curl_8.21.0.bb +1 -0
index d245e7fe60f..399b915dee8 100644
@@ -55,6 +55,7 @@ PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap"
  PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,openldap"
  PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl"
  PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
+PACKAGECONFIG[libpsl] = "--with-libpsl,--without-libpsl,libpsl"
  PACKAGECONFIG[libssh] = "--with-libssh,--without-libssh,libssh"
  PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
  PACKAGECONFIG[mbedtls] = "--with-mbedtls,--without-mbedtls,mbedtls"

meta/recipes-support/curl/curl_8.21.0.bb CURL_CA_BUNDLE_BASE_DIR:class-target = "${sysconfdir}" · line 91

Quoted 7 lines
meta/recipes-support/curl/curl_8.21.0.bb +0 -1
@@ -85,7 +86,6 @@ CURL_CA_BUNDLE_BASE_DIR:class-target = "${sysconfdir}"
 
  EXTRA_OECONF = " \
      --disable-libcurl-option \
-    --without-libpsl \
      --enable-optimize \
      --with-ca-bundle=${CURL_CA_BUNDLE_BASE_DIR}/ssl/certs/ca-certificates.crt \
      ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls openssl schannel', d) == '') else ''} \

Coincidence or not, I just started checking this critical vulnerability:

https://nvd.nist.gov/vuln/detail/CVE-2026-8924

And it is directly related to libpsl. I presumed that having it disabled (by default or not) would make oe-core's version of curl (e.g. in Scarthgap and Kirkstone) not affected. In fact, I checked if the parts of the code inside USE_LIBPSL ifdef blocks is built or not (it isn't), and in do_configure logs:

curl version:     7.82.0
SSL:              enabled (OpenSSL v3+)
SSH:              no      (--with-{libssh,libssh2})
zlib:             enabled
brotli:           no      (--with-brotli)
zstd:             no      (--with-zstd)
GSS-API:          no      (--with-gssapi)
GSASL:            no      (--with-gsasl)
TLS-SRP:          enabled
resolver:         POSIX threaded
IPv6:             no      (--enable-ipv6)
Unix sockets:     enabled
IDN:              enabled (libidn2)
Build libcurl:    Shared=yes, Static=yes
Built-in manual:  no      (--enable-manual)
--libcurl option: no
Verbose errors:   enabled (--disable-verbose)
Code coverage:    disabled
SSPI:             no      (--enable-sspi)
ca cert bundle:   /etc/ssl/certs/ca-certificates.crt
ca cert path:     no
ca fallback:      no
LDAP:             no      (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS:            no      (--enable-ldaps)
RTSP:             no      (--enable-rtsp)
RTMP:             no      (--with-librtmp)
PSL:              no      (--with-libpsl)

(...)

I'm not sure yet if this is a premature conclusion of mine, but I'd still want to give this heads-up, considered you added this option to PACKAGECONFIG in your second patch.

Signature · 2 lines
Best regards,
João Marcos Costa