[packages/axel] Up to 2.17.14
arekm
arekm at pld-linux.org
Thu Oct 29 08:25:26 CET 2026
commit 76e6970390f9b45004f1ed2a53043b1975eb7cc2
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Oct 29 02:32:17 2026 +0100
Up to 2.17.14
Fixes CVE-2026-118485, CVE-2020-13614.
axel-CVE-2026-118485.patch | 45 ++++++++
axel-etc_dir.patch | 42 ++++---
axel-http-header-bound.patch | 36 ++++++
axel-redirect-credentials.patch | 235 ++++++++++++++++++++++++++++++++++++++++
axel.spec | 52 ++++-----
5 files changed, 367 insertions(+), 43 deletions(-)
---
diff --git a/axel.spec b/axel.spec
index 491311d..6587c3c 100644
--- a/axel.spec
+++ b/axel.spec
@@ -1,16 +1,22 @@
-%undefine _debugsource_packages
Summary: A light Linux download accelerator
Summary(pl.UTF-8): Niewielki dopalacz ściągania plików
Name: axel
-Version: 2.3
-Release: 4
-License: GPL
+Version: 2.17.14
+Release: 1
+License: GPL v2+ with OpenSSL exception
Group: Networking/Utilities
-Source0: http://alioth.debian.org/frs/download.php/2717/%{name}-%{version}.tar.gz
-# Source0-md5: 6f49813ffc1dd10829d74b73712cb5ed
+Source0: https://github.com/axel-download-accelerator/axel/releases/download/v%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 2d12aab3b617197c272f9172f300663d
Patch0: %{name}-etc_dir.patch
-URL: http://axel.alioth.debian.org/
+Patch1: %{name}-http-header-bound.patch
+Patch2: %{name}-redirect-credentials.patch
+Patch3: %{name}-CVE-2026-118485.patch
+URL: https://github.com/axel-download-accelerator/axel
BuildRequires: gettext-tools
+BuildRequires: openssl-devel
+BuildRequires: pkgconfig
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -26,29 +32,24 @@ wszystkie dane w jednym pliku. Dlatego powinien być bardzo efektywny.
%prep
%setup -q
%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
%build
-# it doesn't use autoconf
-./configure \
- --prefix=%{_prefix} \
- --bindir=%{_bindir} \
- --etcdir=%{_sysconfdir} \
- --mandir=%{_mandir} \
- --locale=%{_datadir}/locale \
- --i18n=1
+%configure \
+ --with-ssl=openssl
-%{__make} \
- CC="%{__cc}" \
- CFLAGS="%{rpmcflags}"
+%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir},%{_mandir},%{_datadir}/locale}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-
-mv $RPM_BUILD_ROOT/usr/share/locale/zh_{cn,CN}
+
+cp -p doc/axelrc.example $RPM_BUILD_ROOT%{_sysconfdir}/axelrc
%find_lang %{name}
@@ -57,8 +58,7 @@ rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc CHANGES README
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
-%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man1/*
-%lang(zh_CN) %{_mandir}/zh_CN/man1/*
+%doc ChangeLog NEWS README.md
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/axelrc
+%attr(755,root,root) %{_bindir}/axel
+%{_mandir}/man1/axel.1*
diff --git a/axel-CVE-2026-118485.patch b/axel-CVE-2026-118485.patch
new file mode 100644
index 0000000..050707f
--- /dev/null
+++ b/axel-CVE-2026-118485.patch
@@ -0,0 +1,45 @@
+CVE-2026-118485: a %2f in the URL decodes to '/' in the output file
+name, letting a URL like http://host/%2e%2e%2fx write outside the cwd.
+https://github.com/axel-download-accelerator/axel/issues/477
+(PR #483 takes the basename instead, which also renames downloads of
+http://host/dir/ from index.html to dir)
+--- axel-2.17.14.orig/src/axel.c
++++ axel-2.17.14/src/axel.c
+@@ -117,6 +117,16 @@ stfile_open(const char *bname, int flags, mode_t mode)
+ }
+
+
++/* The local name comes from the URL: a %2f decodes to a path separator and
++ * the part after '?' may hold literal ones; keep them out, as http_filename()
++ * does for Content-Disposition. */
++static void
++axel_filename_sanitize(char *filename)
++{
++ for (char *s = filename; (s = strchr(s, '/')); s++)
++ *s = '_';
++}
++
+ /* Create a new axel_t structure */
+ axel_t *
+ axel_new(conf_t *conf, int count, const search_t *res)
+@@ -186,6 +196,7 @@ axel_new(conf_t *conf, int count, const search_t *res)
+
+ strlcpy(axel->filename, axel->conn[0].file, sizeof(axel->filename));
+ http_decode(axel->filename);
++ axel_filename_sanitize(axel->filename);
+
+ if ((s = strchr(axel->filename, '?')) != NULL &&
+ axel->conf->strip_cgi_parameters)
+@@ -242,9 +253,11 @@ axel_new(conf_t *conf, int count, const search_t *res)
+ }
+
+ /* Wildcards in URL --> Get complete filename */
+- if (axel->filename[strcspn(axel->filename, "*?")])
++ if (axel->filename[strcspn(axel->filename, "*?")]) {
+ strlcpy(axel->filename, axel->conn[0].file,
+ sizeof(axel->filename));
++ axel_filename_sanitize(axel->filename);
++ }
+
+ if (*axel->conn[0].output_filename != 0) {
+ strlcpy(axel->filename, axel->conn[0].output_filename,
diff --git a/axel-etc_dir.patch b/axel-etc_dir.patch
index 73bb41d..9532271 100644
--- a/axel-etc_dir.patch
+++ b/axel-etc_dir.patch
@@ -1,17 +1,25 @@
-diff -Nru axel-1.0a/conf.c axel-1.0a.new/conf.c
---- axel-1.0a/conf.c Tue Feb 19 18:10:37 2002
-+++ axel-1.0a.new/conf.c Sun Mar 23 14:26:22 2003
-@@ -148,6 +148,13 @@
- if( !conf_loadfile( conf, ETCDIR "/axelrc" ) )
- return( 0 );
-
-+ if( ( s2 = getenv( "ETC_DIR" ) ) != NULL )
-+ {
-+ sprintf( s, "%s/%s", s2, "axelrc" );
-+ if( !conf_loadfile( conf, s ) )
-+ return( 0 );
-+ }
-+ else
- if( ( s2 = getenv( "HOME" ) ) != NULL )
- {
- sprintf( s, "%s/%s", s2, ".axelrc" );
+Read $ETC_DIR/axelrc instead of ~/.axelrc when ETC_DIR is set (PLD
+per-user config dir convention).
+--- axel-2.17.14.orig/src/conf.c
++++ axel-2.17.14/src/conf.c
+@@ -294,7 +294,19 @@
+ if (!conf_loadfile(conf, ETCDIR "/axelrc"))
+ return 0;
+
+- if ((s2 = getenv("HOME")) != NULL) {
++ if ((s2 = getenv("ETC_DIR")) != NULL) {
++ char s[MAX_STRING];
++ int ret;
++
++ ret = snprintf(s, sizeof(s), "%s/axelrc", s2);
++ if (ret >= (int)sizeof(s)) {
++ fprintf(stderr, _("ETC_DIR env variable too long\n") );
++ return 0;
++ }
++
++ if (!conf_loadfile(conf, s))
++ return 0;
++ } else if ((s2 = getenv("HOME")) != NULL) {
+ char s[MAX_STRING];
+ int ret;
+
diff --git a/axel-http-header-bound.patch b/axel-http-header-bound.patch
new file mode 100644
index 0000000..e2591cc
--- /dev/null
+++ b/axel-http-header-bound.patch
@@ -0,0 +1,36 @@
+Cap the HTTP response header buffer; a server sending an endless header
+otherwise makes axel allocate until OOM.
+https://github.com/axel-download-accelerator/axel/commit/cc7e82ff53
+--- axel-2.17.14.orig/src/http.c
++++ axel-2.17.14/src/http.c
+@@ -51,6 +51,7 @@
+ #include "axel.h"
+
+ #define HDR_CHUNK 512
++#define MAX_HEADERS (64 * 1024)
+
+ inline static int
+ is_default_port(int proto, int port)
+@@ -264,9 +265,19 @@ http_exec(http_t *conn)
+ s++;
+
+ size_t pos = s - conn->headers->p;
+- if (pos + 10 < conn->headers->len) {
+- int tmp = abuf_setup(conn->headers,
+- conn->headers->len + HDR_CHUNK);
++ if (pos + 10 >= conn->headers->len) {
++ size_t new_len;
++ if (conn->headers->len > MAX_HEADERS - HDR_CHUNK)
++ new_len = MAX_HEADERS;
++ else
++ new_len = conn->headers->len + HDR_CHUNK;
++
++ if (new_len == conn->headers->len) {
++ fprintf(stderr, _("Response headers are too large.\n"));
++ return 0;
++ }
++
++ int tmp = abuf_setup(conn->headers, new_len);
+ if (tmp < 0) {
+ fprintf(stderr, "Out of memory\n");
+ return 0;
diff --git a/axel-redirect-credentials.patch b/axel-redirect-credentials.patch
new file mode 100644
index 0000000..ebb73cf
--- /dev/null
+++ b/axel-redirect-credentials.patch
@@ -0,0 +1,235 @@
+Stop sending Cookie/Authorization/Proxy-Authorization headers given with
+-H once a redirect leaves the origin; adds --location-trusted.
+https://github.com/axel-download-accelerator/axel/issues/409
+https://github.com/axel-download-accelerator/axel/commit/043bc3ed8d
+https://github.com/axel-download-accelerator/axel/commit/a7ff24ac1c
+PLD change: a different port is a different origin (upstream keeps the
+headers; curl drops them since CVE-2022-27776). text.c adapted to 2.17.14;
+help text left alone to keep its translations; axel.1 patched directly,
+txt2man is not available at build time.
+--- axel-2.17.14.orig/doc/axel.1
++++ axel-2.17.14/doc/axel.1
+@@ -47,6 +47,15 @@ Specify an alternative number of redirections to follow when connecting to the
+ server (default is 20).
+ .TP
+ .B
++\fB--location-trusted\fP
++Keep sending the headers that carry credentials after a redirect has led to a
++host other than the one asked for. A Cookie, Authorization or Proxy-Authorization
++header given with \fB--header\fP is meant for the host named on the command line, so it
++is dropped once a redirect leaves that host or port, or leaves TLS behind
++(the http to https upgrade on the default ports keeps it). Use this only
++when every host the download may be sent to is as trusted as the first one.
++.TP
++.B
+ \fB--output\fP=x, \fB-o\fP x
+ Downloaded data will be put in a local file with the same name, unless you specify
+ a different name using this option. You can specify a directory as well, the program
+--- axel-2.17.14.orig/doc/axelrc.example
++++ axel-2.17.14/doc/axelrc.example
+@@ -26,6 +26,13 @@
+ #
+ # max_redirect = 20
+
++# Keep sending headers that carry credentials (Cookie, Authorization,
++# Proxy-Authorization) after a redirect to a host or port other than the one
++# asked for. They are dropped by default, so that a redirect cannot walk off with
++# them.
++#
++# location_trusted = 0
++
+ # If no data comes from a connection for this number of seconds, abort (and
+ # resume) the connection.
+ #
+--- axel-2.17.14.orig/src/conf.c
++++ axel-2.17.14/src/conf.c
+@@ -172,6 +172,7 @@ conf_loadfile(conf_t *conf, const char *file)
+ KEY(verbose)
+ KEY(insecure)
+ KEY(no_clobber)
++ KEY(location_trusted)
+ KEY(search_timeout)
+ KEY(search_threads)
+ KEY(search_amount)
+@@ -240,6 +241,41 @@ error:
+ return ret;
+ }
+
++/* The headers a user gives with -H are meant for the host they named. A
++ * cookie or an authorization line is a credential, and a redirect can point
++ * anywhere, so those stop travelling once the download leaves that host --
++ * otherwise a shortened or hijacked link walks off with the session. */
++bool
++conf_header_is_private(const char *header)
++{
++ static const char *const names[] = {
++ "cookie",
++ "authorization",
++ "proxy-authorization",
++ };
++
++ for (size_t i = 0; i < sizeof(names) / sizeof(*names); i++) {
++ size_t len = strlen(names[i]);
++
++ /* The name, then whatever space was typed, then the colon */
++ if (strncasecmp(header, names[i], len) == 0 &&
++ header[len + strspn(header + len, " \t")] == ':')
++ return true;
++ }
++
++ return false;
++}
++
++bool
++conf_has_private_headers(const conf_t *conf)
++{
++ for (int i = 0; i < conf->add_header_count; i++)
++ if (conf_header_is_private(conf->add_header[i]))
++ return true;
++
++ return false;
++}
++
+ int
+ conf_init(conf_t *conf)
+ {
+--- axel-2.17.14.orig/src/conf.h
++++ axel-2.17.14/src/conf.h
+@@ -59,6 +59,7 @@ typedef struct {
+ int verbose;
+ int insecure;
+ int no_clobber;
++ int location_trusted;
+ enum {
+ AXEL_PROGRESS_STYLE_CLASSIC,
+ AXEL_PROGRESS_STYLE_ALTERNATIVE,
+@@ -78,12 +79,22 @@ typedef struct {
+
+ int add_header_count;
+ char add_header[MAX_ADD_HEADERS][MAX_STRING];
++
++ /* Set once a redirect has led somewhere the user didn't name, so
++ that the headers meant for the host they did name stay behind */
++ bool untrusted_host;
+ } conf_t;
+
+ int conf_loadfile(conf_t *conf, const char *file);
+ int conf_init(conf_t *conf);
+ void conf_free(conf_t *conf);
+
++/* Is this one of the headers that carry a credential? */
++bool conf_header_is_private(const char *header);
++
++/* Is there anything among the headers that a redirect shouldn't get? */
++bool conf_has_private_headers(const conf_t *conf);
++
+ enum {
+ HDR_USER_AGENT,
+ HDR_count_init,
+--- axel-2.17.14.orig/src/conn.c
++++ axel-2.17.14/src/conn.c
+@@ -316,9 +316,15 @@ conn_setup(conn_t *conn)
+
+ abuf_setup(conn->http->request, 2048);
+ http_get(conn->http, s);
+- for (i = 0; i < conn->conf->add_header_count; i++)
+- http_addheader(conn->http, "%s",
+- conn->conf->add_header[i]);
++ for (i = 0; i < conn->conf->add_header_count; i++) {
++ const char *header = conn->conf->add_header[i];
++
++ if (conn->conf->untrusted_host &&
++ conf_header_is_private(header))
++ continue;
++
++ http_addheader(conn->http, "%s", header);
++ }
+ }
+ return 1;
+ }
+@@ -414,6 +420,46 @@ urlseq_check_loop(struct urlseq *u, conn_t *conn)
+ return 0;
+ }
+
++/* Point a connection at the target of a redirect.
++ *
++ * Where that lands decides whether the credential-bearing headers keep being
++ * sent: the user gave them for the host they named, and they stay behind
++ * once the download leaves it, or drops out of TLS and would put them on the
++ * wire in the clear. Like curl (CVE-2022-27776), only the same scheme, host
++ * and port keeps them, plus the http://host/ -> https://host/ upgrade on the
++ * default ports. --location-trusted sends them anywhere, the way curl's
++ * option of the same name does. */
++static
++int
++conn_redirect(conn_t *conn, const char *url)
++{
++ char host[sizeof(conn->host)];
++ int proto = conn->proto;
++ int port = conn->port;
++
++ strlcpy(host, conn->host, sizeof(host));
++
++ if (!conn_set(conn, url))
++ return 0;
++
++ if (conn->conf->location_trusted || conn->conf->untrusted_host)
++ return 1;
++
++ if (strcasecmp(conn->host, host) == 0 &&
++ ((conn->proto == proto && conn->port == port) ||
++ (proto == PROTO_HTTP && port == PROTO_HTTP_PORT &&
++ conn->proto == PROTO_HTTPS && conn->port == PROTO_HTTPS_PORT)))
++ return 1;
++
++ conn->conf->untrusted_host = true;
++ if (conf_has_private_headers(conn->conf))
++ fprintf(stderr, _("Redirected away from the host asked for, "
++ "not passing on the headers that carry "
++ "credentials.\n"));
++
++ return 1;
++}
++
+ /* Get file size and other information */
+ int
+ conn_info(conn_t *conn)
+@@ -463,9 +509,8 @@ conn_info(conn_t *conn)
+ strlcpy(s, conn->http->headers->p, sizeof(s));
+ }
+
+- if (!conn_set(conn, s)) {
++ if (!conn_redirect(conn, s))
+ return 0;
+- }
+
+ /* check if the download has been redirected to FTP and
+ * report it back to the caller */
+--- axel-2.17.14.orig/src/text.c
++++ axel-2.17.14/src/text.c
+@@ -65,6 +65,7 @@ static int get_term_width(void);
+ int run = 1;
+
+ #define MAX_REDIR_OPT 256
++#define LOCATION_TRUSTED_OPT 258
+
+ #ifdef NOGETOPTLONG
+ #define getopt_long(a, b, c, d, e) getopt(a, b, c)
+@@ -74,6 +75,7 @@ static struct option axel_options[] = {
+ {"max-speed", 1, NULL, 's'},
+ {"num-connections", 1, NULL, 'n'},
+ {"max-redirect", 1, NULL, MAX_REDIR_OPT},
++ {"location-trusted",0, NULL, LOCATION_TRUSTED_OPT},
+ {"output", 1, NULL, 'o'},
+ {"search", 2, NULL, 'S'},
+ {"ipv4", 0, NULL, '4'},
+@@ -172,6 +174,9 @@ main(int argc, char *argv[])
+ return 1;
+ }
+ break;
++ case LOCATION_TRUSTED_OPT:
++ conf->location_trusted = 1;
++ break;
+ case 'o':
+ strlcpy(fn, optarg, sizeof(fn));
+ break;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/axel.git/commitdiff/76e6970390f9b45004f1ed2a53043b1975eb7cc2
More information about the pld-cvs-commit
mailing list