Commit graph

38638 commits

Author SHA1 Message Date
Stefan Eissing
7f7e4e3e68
creds: create on service name only
Fix creation of creds object for transfer when only a sasl service
name is configured by the application.

Follow-up to 5e99b73cf4

Closes #21591
2026-05-13 16:37:15 +02:00
Daniel Stenberg
b079595f2e
url: keep the question mark for empty queries
Reported-by: Bill Mill
Fixes #21544

Verified by test 1721

Closes #21584
2026-05-13 14:34:54 +02:00
Daniel Stenberg
11df1251e5
snpego_sspi: preserve distinction btw policy-only and uncond delegation
CURLOPT_GSSAPI_DELEGATION exposes distinct modes:
CURLGSSAPI_DELEGATION_POLICY_FLAG is documented as delegating only when
OK-AS-DELEGATE policy permits it, while CURLGSSAPI_DELEGATION_FLAG is
unconditional. The new SSPI implementation checks for either bit and
sets ISC_REQ_DELEGATE, so a caller requesting policy-limited delegation
is put on the same SSPI path as unconditional delegation.

In addition, curl's existing protection that avoids reusing a connection
when the GSS delegation setting differs was guarded only by HAVE_GSSAPI;
SSPI-only builds now have an effective delegation option, but the
connection's delegation setting was neither copied nor compared. This
would cause Windows SSPI Negotiate/Kerberos authentication to delegate
credentials contrary to the caller's selected policy or reuse an
already-delegated authenticated connection for a transfer that requested
no delegation.

Follow-up to cc6777d939

Reported by Codex Security
Closes #21583
2026-05-13 14:34:08 +02:00
Stefan Eissing
5e99b73cf4
creds: add sasl service name
The SASL service name, used in authentication, is part of curl's credentials
when authenticating to a server/proxy. Make it part of `struct Curl_creds`.

Change code to use `creds` to obtain a service name. By tying creds used
to the connection, connection reuse is also only allowed when the service
name matches.

Closes #21585
2026-05-13 14:04:17 +02:00
Daniel Stenberg
b2476a0712
tool_urlglob: check glob use before access
As this function can now be invoked with only the second glob "active",
it must avoid accessing the first one if not in use.

Follow-up to 2238f0921c

Spotted by Codex Security

Closes #21586
2026-05-13 13:12:10 +02:00
Daniel Stenberg
2238f0921c
curl: named globs in output file name for upload glob references
Use parts of text from the upload filename field when that uses globbing
by giving it a name the same way we do it for URL globs. For example, if
you upload three files to a HTTP URL and want to save the corresponding
responses in separate files:

    curl -T 'file{<num>1,2,3}' https://upload.example/ -o 'response-#<num>'

Verified by test 2014

Closes #21407
2026-05-13 10:07:50 +02:00
Daniel Stenberg
89f38c168c
CURLOPT_MAXFILESIZE: clarify this also works for on-going transfers
It was not really clear, but it has worked like this since 8.4.0 which
now is a while.

Closes #21582
2026-05-13 09:45:33 +02:00
Viktor Szakats
eca309c2a1
ldap: fix to not leak attribute on OOM (WinLDAP)
Reported-by: Andrew Nesbitt

Closes #21576
2026-05-13 00:43:27 +02:00
Viktor Szakats
54d5de5305
THANKS-filter: update
Source: https://github.com/andrew

Closes #21577
2026-05-13 00:43:27 +02:00
Andrei Rybak
a3618d166d
VULN-DISCLOSURE-POLICY.md: remove mention of bug bounty reward
As a follow-up to commits ca7ef4b817 ("BUG-BOUNTY.md: we stop the
bug-bounty end of Jan 2026", 2026-01-22) and ed7bf43a08 ("BUG-BOUNTY.md:
minor rephrase to say there is no bug bounty", 2026-03-10), remove a
leftover mention of the reward for vulnerability reports, that no longer
exists, in file `VULN-DISCLOSURE-POLICY.md`.

Fixes #21571
Reported-by: Alan De Smet
Closes #21574
2026-05-12 23:47:29 +02:00
Daniel Stenberg
287b082c63
tool_urlglob: better 'Duplicate glob name' position
This now points to where the duplicate name ends, not where it starts.

Also fixes test 2410 to use a fixed hostname so that the error position
remains the same.

Reported-by: Viktor Szakats
Fixes #21567
Closes #21568
2026-05-12 23:46:04 +02:00
Viktor Szakats
02dca1eb86
src: fix comment typos
Found by GitHub Code Quality

Closes #21570
2026-05-12 17:14:38 +02:00
Viktor Szakats
2538dc04e3
curl_ntlm_core: propagate DES CryptEncrypt() error
Spotted by GitHub Code Quality

Closes #21569
2026-05-12 17:14:38 +02:00
Stefan Eissing
8f71d0fde5
creds: hold credentials
Authorizdation credentials are kept in `struct Curl_creds`. This contains:

* `user`: the username, maybe the empty string
* `passwd`: the password, maybe the empty string
* `sasl_authzid`: the SASL authz value, maybe the empty string
* `oauth_bearer`: the OAUTH bearer token, maybe the empty string
* `source`: where the credentials from from
* `refcount`: a reference counter to link/unkink creds

A `creds` with all values empty is equivalent to NULL, e.g. no `creds`
instance. With reference counting, `creds` can be linked/unlinked
in several places.

See docs/internals/CREDENTIALS.md for use.

Closes #21548
2026-05-12 16:05:15 +02:00
Daniel Stenberg
a32a2b0b77
GHA: (re-)enable SMB in a few builds
Closes #21564
2026-05-12 14:53:48 +02:00
Viktor Szakats
82216163b1
curl_ntlm_core: fix nettle 4+ builds in certain MultiSSL combos
Also rename macro to resemble other backends.

Reported by Codex Security

Fixes #21562
Follow-up to 01f08dc4eb #21557

Closes #21566
2026-05-12 14:21:25 +02:00
Daniel Stenberg
cb4395b403
rtsp: bump buf after rtsp_filter_rtp()
Reported-by: Andrew Nesbit
Closes #21563
2026-05-12 12:39:06 +02:00
Song X. Gao
cc6777d939
spnego_sspi: honor CURLOPT_GSSAPI_DELEGATION for Windows SSPI
Make CURLOPT_GSSAPI_DELEGATION effective on Windows builds that use SSPI
(instead of a native GSS-API implementation), so Kerberos delegation can
be requested during SPNEGO/Negotiate authentication.

Closes #21528
2026-05-12 10:27:29 +02:00
Daniel Stenberg
2256162fa7
tftp: stricter option name checks
Previously, the use of checkprefix() alone allowed the code to match not
only on "blksize" but also (mistakenly) on "blksizeFOO" etc.

Reported-by: Andrew Nesbit
Closes #21560
2026-05-12 10:26:20 +02:00
Daniel Stenberg
7eb0b30934
tool_urlglob: make globbing error reported for correct position
Reported by Codex Security

Closes #21561
2026-05-12 10:21:45 +02:00
Daniel Stenberg
cb0636980b
tool_urlglob: add named globs
Idea-by: Bastian Jesuiter

Verified by test 2408 - 2411

Closes #21409
2026-05-12 08:33:01 +02:00
Stefan Eissing
2a2104f3cf
event: fix wakeup consumption
The events on a multi wakeup socketpair were only consumed via
curl_multi_poll()/curl_multi_wait() but not in event based processing on
a curl_multi_socket() call. That led to busy loops as reported in

Fixes #21547
Reported-by: Earnestly on github
Closes #21549
2026-05-12 08:11:31 +02:00
Viktor Szakats
01f08dc4eb
gnutls: fix more nettle 4+ compatibility issues
- disable DES with nettle 4. It no longer supports it.
  ```
  lib/curl_ntlm_core.c:67:12: fatal error: 'nettle/des.h' file not found
     67 | #  include <nettle/des.h>
        |            ^~~~~~~~~~~~~~
  ```

- fix MD4 support with nettle 4.
  ```
  lib/md4.c:178:36: error: too many arguments to function call, expected 2, have 3
    178 |   md4_digest(ctx, MD4_DIGEST_SIZE, digest);
        |   ~~~~~~~~~~                       ^~~~~~
  ```

- fix unused argument compiler warning:
  ```
  lib/vtls/gtls.c:2267:39: error: unused parameter 'sha256len' [clang-diagnostic-unused-parameter,-warnings-as-errors]
  2267 |                                size_t sha256len)
       |                                       ^
  ```
  Ref: https://github.com/curl/curl/actions/runs/25710321195/job/75488970143?pr=21557

- GHA/macos: stop enabling NTLM in the GnuTLS job.
  It no longer builds due to missing DES support in nettle 4.
  ```
  lib/curl_ntlm_core.c:90:4: error: "cannot compile NTLM support without a crypto library with DES."
     90 | #  error "cannot compile NTLM support without a crypto library with DES."
        |    ^
  ```
  Ref: https://github.com/curl/curl/actions/runs/25710321195/job/75488970170?pr=21557

Follow-up to cfadbaa133 #21169

Closes #21557
2026-05-12 05:33:08 +02:00
Viktor Szakats
b582a936dd
GHA/linux: build local wolfSSL opensslextra with --enable-ed25519
For use with RFC 9421 HTTP Message Signatures support.

Ref: https://github.com/curl/curl/pull/21239/files#r3222322908
Ref: #21239

Closes #21555
2026-05-12 04:26:33 +02:00
Xi Ruoyao
cfadbaa133
gnutls: allow building with nettle 4.0
Closes #21169
2026-05-12 03:54:24 +02:00
Tim Martin
185e67e1fa
docs: fix --follow doc typo
Let the singular ~~object~~ subject "option" agree with the verb "set".

Closes #21553
2026-05-12 02:10:27 +02:00
Viktor Szakats
4d82423dd3
delta: harden external command invocations
By moving operations Perl-native (from shell and external commands), and
passing arguments individually to external commands.

Pointed out by Codex Security

Closes #21104
2026-05-11 22:05:29 +02:00
Kai Pastor
7d546e52b2
cmake: export/forward NGTCP2_CRYPTO_BACKEND
Exporting the component name as passed in is somewhat boring. OTOH it is
convenient for reuse.

- FindNGTCP2: export crypto backend in `NGTCP2_CRYPTO_BACKEND`.
- pass `COMPONENTS` `NGTCP2_CRYPTO_BACKEND` in `curl-config.cmake`.
- FindNGTCP2: fix to skip Config detection when optional `COMPONENTS` is
  not passed.

Co-authored-by: Viktor Szakats
Reported-by: x-xiang on github
Fixes #21523
Follow-up to 8fce3e17e6 #20814

Closes #21540
2026-05-11 21:53:39 +02:00
Viktor Szakats
e8ce697973
idn: replace header guards with forward declaration
Follow-up to bc40e09f63 #21472

Closes #21551
2026-05-11 17:01:34 +02:00
amitbidlan
e0e56e9ae4
hostip: remove unused MAX_HOSTCACHE_LEN and MAX_DNS_CACHE_SIZE
These macros are leftovers from when DNS caching was moved out of
hostip.c into its own source file. Both are still defined and used in
lib/dnscache.c; the copies in lib/hostip.c are unreferenced.

Detected with clang -Wunused-macros.

Follow-up to 96d5b5c688
Closes #21550
2026-05-11 16:19:34 +02:00
Daniel Stenberg
daf6f541cc
RELEASE-NOTES: synced 2026-05-11 14:51:03 +02:00
Daniel Stenberg
37b2403f48
lib: drop support for CURLAUTH_DIGEST_IE
This bit was used to do Digest authentication like Internet Explorer
before version 7 (released on October 18, 2006). Presumably no one uses
this anymore and since it is hard to use and does broken auth, starting
in 8.21.0 this bit does nothing (except setting the actual Digest bit).

Closes #21486
2026-05-11 13:43:47 +02:00
Kai Pastor
10d4b34e5c
cmake: fix zstd CMake config name
They install `zstdConfig.cmake`,
885c79ba4a/build/cmake/CMakeModules/ZstdPackage.cmake (L33-L38).
With the `Config.cmake` pattern, this is a case-sensitive package name,
`zstd`.

Follow-up to 8fce3e17e6 #20814
Closes #21538
2026-05-11 12:08:32 +02:00
Viktor Szakats
4815070794
tidy-up: sort TLS backends, distros, alphabetically
Also:
- replace stray [Rr]ustls-ffi with Rustls for consistency.
- add AWS-LC to a couple of lists where missing.

Closes #21481
2026-05-11 11:57:25 +02:00
Viktor Szakats
ed3cd8b046
cmake: auto-select static nghttp2/nghttp3/ngtcp2 Config
When detecting these dependencies via CMake Config and their main
imported target is undefined, automatically assume and use their static
imported target instead.

Adopting from vcpkg downstream, where it's done for nghttp3 and ngtcp2,
but not for nghttp2.

Refs:
773e092a82/ports/curl/dependencies.patch
70b941a5d2

Downstream-patch-by: Kai Pastor

Closes #21470
2026-05-11 11:57:25 +02:00
Daniel Stenberg
6f1dfab6a2
ftp: avoid accessing EPSV response one byte past the NULL
If the response is just a single "(".

Reported-by: Andrew Nesbit
Closes #21545
2026-05-11 08:07:24 +02:00
renovate[bot]
67ce672842
GHA: update awslabs/aws-lc to v1.73.0
Closes #21542
2026-05-10 23:22:45 +02:00
Daniel Stenberg
ea75ccc53b
schannel_verify: avoid out of blob access
The code would previously read one byte past the provided
CURLOPT_CAINFO_BLOB if the blob ends exactly with -----BEGIN
CERTIFICATE-----

Reported-by: Andrew Nesbit
Closes #21543
2026-05-10 23:21:08 +02:00
Daniel Stenberg
b944940828
cookie: simplify strstore(), remove outdated comment
Closes #21541
2026-05-10 00:31:25 +02:00
renovate[bot]
0f6af820c2
Dockerfile: update debian:bookworm-slim Docker digest to 67b30a6
Closes #21539
2026-05-09 15:33:09 +02:00
renovate[bot]
1698a3f857
GHA: update google/boringssl to v0.20260508.0
Closes #21537
2026-05-08 16:46:42 +02:00
Daniel Stenberg
d656ff9458
CURLOPT_ECH.md: simplify the description language
It no longer requires "a special build" of OpenSSL, just OpenSSL 4+.

Emphasize the experimental part a little clearer.

Drop the caveat for wolfSSL from the main description.

Closes #21536
2026-05-08 16:23:05 +02:00
Daniel Stenberg
b174b8b326
ECH: cleanups
- passing an unknown string to CURLOPT_ECH now returns error

  To properly allow applications to spot if they pass in a typo or
  something to libcurl.

- CURLECH_DISABLE is now a plain zero internally, not a dedicated bit which
  simplifies checks for when ECH is enabled

- Dropped the CURLECH_CLA_CFG bit, and just check STRING_ECH_CONFIG

- Turn grease/enable/hard into three different numerical values, no bitmask
  needed

- Convert the struct field 'tls_ech' from an int to a byte.

Closes #21532
2026-05-08 13:09:45 +02:00
Daniel Stenberg
cda0268593
x509asn1: fix operator order in do_pubkey
Check the range before reading data, as it would otherwise read one byte
too many.

Reported-by: Andrew Nesbit
Closes #21533
2026-05-08 10:27:25 +02:00
Daniel Stenberg
3ce10063f1
tool_urlglob: avoid overflow at end of range
Due to how the range span globbing code works, a range that ends with
9223372036854775807 (the maximum signed 63 bit value) cannot be used as
it triggers an integer overflow.

Verified in test 2092

Reported-by: Andrew Nesbit
Closes #21529
2026-05-07 22:58:20 +02:00
Daniel Stenberg
9249aad4c2
ldap: fix minor leak on write callback error
The 'ber' pointer could remain allocated in the exit path if the write
callback returned error for one of the Curl_client_write() calls.

Reported-by: Andrew Nesbit
Closes #21530
2026-05-07 22:57:38 +02:00
Daniel Stenberg
df315692d7
ftp: simplify ftp_done
Closes #21520
2026-05-07 14:53:55 +02:00
Stefan Eissing
a86efdd7ca
url: fix connection reuse for starttls protocols
When a connection is tested for reuse in a transfer that *may* upgrade
to TLS (commonly via STARTTLS), the SSL configuration must match the
existing connection.

Reported-by: Andrew Nesbit
Closes #21522
2026-05-07 14:37:25 +02:00
Stefan Eissing
ef3b7903aa
ftp: remove bits.ftp_use_control_ssl
It's not needed since we can check the connection for SSL use.

Closes #21521
2026-05-07 14:03:48 +02:00
Stefan Eissing
fdd27a538c
auth: cleanups
- rename `req->proxyuserpwd` to `req->hd_proxy_auth`
- rename `req->userpwd` to `req->hd_auth`
- rename parameter `proxytunnel` to `is_connect` for Curl_http_output_auth()
- move path+query concatenation into Curl_http_output_auth(), saving an alloc when no auth is in play
- rename `H1_HD_USER_AUTH` into `H1_HD_AUTH`

Closes #21513
2026-05-07 14:03:00 +02:00