Commit Graph

4631 Commits (0b49e767b906d6861f63d3764001bd73a65265dc)
 

Author SHA1 Message Date
Glenn Strauss 0b49e767b9 [mod_ajp13] fix crash with bad response headers (fixes #3170)
fix crash with bad response headers from AJP13 backend

(thx Michał Dardas)

x-ref:
  "mod_ajp13 read heap buffer overflow"
  https://redmine.lighttpd.net/issues/3170
10 months ago
Brad Smith 6524a2fb6f Update comment about TCP_INFO on OpenBSD
github: closes #113
10 months ago
Glenn Strauss 6252c682da - next is 1.4.67 10 months ago
Glenn Strauss 807b3e9a36 [doc] NEWS 10 months ago
Glenn Strauss dedf17b44a [core] fix HTTP/2 downloads >= 4GiB (fixes #3166)
(thx flynn)

regression in lighttpd 1.4.60 - lighttpd 1.4.65

x-ref:
  "GET requests hangs on big files after 10% using HTTP/2"
  https://redmine.lighttpd.net/issues/3166
10 months ago
Glenn Strauss 7b953c337a [core] perf: adjust max h2 stream send increment
subtract 9 byte HTTP/2 frame overhead from each 16k DATA
frame for more efficient sending of large files
10 months ago
Glenn Strauss 971773f1fa [mod_wstunnel] fix crash with bad hybivers (fixes #3165)
(thx Michał Dardas)

x-ref:
  "mod_wstunnel null pointer dereference"
  https://redmine.lighttpd.net/issues/3165
10 months ago
Glenn Strauss 5d80e41ab2 [mod_authn_gssapi] warn if no confidentiality flag (fixes #3163)
warn if no confidentiality flag (GSS_C_CONF_FLAG) returned in flags
after call to gss_accept_sec_context() when SPNEGO Negotiate
(auth.require "method" => "gssapi") and credentials are being
stored (auth.backend.gssapi.store-creds = "enable" (default))

Missing flag GSS_C_CONF_FLAG is no longer an error.
  (mod_authn_gssapi is for auth, not used for message transport;
   mod_authn_gssapi never uses gss_unwrap())

NB: mod_authn_gssapi should be used over TLS for encryption.

x-ref:
  "gssapi - no confidentiality for user"
  https://redmine.lighttpd.net/issues/3163
  "Chapter 1 The GSS-API: An Overview" (online reference)
  https://docs.oracle.com/cd/E19683-01/816-1331/overview-6/index.html
10 months ago
Glenn Strauss 93d6466230 [core] fix SIGUSR1 graceful restart w/ TLS (fixes #3164)
(thx oldium)

fix SIGUSR1 graceful restart with TLS sockets
(regression in lighttpd 1.4.65)

x-ref:
  "Graceful restart starts sending 400 Bad Request for SSL connection handshake"
  https://redmine.lighttpd.net/issues/3164
10 months ago
Glenn Strauss 8f1c0486e7 [core] preprocessor option to force crypto lib
add preprocessor option to force crypto lib used by lighttpd base
  -DFORCE_MBEDTLS_CRYPTO for mbed TLS
  or -DFORCE_WOLFSSL_CRYPTO for WolfSSL

This allows building lighttpd with support for multiple TLS modules,
and at the same time specifying the lighttpd base crypto lib dependency.

(Packages such as OpenWRT lighttpd package would need to update
package dependency along with specifying the preprocessor define)

If lighttpd is built with meson and without "-Dwith_nettle=true",
then lighttpd will use mbed TLS if built with "-Dwith_mbedtls",
so the preprocessor option is not strictly necessary for mbed TLS.
However, if built with "-Dwith_mbedtls" and "-Dwith_wolfssl" *and*
without "-Dwith_nettle=true" *and* lighttpd base crypto dependency
on WolfSSL is desired, then CFLAGS -DFORCE_WOLFSSL_CRYPTO is needed,
e.g. with a patch to add it to 'defs' near the top of src/meson.build.

x-ref:
  "lighttpd authentication modules depends on libnettle"
  https://github.com/openwrt/packages/issues/18851
10 months ago
Glenn Strauss cdc881038b [core] check r->http_status before handling Range
(thx atw717)

check r->http_status before handling Range so that error handling is
(re-)invoked only if Range handling returns an error status.

x-ref:
  "No setenv.add-response-header lines when http status code is 404"
  https://redmine.lighttpd.net/boards/2/topics/10583
10 months ago
Glenn Strauss fe8b73b2f9 [mod_webdav] build with Android NDK 10 months ago
Glenn Strauss 10d5786fe6 [core] fix buffer_substr_replace() extend (fixes #3160)
This bug affects mod_proxy header rewriting to/from backend
(regression in lighttpd 1.4.60 - lighttpd 1.4.65)

(thx k.trempala)

x-ref:
  "Wrong buffer size in function buffer_substr_replace() in file buffer.c"
  https://redmine.lighttpd.net/issues/3160
11 months ago
Glenn Strauss 5f70dac7e6 [mod_deflate] fix use of libdeflate for files>128k (fixes #3161)
must use mmap MAP_SHARED for writes to modify file on disk
(MAP_PRIVATE does not modify underlying file on disk)

(thx flynn)

x-ref:
  "gzip dynamic compression broken with source size bigger than 128k"
  https://redmine.lighttpd.net/issues/3161
11 months ago
Glenn Strauss aaf36f5838 [core] perf tweak buffer_eq_icase_ssn() 11 months ago
Glenn Strauss 5fef5e2208 [core] fix li_base64_dec() on whitespace
(regression in lighttpd 1.4.60 - lighttpd 1.4.65)

impacted: mod_wolfssl loading certificate private keys

must ignore whitespace in count of encoded chars
11 months ago
Glenn Strauss 81a0e4377c [mod_wolfssl] compat with older wolfssl versions
wolfSSL_X509_get_name_oneline() added in wolfssl v4.4.0
11 months ago
Glenn Strauss 2e7f0eb554 [core] clarify server.username = "root" error msg
clarify server.username = "root" error message
clarify server.groupname = "root" error message

Suggest commenting out those directives in lighttpd.conf if set to root.

Just like any normal unix program, lighttpd runs as the
user/group under which the process was started, unless you run
lighttpd as root and instruct lighttpd to setuid/setgid to a
different user/group (via server.username and server.groupname).
That *different* user/group should not be uid/gid 0, or else they
are not *different* from root and might be a configuration mistake.

x-ref:
  https://forum.snapcraft.io/t/lighttpd-snap-reports-all-well-but-doesnt-serve-up-anything/27594/8
11 months ago
Glenn Strauss 6821ea6673 [mod_webdav] webdav_reqbody_type_xml() fixes
webdav_reqbody_type_xml() must check request headers (behavior fix)
protect webdav_reqbody_type_xml() with USE_PROPPATCH (compile fix)
11 months ago
Glenn Strauss 222d8416d9 [mod_openssl] compile compat w/ openssl < 1.1.0
(thx gmd20)

github: closes #112
12 months ago
Glenn Strauss b25a120191 [mod_dirlisting] send ETag, Cache-Control w/ cache
send ETag, Cache-Control max-age w/ cached directory listing
12 months ago
Glenn Strauss c051df6a3e [core] do not load indexfile, dirlisting if unused
do not load mod_indexfile or mod_dirlisting unless used and enabled
(avoid loading some default modules unless used and enabled)
12 months ago
Glenn Strauss 63a578fe92 [doc] more consistent use of vars in examples
incorporate some patches from macports package of lighttpd (thx)
12 months ago
Glenn Strauss fcae0af953 [mod_webdav] check reqbody Content-Type is XML 12 months ago
Glenn Strauss d7bfd56d16 [mod_webdav] cold func if xml reqbody w/o db conf 12 months ago
Glenn Strauss e47e436f6b [doc] add libdeflate to INSTALL 12 months ago
Glenn Strauss 11864d2999 [autoconf] update ax_prog_cc_for_build.m4
update scripts/m4/ax_prog_cc_for_build.m4 from serial 20 to serial 21
(This should fix build errors occuring with './configure -C' caching)

https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prog_cc_for_build.m4
12 months ago
Glenn Strauss 91ce3b0857 [core] buffer_append_bs_escaped_json()
separate func from buffer_append_bs_escaped() so that both
buffer_append_bs_escaped() and buffer_append_bs_escaped_json()
can be slightly more specialized and optimized
12 months ago
Glenn Strauss ca407dca5d [multiple] fix json encoding
(thx helmut)

fix json encoding to operate on unicode code points
12 months ago
Glenn Strauss 9ac5da2720 [mod_magnet] reset for http-response-send-file
reset r->http_status and clear response body for http-response-send-file
called from magnet.attract-response-start-to in order to match
http_response_send_file() behavior to send ETag, replace response body
12 months ago
Glenn Strauss f86b448799 [core] h2: optim: send window update in 16k units
h2: optim: send window update in 16k units for both sessions and streams
12 months ago
Glenn Strauss 40f289b6c3 - next is 1.4.66 12 months ago
Glenn Strauss 388aad082c [doc] NEWS 12 months ago
Glenn Strauss 71317bc997 [tests] test stubs for http_header.c and http_kv.c 12 months ago
Glenn Strauss 5a32a6dc51 [core] update cached tables with Priority header
(thx jens-maus)
12 months ago
Glenn Strauss f20061e482 [core] h2: avoid sending tiny DATA frames
h2: avoid sending tiny DATA frames when h2 window is tiny
and a larger amount of data is pending to be sent;
wait for slightly larger window to be available

note: must temporarily disable this when running h2spec since some
      h2spec tests expect 1-byte DATA frame, not a deferred response
12 months ago
Glenn Strauss ad4a790495 [core] h2: avoid sending small WINDOW_UPDATE frames
Note this may slow down uploads due to delay in sending WINDOW_UPDATE
smaller than the default max frame size (16384), but as a trade-off
this aims to reduce degenerative behavior from clients sending an
increasing number of tiny DATA frames.  The default 65535 value for
SETTINGS_INITIAL_WINDOW_SIZE (which lighttpd immediately increases to
65536) is larger than 16384, so deferring small updates should not
exhaust the window (from lighttpd's perspective).

x-ref:
  "Slow upload / Increase CPU/Memory usage with HTTP/2 enabled"
  https://redmine.lighttpd.net/issues/3089
  "libnghttp2 degenerative behavior possible when HTTP/2 window size exhausted"
  https://github.com/nghttp2/nghttp2/issues/1722
12 months ago
Glenn Strauss ef62ff9419 [core] increase session window size to 256k
(adjust the HTTP/2 frame value to match the comment;
 previous value was actually adjusting only to 128k)
1 year ago
Glenn Strauss 5d0f174feb [core] h2 SETTINGS_INITIAL_WINDOW_SIZE 64k (fixes #3089)
Increase stream window size to 64k (from default 64k-1)
Increase session window size to 256k (from default 64k-1)
  (multiple of SETTINGS_MAX_FRAME_SIZE (default 16k))
  (rely on TCP window scaling and TCP congestion control
   to manage client sending too much data)

Window size as multiple of SETTINGS_MAX_FRAME_SIZE (default 16k) may be
friendlier to client buffer management and more efficient for uploading.
Window sizes are not increased to arbitrarily large numbers as the
HTTP/2 flow control may be useful to help simplistic/naive clients
avoid symptoms of buffer bloat.

Bandwidth delay product on high bandwidth, high latency links may be
large, so increasing window sizes may increase performance.  However,
lighttpd code does not check actual per-connection RTT or kernel
socket buffer sizes.  256k chosen as session window size, and 192k as
stream window size.

Above changes avoid degenerative behavior from the widely deployed
libnghttp2 which may devolve to sending 1 byte at a time in some cases.
  https://redmine.lighttpd.net/issues/3089

x-ref:
  "Slow upload / Increase CPU/Memory usage with HTTP/2 enabled"
  https://redmine.lighttpd.net/issues/3089
  Delivering HTTP/2 upload speed improvements
  https://blog.cloudflare.com/delivering-http-2-upload-speed-improvements/
1 year ago
Glenn Strauss 152596158a [mod_mbedtls] fix crt chain construction logic
fix crt chain construction logic inversion

(thx DamienT)
1 year ago
Glenn Strauss def1bfa976 [mod_webdav] alt handling PROPFIND on collection
alternative way of handling PROPFIND on collection where the request was
made without a trailing slash.  Instead of sending 308 redirect in some
cases, set Content-Location response header *and* treat as if request
had been made with trailing slash on the collection for PROPFIND and
PROPPATCH.

https://www.rfc-editor.org/rfc/rfc4918#section-5.2
  There is a standing convention that when a collection is referred to
  by its name without a trailing slash, the server MAY handle the
  request as if the trailing slash were present. In this case, it
  SHOULD return a Content-Location header in the response, pointing to
  the URL ending with the "/".

x-ref:
  "The previous workaround for GVFS is breaking the new version of GVFS"
  https://redmine.lighttpd.net/boards/2/topics/10468
  HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)
  https://www.rfc-editor.org/rfc/rfc4918#section-5.2
1 year ago
Glenn Strauss 5c4cc9f567 [core] avoid server.use-ipv6 warning after SIGUSR1 1 year ago
Glenn Strauss 833f6aa4c0 [TLS] inherit ssl.engine from global scope
Since lighttpd 1.4.56, an oversight in config processing missed
setting explicitly p->conf.ssl_enabled = 0 in network.c when
initializing conditions.  When ssl.engine = "enable" in lighttpd.conf
global scope, the missing reset in network.c required non-TLS ports
(e.g. $SERVER["socket"] == ":80") to contain ssl.engine = "disable"
in order for requests to those ports to be served rather than erroring.

(This error was discovered during collaboration with jens-maus in
 https://github.com/jens-maus/RaspberryMatic/pull/1847)

There have been zero other instances of this error reported since the
release of lighttpd 1.4.56 in Nov 2020.

Therefore, having ssl.engine = "enable" inherited from the global scope
is unlikely to have any widespread impact in practice, and enabling
ssl.engine = "enable" (along with TLS certificate configuration) is now
recommended as default.  When ssl.engine = "enable" in the global scope,
ssl.engine = "disable" should be specified in those $SERVER["socket"]
conditions where clear-text is desired.
1 year ago
Glenn Strauss da8025fb30 [core] reset internal flags after graceful restart
reset internal socket flags after graceful restart:
re-init srv->socket->sidx and srv_socket->is_ssl
  after SIGUSR1 or systemd socket activation

(thx jens-maus)

x-ref:
  https://github.com/jens-maus/RaspberryMatic/pull/1847
1 year ago
Glenn Strauss 33f73b4d82 [multiple] application/javascript text/javascript
translate MIME type "application/javascript" to "text/javascript"

(if required, type may still be overwritten by mod_setenv or mod_magnet)

x-ref:
  "Updates to ECMAScript Media Types"
  https://www.rfc-editor.org/rfc/rfc9239
1 year ago
Glenn Strauss a6d4a98c07 [core] use current dir if context->basedir blank 1 year ago
Glenn Strauss ee6df0961b [build] update descriptions to remove old lua ver 1 year ago
Glenn Strauss 8bdea5db14 [mod_magnet] skip req body collect warn if modsec3
skip req body collect warning if handler is already mod_security3
(prototype mod_security3 uses similar technique to collect req body)
1 year ago
Glenn Strauss a01e62bb7d [core] "url-invalid-utf8-reject" normalization opt
server.http-parseopts "url-invalid-utf8-reject" url normalization option
default: "url-invalid-utf8-reject" => "enable"
1 year ago
Glenn Strauss 467fb2bfb7 [mod_cgi] fix detection of failing error handler (fixes #3157)
(thx sparlane)

failing error handler produced no output and POLLRDHUP received with
POLLIN.

commit dd23fcb2 changed return value from HANDER_FINISHED to
HANDLER_GO_ON when introducing cgi_process_rd_revents(), and POLLRDHUP
case which previously fell through needed to continue to return
HANDLER_FINISHED after calling cgi_connection_close()

x-ref:
  "fall-back with cgi error handler no longer works"
  https://redmine.lighttpd.net/issues/3157
1 year ago