1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-21 06:02:00 +03:00

136 Commits

Author SHA1 Message Date
Christophe Jaillet
9a2eca1ca1 Follow-up to r1922931.
In set_cookie_name() and set_cookie_name2(), now that the empty 'name' argument is explicitly handled, the error message in check_string() can be simplified because the cookie name can't be empty anymore when this function is called.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926188 13f79535-47bb-0310-9956-ffa450edef68
2025-06-06 20:12:16 +00:00
Joe Orton
ffeacdcc52 Fix typo in code comments; dependancies -> dependencies
Submitted by: John Bampton <jbampton gmail.com>
Github: closes #520


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924446 13f79535-47bb-0310-9956-ffa450edef68
2025-03-18 09:54:15 +00:00
Eric Covener
75facde270 mod_session_dbd: set_cookie_name: ensure correct format
If args is an empty string, apr_strtok will return NULL and *last will never get set which results in a SIGSEGV in apr_isspace check

Submitted by: Thomas Meyer <thomas@m3y3r.de>

Github: closes #503


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1922931 13f79535-47bb-0310-9956-ffa450edef68
2025-01-06 19:28:35 +00:00
Giovanni Bechis
08a65eee57 fix separator parsing, PR #333
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908658 13f79535-47bb-0310-9956-ffa450edef68
2023-03-23 08:02:47 +00:00
Christophe Jaillet
caf4efca9f Harden mod_session and avoid overflow in case of indecently large session
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900335 13f79535-47bb-0310-9956-ffa450edef68
2022-04-27 20:08:50 +00:00
Yann Ylavic
7e09dd714f mod_session: account for the '&' in identity_concat().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887052 13f79535-47bb-0310-9956-ffa450edef68
2021-03-01 20:13:54 +00:00
Yann Ylavic
67bd9bfe6c mod_session: save one apr_strtok() in session_identity_decode().
When the encoding is invalid (missing '='), no need to parse further.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887050 13f79535-47bb-0310-9956-ffa450edef68
2021-03-01 20:07:08 +00:00
Christophe Jaillet
737298605c Improve a message about SessionExpiryUpdateInterval values
PR 64904

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883414 13f79535-47bb-0310-9956-ffa450edef68
2020-11-14 07:53:02 +00:00
Eric Covener
e8c16c83e1 be less specific and don't echo passphrase
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876807 13f79535-47bb-0310-9956-ffa450edef68
2020-04-22 01:16:00 +00:00
Eric Covener
2f1ab3e2e2 restore/explain new session creation
followup to r1874673.  With the included providers for load/save this path should
not be taken.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874691 13f79535-47bb-0310-9956-ffa450edef68
2020-03-02 12:03:26 +00:00
Eric Covener
6b7a8cc7c1 PR56040: add SessionCookieMaxAge On/Off
Allows mod_session cookies to out as "session" cookies.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874675 13f79535-47bb-0310-9956-ffa450edef68
2020-03-02 00:58:36 +00:00
Eric Covener
bef4205da3 bubble up an error if none of the passhrases work
previously, the un-decodable z->encoded would get set to NULL
but success would be returned




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874674 13f79535-47bb-0310-9956-ffa450edef68
2020-03-01 22:40:03 +00:00
Eric Covener
2c8a4fe01c PR56052: resolve problems with expired sessions
session_load providers cache the session_rec pointer, so hollow
them out and reuse them instead of replacing them.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874673 13f79535-47bb-0310-9956-ffa450edef68
2020-03-01 22:39:11 +00:00
Mike Rumph
85760859ca Fix spelling errors found by codespell. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
2020-02-13 18:15:57 +00:00
Joe Orton
87ff011f6a Also avoid adding the Set-Cookie header in both r->headers_out and
r->err_headers_out in ap_cookie_remove and ap_cookie_remove2 functions
to avoid duplication in HTTP response.  (Follow-up to r1843244)

Closes #73
PR: 60910
Submitted by: Lubos Uhliarik <luhliari redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1869785 13f79535-47bb-0310-9956-ffa450edef68
2019-11-14 08:39:46 +00:00
Eric Covener
0f5d0ad18e leave a hint about session expiration at TRACE2
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1865871 13f79535-47bb-0310-9956-ffa450edef68
2019-08-25 01:54:39 +00:00
Graham Leggett
cd58f1856a After reinstatement of DSO support in APR/APR-util, revert r1837437,
r1837435, r1834553, r1833598, r1833452, r1833383, r1833368.

Undoes the following:

mod_ssl: OpenSSL now initializes fully through APR, use that.

mod_ssl: build with LibreSSL.

LibreSSL seems to be openssl-1.1 API compatible only in version 2.8 (master).
So use that for MODSSL_USE_OPENSSL_PRE_1_1_API instead of 2.7, the two 2.7
compatibility-exceptions are handled explicitely but overall it's simpler.

Regarding CRYPTO_malloc_init vs OPENSSL_malloc_init, libreSSL uses none, the
former used to be a no-op but depends is LIBRESSL_INTERNAL in latest versions,
while the latter has never been (and will never be) defined. So don't call any
with LibreSSL.

Follow up to r1833368: share openssl between modules.

Both libapr[-util], the core PRNG, mod_ssl, mod_crypto and mod_session_crypto
can use the same crypto library (e.g. openssl), use the new APR crypto loading
API so that they can work together and initialize/terminate the lib either once
for all or on demand and reusable by the others.

Follow up to r1833368: apr_crypto_prng_after_fork() now used a PID.

Make use of the new apr_crypto_rng API if available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1861947 13f79535-47bb-0310-9956-ffa450edef68
2019-06-23 21:10:23 +00:00
Hank Ibell
39fbba1eb0 Always decode session attributes early.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1850947 13f79535-47bb-0310-9956-ffa450edef68
2019-01-10 15:52:31 +00:00
Luca Toscano
cb38043244 mod_session_cookie: avoid adding the Set-Cookie header
in both r->headers_out and r->err_headers_out
                    to avoid duplication.

In session_cookie_save it seems that ap_cookie_write is called
with r->headers_out and r->err_headers_out, ending up in the same
Set-Cookie header on both tables and eventually duplicated in the
HTTP response. I took Emmanuel's patch and trimmed out the bits
that remove the header only from r->err_headers_out (leaving it
to do the work on both tables) as attempt to change this bit of code
in the most conservative way as possible. Sending a commit for
a broader review.

PR: 60910,56098,55278



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1843244 13f79535-47bb-0310-9956-ffa450edef68
2018-10-09 12:29:08 +00:00
Yann Ylavic
e6c090ea5a Follow up to r1833368: share openssl between modules.
Both libapr[-util], the core PRNG, mod_ssl, mod_crypto and mod_session_crypto
can use the same crypto library (e.g. openssl), use the new APR crypto loading
API so that they can work together and initialize/terminate the lib either once
for all or on demand and reusable by the others.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1833452 13f79535-47bb-0310-9956-ffa450edef68
2018-06-13 09:54:16 +00:00
Yann Ylavic
bf85d9079e mod_session: Strip Session header when SessionEnv is on.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824390 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 00:22:38 +00:00
Yann Ylavic
4c670d1715 Follow up to r1772812: update APLOGNO().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783764 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 14:03:28 +00:00
Yann Ylavic
fed21b132d mod_session_crypto: Authenticate the session data/cookie with a MAC (SipHash)
to prevent deciphering or tampering with a padding oracle attack.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1772812 13f79535-47bb-0310-9956-ffa450edef68
2016-12-05 23:43:05 +00:00
Jacob Champion
091f96ee10 Remove unnecessary apr_table_do() function casts
Function casts can cause hard-to-debug corruption issues if a
declaration is accidentally changed to be incompatible. Luckily, most of
the function casts for apr_table_do() calls are unnecessary. Remove
them, and adjust the signatures for helpers that weren't taking void* as
the first argument.

The remaining helper that requires a cast is http_filter.c's
form_header_field(), which is probably where many of these casts were
copy-pasted from. I have left it as-is: it has other direct callers
besides apr_table_do(), and it's already documented with warnings not to
change the function signature.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1769192 13f79535-47bb-0310-9956-ffa450edef68
2016-11-10 20:53:21 +00:00
Yann Ylavic
a83e9b4d71 mod_session: Introduce SessionExpiryUpdateInterval which allows to
configure the session/cookie expiry's update interval. PR 57300.

Submitted by: Paul Spangler <paul.spangler ni.com>
Reviewed/Committed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1709121 13f79535-47bb-0310-9956-ffa450edef68
2015-10-16 22:36:17 +00:00
Yann Ylavic
cd7fdfee05 mod_session_dbd: follow up to r1687021.
Move the new pool argument of dbd_load() first as the other functions in the
module (no functional change).
Suggested by: mrumph

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1687087 13f79535-47bb-0310-9956-ffa450edef68
2015-06-23 15:38:13 +00:00
Yann Ylavic
4aa8d59e98 mod_session_dbd: follow up to r1686122.
DBD entries should also have request lifetime.
Proposed by: Jacob Champion <jacob.champion ni.com>
Reviewed by: ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1687021 13f79535-47bb-0310-9956-ffa450edef68
2015-06-23 10:54:15 +00:00
Nick Kew
ed50579d80 mod_session_dbd: Request Notes should have request lifetime.
Patch by Jacob Champion at ni.com


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1686122 13f79535-47bb-0310-9956-ffa450edef68
2015-06-17 23:09:36 +00:00
Yann Ylavic
c1d21475a6 mod_authn_dbd, mod_authz_dbd, mod_session_dbd, mod_rewrite: Fix lifetime
of DB lookup entries independently of the selected DB engine.  PR 46421.

Suggested by: Michel Stam <michel reverze net>
Proposed by: Steven whitson <steven.whitson gmail com>
Reviewed/Extended/Committed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1679181 13f79535-47bb-0310-9956-ffa450edef68
2015-05-13 11:34:30 +00:00
Graham Leggett
48ebde687b mod_session: When we have a session we were unable to decode, behave as if there was no session at all.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560977 13f79535-47bb-0310-9956-ffa450edef68
2014-01-24 13:02:42 +00:00
Jeff Trawick
2ab66dcfb3 mod_session: Fix problems interpreting the SessionInclude and
SessionExclude configuration.

PR: 56038
Submitted by: Erik Pearson <erik adaptations.com>
Reviewed by: trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1559828 13f79535-47bb-0310-9956-ffa450edef68
2014-01-20 21:01:15 +00:00
Christophe Jaillet
6ae5c8f6f3 Remove redundant check (already performed the line before)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1551012 13f79535-47bb-0310-9956-ffa450edef68
2013-12-15 10:30:35 +00:00
Graham Leggett
c7ec3ecccd mod_session_crypto: Make sure we try to initialise twice, so we don't
succeed in configtest but fail on restart.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1550312 13f79535-47bb-0310-9956-ffa450edef68
2013-12-11 23:14:46 +00:00
Graham Leggett
c8b1ad8f55 mod_session: Reset the max-age on session save. PR 47476.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531683 13f79535-47bb-0310-9956-ffa450edef68
2013-10-13 13:07:19 +00:00
Graham Leggett
0d9b5c81a5 mod_session: After parsing the value of the header specified by the
SessionHeader directive, remove the value from the response. PR 55279.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531679 13f79535-47bb-0310-9956-ffa450edef68
2013-10-13 12:27:54 +00:00
Daniel Ruggeri
90f9939cee Add exec: callout support for mod_session_crypto
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524079 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 14:53:21 +00:00
Graham Leggett
3eed634c9c CVE-2013-2249
mod_session_dbd: Make sure that dirty flag is respected when saving 
sessions, and ensure the session ID is changed each time the session 
changes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1488158 13f79535-47bb-0310-9956-ffa450edef68
2013-05-31 11:13:25 +00:00
Guenter Knauf
1ef0978c78 Kill some NetWare build warnings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1481040 13f79535-47bb-0310-9956-ffa450edef68
2013-05-10 14:58:20 +00:00
Stefan Fritsch
e00688ffd9 Use %pm available since apr 1.3 instead of an extra call to apr_strerror
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1463056 13f79535-47bb-0310-9956-ffa450edef68
2013-03-31 21:29:28 +00:00
Graham Leggett
48a3a922e2 mod_session_crypto: Protect ourselves against underlying libraries who
fail to load without providing an error message of their own.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1418655 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 12:12:16 +00:00
Guenter Knauf
5a6d76ec90 Axed C++ comments.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1409170 13f79535-47bb-0310-9956-ffa450edef68
2012-11-14 11:43:49 +00:00
Christophe Jaillet
1070bb2265 formatting: space vs tab
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1408961 13f79535-47bb-0310-9956-ffa450edef68
2012-11-13 21:08:33 +00:00
Christophe Jaillet
b40d4dc880 mod_session_dbd: fix a segmentation fault in the function dbd_remove.
The segmentation fault is caused by an uninitialized function pointer session_dbd_acquire_fn.
PR 53452

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1408958 13f79535-47bb-0310-9956-ffa450edef68
2012-11-13 21:03:10 +00:00
Christophe Jaillet
2cf5acd15f s/;;/;/
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1397636 13f79535-47bb-0310-9956-ffa450edef68
2012-10-12 16:41:34 +00:00
Stefan Fritsch
8c960a8c15 Various code clean up
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 52893 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361801 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 21:14:00 +00:00
Igor Galić
03c9315842 Your APR does not include SSL/EVP support. Yes, but how do I enable it? --with-crypto
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1324760 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 13:41:36 +00:00
Graham Leggett
720f5f4e43 mod_session: Sessions are encoded as application/x-www-form-urlencoded strings, however we
do not handle the encoding of spaces properly. Fixed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1293658 13f79535-47bb-0310-9956-ffa450edef68
2012-02-25 18:10:56 +00:00
Stefan Fritsch
21cc07a470 Make APACHE_MODULE() accept an optional prerequisite module for configure.
Introduce the following configure time dependencies:
  mod_proxy_* (except proxy_html) require mod_proxy
  mod_dav_* require mod_dav
  mod_session_* require mod_session


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1234180 13f79535-47bb-0310-9956-ffa450edef68
2012-01-20 22:14:31 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Graham Leggett
7d139ae671 mod_session_dbd: Use apr_status_t as a return code across the mod_session API.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209618 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 18:14:52 +00:00