1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

35337 Commits

Author SHA1 Message Date
Jim Jagielski
84cc989600 mod_proxy_hcheck: fix several health check problems (truncated responses, SNI, limits, probe URI)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939353 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 16:05:54 +00:00
Jim Jagielski
55f5db10ee mod_proxy: update the shared worker status atomically in ap_proxy_set_wstatus()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939352 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 16:05:30 +00:00
Jim Jagielski
6681764e7f mod_proxy_beacon: fix member identity and hand-off, tighten the receiver
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939351 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 15:03:13 +00:00
Jim Jagielski
d86f3d11d9 mod_proxy: add a worker status bit for mod_proxy_beacon members
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939350 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 15:02:44 +00:00
Jim Jagielski
e2954b284d mod_proxy: don't leave a half-built worker if ap_proxy_define_worker() fails
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939349 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 15:02:17 +00:00
Rich Bowen
dafa5b1b71 Rebuild bz70174 changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939348 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 14:19:25 +00:00
Rich Bowen
71815d423a Fix mod_logio TTFU version note: it is trunk-only (2.5.1), not 2.4.34.
LogIOTrackTTFU / %^FU was added to trunk only (r1828727) and never
backported to 2.4.x, so the 'Available in Apache 2.4.34 and later'
claim was incorrect. Correct it to 2.5.1 in both the %^FU format table
entry and the LogIOTrackTTFU directive compatibility line. Also document
that %^FB and %^FU log '-' when tracking is disabled or the measured
point was never reached. PR 70174.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939346 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 12:37:17 +00:00
Jason Lingohr
b5f5979d7b Fix typos.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939342 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 07:17:58 +00:00
Jean-Frederic Clere
4bc8d94974 Add a test for Bug 69743
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939335 13f79535-47bb-0310-9956-ffa450edef68
2026-10-22 12:42:23 +00:00
Jean-Frederic Clere
dd7f537cf9 There is no config.ini in windows CI.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939334 13f79535-47bb-0310-9956-ffa450edef68
2026-10-22 12:01:36 +00:00
Jean-Frederic Clere
11c896fd0e Allow the --httpd --conf parameter in unix too.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939326 13f79535-47bb-0310-9956-ffa450edef68
2026-10-22 09:44:34 +00:00
Arturo Bernal
6da0450e00 test: Fix a flaky test_proxy_07_cache_control.py (seen on Windows CI).
The cache entry for the first request is committed by the CACHE_SAVE
filter on the EOS-only pass that follows the body, which can still be
running server side for an instant after the client has already read
the complete body. Two back-to-back requests with no delay can race
this, making the second one miss the cache and hit the backend again.

Give the commit room to land before relying on it, instead of
asserting immediately after the first request returns. Reproduced
locally (about 1 in 5 runs failing, on different parametrized cases
each time, none of them involving a comma) and confirmed fixed (0
failures in 55 runs) before and after this change.

Also harden the TCPFaker backend used by this test to close its
socket with an orderly shutdown() instead of an abrupt close(), which
removes one more way for a slow platform to see a reset instead of a
clean end of response.

GitHub: closes #864


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939305 13f79535-47bb-0310-9956-ffa450edef68
2026-10-21 05:12:57 +00:00
Arturo Bernal
5e3efd75a1 core: Propagate make_sock() failures when duplicating listeners
ap_duplicate_listeners() ignored the return value of make_sock() for a
duplicated listener. On failure make_sock() logs the error and closes
the socket, but the loop carried on with the closed listener: with one
Listen the server started or restarted with fewer listeners, and with
several it failed on the closed descriptor with a misleading "Bad file
descriptor". Return the error so that the MPM reports "could not
duplicate listeners" with the original status.

PR: 70106
Submitted by: Xuqing Yang
GitHub: closes #861


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939304 13f79535-47bb-0310-9956-ffa450edef68
2026-10-21 05:12:42 +00:00
Joe Orton
aa1e6c0d49 * modules/aaa/mod_auth_digest.c (set_shmem_size),
modules/filters/mod_substitute.c (set_max_line_length): Use
  ap_size_parameter_parse().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: closes #851


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939296 13f79535-47bb-0310-9956-ffa450edef68
2026-10-20 19:29:54 +00:00
Joe Orton
973155ccd4 core: Accept a b/k/m/g suffix in size-valued directive parameters:
* server/util.c (ap_size_parameter_parse): Allow an optional
  case-insensitive 'b', 'k', 'm' or 'g' suffix, bounding the
  multiplication by the range of apr_off_t.

* include/httpd.h: Update doxygen accordingly.

* test/unit/util.c (size_parameter_parse_handles_suffixes): New test.

* test/modules/core/test_012_config_off_t.py: Update for suffix
  support.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: PR #851


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939295 13f79535-47bb-0310-9956-ffa450edef68
2026-10-20 19:29:29 +00:00
Eric Covener
1800b6d2a1 remove "act as part of the operating system"
This evolved from troubleshooting content under NT4 that had origins outside of 
httpd, but likely was never necessary for httpd. 

Also remove gory details about how to change the rights of the user.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939285 13f79535-47bb-0310-9956-ffa450edef68
2026-10-20 11:27:26 +00:00
Arturo Bernal
7e6d305c8a mod_md: Fix a one-second race in md_asn1_time_get().
* modules/md/md_crypt.c (md_asn1_time_get): For OpenSSL >= 1.1.1,
  convert the certificate's ASN1_TIME directly via ASN1_TIME_to_tm()
  instead of reconstructing it as apr_time_now() + ASN1_TIME_diff().
  The latter samples the current time twice (once explicitly, once
  inside ASN1_TIME_diff()); if the wall clock ticks over a second
  between the two reads, the result is off by one second. This is a
  real, reproducible race, not a theoretical one: forcing the two
  reads to straddle a second boundary reproduces it in 29-39 out of
  40 trials. It intermittently broke the exact-timestamp assertions
  in test/modules/md/test_920_status.py::test_md_920_002.

* changes-entries/md-asn1-time-race.txt: Add entry.

GitHub: closes #838


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939271 13f79535-47bb-0310-9956-ffa450edef68
2026-10-19 14:17:35 +00:00
Arturo Bernal
23104ca014 mod_negotiation: Do not send the qs parameter in the Content-Type.
A MultiViews response took the media type of the selected file as it
was, so the qs source quality set with AddType was sent to the client.
Drop it after the variant has been selected. Other parameters are kept.

PR: 53595
GitHub: closes #824


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939268 13f79535-47bb-0310-9956-ffa450edef68
2026-10-19 10:12:12 +00:00
Arturo Bernal
6f0c237673 mod_cache: Parse comma separated Cache-Control directives again.
cache_strqtok() did not end a token at a comma or whitespace unless an
argument followed, so "private, no-store" was read as one token and the
response was stored. Stop at any non-token character, after the '='
test.

This is a trunk-only regression from r1856507, which rewrote the
tokenizer as a state machine and dropped the T_HTTP_TOKEN_STOP check in
the token state that r1856493 and r1856500 still had.

PR: 70028
GitHub: closes #821


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939267 13f79535-47bb-0310-9956-ffa450edef68
2026-10-19 10:04:36 +00:00
Eric Covener
a3dcfc1504 ab: remove SVN keywords in copyright msg
Github: closes #858


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939247 13f79535-47bb-0310-9956-ffa450edef68
2026-10-18 13:21:00 +00:00
Joe Orton
bd4b474c38 * README.CHANGES: Emphasize conciseness, avoid LLM verbiage.
[skip ci]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939230 13f79535-47bb-0310-9956-ffa450edef68
2026-10-18 09:28:44 +00:00
Eric Covener
2d55d8c867 ignore /dist/
This path is used by release scripts for dist.a.o
but also to save state between steps.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939208 13f79535-47bb-0310-9956-ffa450edef68
2026-10-17 17:54:18 +00:00
Lucien Gentis
431c84ced7 fr doc rebuild.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939191 13f79535-47bb-0310-9956-ffa450edef68
2026-10-17 13:15:17 +00:00
Lucien Gentis
a17a308295 fr doc XML files updates.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939190 13f79535-47bb-0310-9956-ffa450edef68
2026-10-17 13:13:52 +00:00
Joe Orton
54cc53eb4b mod_autoindex: fix one-byte over-read past end of description
Stop reading (and writing) one byte past the end of a file
description when it ends inside an unterminated "&" entity or "<"
tag, as a ScanHTMLTitles title can.

* modules/generators/mod_autoindex.c (terminate_description): Check
  for the terminating NUL before advancing past it when scanning an
  unterminated "<" tag or "&" entity, and break out of the loop at
  end of string rather than continuing past it.

* test/modules/generators/env.py (GeneratorsTestSetup.__init__): Load
  mod_autoindex for the generators test suite.

* test/modules/generators/htdocs/autoindex/: New test content.

* test/modules/generators/test_002_autoindex.py (TestAutoindex): New
  test that a ScanHTMLTitles description ending in a bare "&" is
  rendered without reading past the end of the description.

Submitted by: arshiya tabasum <arshi bugqore.com>
GitHub: closes #812


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939181 13f79535-47bb-0310-9956-ffa450edef68
2026-10-17 11:18:52 +00:00
Joe Orton
72af198632 Sync from d36769272e -
* modules/http2/h2.h, modules/http2/h2_protocol.c,
  modules/http2/h2_protocol.h (H2_MAGIC_TOKEN, h2_protocol_ids_tls,
  h2_protocol_ids_clear): Constify constant arrays.

* modules/http2/h2_switch.c (h2_protocol_propose, h2_protocol_switch):
  Adjust local variable types to match.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939180 13f79535-47bb-0310-9956-ffa450edef68
2026-10-17 10:21:04 +00:00
Joe Orton
6a58ad8d4c CI: Run the full pytest suite on 64-bit ARM:
* .github/workflows/linux.yml: Add a "Python pytest test suites,
  64-bit ARM" job to the matrix, as the existing pytest job but on
  the ubuntu-24.04-arm runner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: closes #855


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939169 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 19:45:32 +00:00
Joe Orton
d4d8689fde Fix h2ws test client option parsing on unsigned-char platforms:
* test/clients/h2ws.c (main): Use int for the getopt() return value;
  with unsigned char (e.g. on aarch64) the -1 terminator is never
  matched, so every invocation failed with "invalid option".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: PR #855


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939168 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 19:45:27 +00:00
Joe Orton
e3a8b4e1e6 mod_cgid: Raise the limit on the number of environment variables passed
to a script from 256 to APACHE_ARG_MAX, and bound URI/query/env-value
lengths against the configured request limits rather than APR_PATH_MAX.
PR 70270.

* changes-entries/cgid-env-limit.txt: Add changelog entry.

* modules/generators/mod_cgid.c: Replace ENV_COUNT_MAX with ENV_VAL_MAX,
  a sanity bound on the length of a single environment variable value.
  (get_req): Take the main server_rec as an argument.  Allow up to
  APACHE_ARG_MAX environment variables; check uri_len and args_len
  against the configured LimitRequestLine rather than APR_PATH_MAX;
  check each environment variable value against ENV_VAL_MAX.
  (send_req): Fail with APR_ENOSPC if more than APACHE_ARG_MAX
  environment variables are present.
  (cgid_server): Pass main_server to get_req.

* test/modules/generators/htdocs/cgi/: New tests scripts.

* test/modules/generators/test_001_cgid.py: New tests.

Submitted by: Emmanuel Dreyfus <manu netbsd.org>, jorton
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: closes #850


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939165 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 18:55:52 +00:00
Joe Orton
1631f392e7 * modules/generators/mod_cgid.c (cgid_handler):
modules/generators/mod_cgi.c (cgi_handler): For the CGI bucket
  creation-error path, return a 503 rather than a 500 and log via
  log_scripterror().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939164 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 18:17:16 +00:00
Arturo Bernal
93d7164cf4 core: Distinguish invalid size parameters from range errors
ap_size_parameter_parse() returned APR_ERANGE for a value without any
digits where the libc sets EINVAL when nothing is converted (FreeBSD,
musl), and APR_EINVAL with glibc. end == parameter tells portably that
nothing was converted, so check it before the apr_strtoff() status.
APR_EINVAL is for invalid syntax, APR_ERANGE stays for overflow and
underflow.

Use it for LimitXMLRequestBody too, which had its own apr_strtoff()
parsing from #825, so that it reports the same errors as
LimitRequestBody on every platform. No change in the accepted values.

Extend test_012 to check that LimitRequestBody reports invalid syntax
and range errors with their own messages, and to cover
LimitXMLRequestBody.

GitHub: closes #848


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939163 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 17:06:47 +00:00
Arturo Bernal
3c8bb1b370 mod_http2: Send HTTP/2 error codes in GOAWAY frames
h2_session_shutdown() passed its reason, an APR or nghttp2 status, as the
error code of the GOAWAY frame. A connection timeout was sent as 70007
(APR_TIMEUP), an inadequate TLS connection as 22 (APR_EINVAL).

Give h2_session_shutdown() the HTTP/2 error code as a separate argument.
Timeouts and graceful shutdowns send NO_ERROR, failures INTERNAL_ERROR
and inadequate TLS parameters INADEQUATE_SECURITY.

PR: 70212
GitHub: closes #799


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939156 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 14:41:25 +00:00
Arturo Bernal
261058fa22 mod_dav: Do not advertise disabled TRACE
dav_method_options() builds its own Allow field and unconditionally
advertised TRACE for existing DAV resources, even when TraceEnable was
off.

Respect TraceEnable when constructing the DAV Allow field.

PR: 70264
GitHub: closes #827


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939146 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 09:01:44 +00:00
Arturo Bernal
ba3fa29664 core: Add common apr_off_t config parser
Add ap_size_parameter_parse(), a helper to parse a configuration value
as an apr_off_t, which fails on trailing characters and on overflow.
The range of the value remains up to the directive.

Use it for configuration directives which parsed such values in
different ways, some of them accepting trailing characters or doing no
checks at all: LimitRequestBody (unchanged behavior), ScriptLogLength,
ScriptLogBuffer, DavQuota, BufferSize, AuthFormSize, and the
mod_cache_disk and mod_cache_socache size and time directives.

GitHub: closes #829


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939129 13f79535-47bb-0310-9956-ffa450edef68
2026-10-15 03:41:47 +00:00
Joe Orton
b2dc966be4 mod_deflate: Fix sign extension when reading the gzip extra-field length.
* changes-entries/deflate-xlen-unsigned.txt: Add changes entry.

* modules/filters/mod_deflate.c (consume_zlib_flags): Cast the
  FEXTRA length bytes through unsigned char before widening so a
  byte with the high bit set is not sign-extended, fixing inflation
  of gzip streams carrying an extra field.

Submitted by: arshiya tabasum <arshi bugqore.com>
GitHub: closes #839


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939124 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 20:32:49 +00:00
Arturo Bernal
c1b7c82f7e core: Reject invalid values of LimitXMLRequestBody.
set_limit_xml_req_body() used atol(), so "abc123" and "123abc" were
accepted as 0 and 123, and a value out of range of a long gave an
undefined result. Parse the whole argument with apr_strtoff() like
LimitRequestBody, and reject values that do not fit in limit_xml_body
or exceed AP_MAX_LIMIT_XML_BODY.

PR: 69975
GitHub: closes #825


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939121 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 17:07:23 +00:00
Arturo Bernal
a8efded065 STATUS: Remove trailing whitespace.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939119 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 14:04:20 +00:00
Eric Covener
21637138c4 changes-entry for r1939088
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939105 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 00:22:20 +00:00
Eric Covener
c42c5bba35 add a changes-entry template
consistency and we could use a dummy file in 2.4.x
so changes-entries/ is not dropped by git every
time `make update-changes` empties it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939103 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 00:17:36 +00:00
Eric Covener
9502f678a6 Windows: use an unnested mutex like unix for LDAP
On Windows, a subrequest (against a different per-dir config?)
could get and cleanup an LDC that the main subrequest will also
cleanup.

Also don't use ldc->r for trace if null for any reason

Submitted by: covener

Github: closes #830


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939088 13f79535-47bb-0310-9956-ffa450edef68
2026-10-13 11:58:16 +00:00
Joe Orton
706cf2f800 * .github/workflows/sanity.yml: Run all jobs on the 1-vCPU
ubuntu-slim runner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: closes #834


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939071 13f79535-47bb-0310-9956-ffa450edef68
2026-10-12 17:39:33 +00:00
Jean-Frederic Clere
502faf44d5 Add --strict-optional to prevent success when missing modules.
Submitted by Maya Echtinaw

This closes #808



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939059 13f79535-47bb-0310-9956-ffa450edef68
2026-10-12 13:14:38 +00:00
Jean-Frederic Clere
9e1473f2c6 Arrange cleanup problem detected by ASAN.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939046 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 21:12:31 +00:00
Joe Orton
899294692f mod_auth_digest: Widen the one-time-nonce counter to 64 bits and move
inside the client hash table:

* modules/aaa/mod_auth_digest.c (struct hash_table): Hold the counter here
  as a 64-bit otn_counter, issued under client_lock like next_id rather
  than with 32-bit atomics (apr_atomic_inc64 is not available on the
  minimum APR).
  (initialize_tables): Seed it; drop its separate shared-memory allocation.
  (gen_nonce): Issue the ordinal under client_lock.
  (set_shmem_size): Account for two allocations rather than three.

* test/modules/aaa/test_006_config_errors.py
  (test_digest_069_shmemsize_no_room_for_entry_rejected): Adjust for the
  smaller minimum.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: close #787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939038 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 13:55:33 +00:00
Joe Orton
c2959da3ac * modules/aaa/mod_auth_digest.c: Code style tweaks only, no functional
change.

[skip ci]

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: PR #787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939037 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 13:52:20 +00:00
Joe Orton
df14898a97 mod_auth_digest: Validate AuthDigestShmemSize properly:
* modules/aaa/mod_auth_digest.c (set_shmem_size): Parse with apr_strtoff,
  reject overflow and trailing junk, and require room for the table, the
  counter, and at least one entry including rmm overhead.

* test/modules/aaa/test_006_config_errors.py
  (test_digest_068_shmemsize_trailing_junk_rejected,
  test_digest_069_shmemsize_no_room_for_entry_rejected): New.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: PR #787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939036 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 13:50:42 +00:00
Joe Orton
288f73763c mod_auth_digest: Send Digest domain= for a reverse-proxied request:
The domain was suppressed for any proxy request, but a reverse-proxied
request authenticates to this server with an origin-style
WWW-Authenticate, so AuthDigestDomain applies to it as it does to a
non-proxied request; only a forward-proxy (PROXYREQ_PROXY) request, whose
challenge is Proxy-Authenticate, should omit it.

* modules/aaa/mod_auth_digest.c (note_digest_auth_failure): Suppress
  domain= only for PROXYREQ_PROXY, matching the rest of the file.

* test/modules/aaa/env.py: Load mod_proxy and mod_proxy_http.

* test/modules/aaa/conftest.py: Add a reverse-proxied location which
  authenticates with Digest and sets AuthDigestDomain.

* test/modules/aaa/test_013_proxy_domain.py: New test suite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: PR #787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939035 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 13:44:17 +00:00
Joe Orton
ecdf990056 mod_auth_digest: Reject an Authorization uri which fails to unescape:
* modules/aaa/mod_auth_digest.c (copy_uri_components): Return the
  ap_unescape_url status rather than discarding it.
  (authenticate_digest_user): Fail the request when the request-target or
  the Authorization uri does not unescape.

* test/modules/aaa/test_001_challenge_response.py
  (test_digest_015_uri_bad_escaping_rejected): New.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: PR #787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939034 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 13:42:22 +00:00
Joe Orton
4843e52321 mod_auth_digest: Validate the nonce-count when parsing the header:
* modules/aaa/mod_auth_digest.c (digest_header_rec): Add nc, the parsed
  nonce-count.
  (parse_digest_header): Require nc to be 8 hex digits (RFC 7616 3.4) and
  store its value, so it is well-formed everywhere it is used or echoed.
  (check_and_record_nonce): Use the parsed value; drop the local strtol
  and the now-unreachable AH01773.

* test/modules/aaa/test_003_nccheck.py
  (test_digest_036_malformed_nc_rejected,
  test_digest_037_malformed_nc_does_not_poison_client): New.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: PR #787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939033 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 13:29:47 +00:00
Joe Orton
18309c6c04 mod_auth_digest: Fix handling of a request with no per-request record:
The per-request record is created in a post_read_request hook, which does
not run for a request rejected earlier (e.g. no Host on HTTP/1.1). An
ErrorDocument directing such a request into a Digest-protected location
then reached the auth hooks, which walked ->prev to the original request
and used its record without checking it had been created.

* modules/aaa/mod_auth_digest.c (make_digest_rec): New, split from
  init_digest_request, storing the record on a given request.
  (get_digest_rec): New; walk to the shared record and create it if the
  originating request never ran init_digest_request.
  (authenticate_digest_user, hook_note_digest_auth_failure): Use it in
  place of the open-coded walk, which did not check for a missing record.

* test/modules/aaa/conftest.py: Add an ErrorDocument 400 into a
  Digest-protected location.

* test/modules/aaa/test_012_errordoc.py: New test suite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: PR #787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939032 13f79535-47bb-0310-9956-ffa450edef68
2026-10-11 13:29:04 +00:00