Compare commits

..

34 commits

Author SHA1 Message Date
Xavier Bachelot
5eb62c37c3 Update to 0.19.1 2025-12-08 11:52:05 +01:00
Xavier Bachelot
a2a275aaad Fix bogus date in changelog 2025-12-08 11:30:52 +01:00
Xavier Bachelot
f89bd62c94 Drop support for EOL releases 2025-12-08 11:30:26 +01:00
Fedora Release Engineering
f4700c4903 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 22:13:23 +00:00
Fedora Release Engineering
9a97cb82f2 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 18:50:22 +00:00
Fedora Release Engineering
88d8849cc6 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 18:25:19 +00:00
Tomas Halman
b37f8f3110 Rebase to version 0.19.0
Resolves: rhbz#2258342 - new version is available
2024-01-25 13:44:12 +01:00
Fedora Release Engineering
c26b4068b7 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 07:44:04 +00:00
Fedora Release Engineering
4818a420c7 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 08:26:25 +00:00
Fedora Release Engineering
2c4ba2e95a Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 15:33:03 +00:00
Tomas Halman
a6644adc7f migrated to SPDX license 2023-03-07 12:04:51 +01:00
Fedora Release Engineering
0c78c612a3 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 20:29:44 +00:00
Tomas Halman
cdfb8f895a Version 0.18.1 is available
Resolves: rhbz#2158456
2023-01-06 15:39:51 +01:00
Tomas Halman
87dd298792 Fix build for fedora rawhide
- add systemd-rpm-macros build dependency
- fix bogus date in changelog
2022-10-05 13:08:35 +02:00
Tomas Halman
cf96c513f3 Logout endpoint should handle idP POST response
Resolves: rhbz#1306445 Support HTTP-POST binding for SingleLogoutService
2022-10-05 12:43:31 +02:00
Fedora Release Engineering
be4bcf8050 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 23:30:57 +00:00
Tomas Halman
e8e1fa6d86 Update mellon_create_metadata.sh to work with new openssl
Resolves: rhbz#2097703 Use of RANDFILE = /dev/urandom in openssl config
          break in OpenSSL 3
2022-07-01 15:04:51 +02:00
Fedora Release Engineering
79df3e2f46 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 20:12:10 +00:00
Tomas Halman
4901068138 New upstream version 0.18.0
Resolves: rhbz#1988235 CVE-2021-3639 mod_auth_mellon: Open Redirect
          vulnerability in logout URLs
Resolves: rhbz#1988664 mod_auth_mellon-0.18.0 is available
2021-12-17 18:30:03 +01:00
Sahana Prasad
cb20544e38 Rebuilt with OpenSSL 3.0.0 2021-09-14 19:07:58 +02:00
Fedora Release Engineering
353d86435e - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 15:10:43 +00:00
Fedora Release Engineering
09005a0274 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 20:37:44 +00:00
Tom Stellard
1ae540d471 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-07 01:50:35 +00:00
Jakub Hrozek
11d67e1cdd New upstream version 0.17.0 2020-09-16 10:24:34 +02:00
Fedora Release Engineering
5bc8f6552c - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 08:14:26 +00:00
Tom Stellard
30ff0281ec Use make_build macro instead of just make
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_parallel_make
2020-02-13 00:17:30 +00:00
Jakub Hrozek
9143479f9d New upstream version 0.16.0 2020-02-03 11:26:48 +01:00
Fedora Release Engineering
1ed2abfb90 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 13:46:55 +00:00
Jakub Hrozek
9707601413 New upstream version 0.15.0
Resolves: rhbz#1725742 - CVE-2019-13038 mod_auth_mellon: an Open Redirect
                           via the login?ReturnTo= substring which could
                           facilitate information theft [fedora-all]
2019-11-19 10:48:58 +01:00
Fedora Release Engineering
c201ed18c4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 17:27:22 +00:00
Jakub Hrozek
dc2e6c5a1f Upgrade to 0.14.2 2019-03-22 21:28:22 +01:00
Jakub Hrozek
d47343a603 remove unused patches 2019-03-22 21:12:26 +01:00
Fedora Release Engineering
1a042645d0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 11:13:36 +00:00
Igor Gnatenko
2568a8cfab Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:17 +01:00
7 changed files with 6012 additions and 148 deletions

8
.gitignore vendored
View file

@ -6,3 +6,11 @@
/mod_auth_mellon-0.12.0.tar.gz
/mod_auth_mellon-0.13.1.tar.gz
/mod_auth_mellon-0.14.0.tar.gz
/mod_auth_mellon-0.14.2.tar.gz
/mod_auth_mellon-0.15.0.tar.gz
/mod_auth_mellon-0.16.0.tar.gz
/mod_auth_mellon-0.17.0.tar.gz
/v0.18.0.tar.gz
/v0.18.1.tar.gz
/mod_auth_mellon-0.19.0.tar.gz
/mod_auth_mellon-0.19.1.tar.gz

5884
0000-configure.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,80 +0,0 @@
From e09a28a30e13e5c22b481010f26b4a7743a09280 Mon Sep 17 00:00:00 2001
From: John Dennis <jdennis@redhat.com>
Date: Tue, 5 Mar 2019 10:15:48 +0100
Subject: [PATCH] Modify am_handler setup to run before mod_proxy
The way the ECP flow works is that when a client initiates the flow, the
SP's response is HTTP 200, but not the requested content, but a signed XML
document that contains the "samlp:AuthnRequest" element. The idea is that
the ECP client would then determine the IDP and send the document to the
IDP, get a samlp:Response and convey that to the SP to get access to the
protected resource.
Internally, the auth check which is normally done with am_check_uid() set to
apache's ap_hook_check_user_id() hook, just responds with OK, so it pretends
to authenticate the user. Then in the usual flow, the request reaches the
ap_hook_handler which handles the request. There in the pipeline, mellon
registers functions am_handler() which should run first (APR_HOOK_FIRST),
determine that this request is an ECP one and return the ECP AuthnRequest
document. But in case the proxy module is also in the picture, the proxy
module "races" for who gets to be the first to handle the request in the
pipeline and wins. Therefore, the request reaches the protected resource
via mod_proxy and returns it.
This fix modifies the ap_hook_handler() call to explicitly run before
handlers from mod_proxy.c
To reproduce the bug:
0) Have a SP with mellon connected to a Keycloak IDP (or any other IDP I
guess). In the example below, my SAML SP is saml.federation.test
1) Set a Location protected by mellon that proxies requests to another
URL. For example:
ProxyPass /sp-proxy http://app.federation.test/example_app/
<Location /sp-proxy>
AuthType Mellon
MellonEnable auth
Require valid-user
</Location>
2) call:
curl -L -H "Accept: application/vnd.paos+xml" \
-H 'PAOS: ver="urn:liberty:paos:2003-08";"urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp"' \
http://saml.federation.test/sp-proxy
Before the patch, you would see whatever is served from the proxied
page. With the patch, you should get back a XML document with a
samlp:AuthnRequest.
---
mod_auth_mellon.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/mod_auth_mellon.c b/mod_auth_mellon.c
index 74bd328..5330f48 100644
--- a/mod_auth_mellon.c
+++ b/mod_auth_mellon.c
@@ -207,6 +207,12 @@ static int am_create_request(request_rec *r)
static void register_hooks(apr_pool_t *p)
{
+ /* Our handler needs to run before mod_proxy so that it can properly
+ * return ECP AuthnRequest messages when running as a reverse proxy.
+ * See: https://github.com/Uninett/mod_auth_mellon/pull/196
+ */
+ static const char * const run_handler_before[]={ "mod_proxy.c", NULL };
+
ap_hook_access_checker(am_auth_mellon_user, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_check_user_id(am_check_uid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_post_config(am_global_init, NULL, NULL, APR_HOOK_MIDDLE);
@@ -222,7 +228,7 @@ static void register_hooks(apr_pool_t *p)
* Therefore this hook must run before any handler that may check
* r->handler and decide that it is the only handler for this URL.
*/
- ap_hook_handler(am_handler, NULL, NULL, APR_HOOK_FIRST);
+ ap_hook_handler(am_handler, NULL, run_handler_before, APR_HOOK_FIRST);
#ifdef ENABLE_DIAGNOSTICS
ap_hook_open_logs(am_diag_log_init,NULL,NULL,APR_HOOK_MIDDLE);
--
2.19.2

View file

@ -1,44 +0,0 @@
From 62041428a32de402e0be6ba45fe12df6a83bedb8 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 19 Mar 2019 13:42:22 +0100
Subject: [PATCH] Fix redirect URL validation bypass
It turns out that browsers silently convert backslash characters into
forward slashes, while apr_uri_parse() does not.
This mismatch allows an attacker to bypass the redirect URL validation
by using an URL like:
https://sp.example.org/mellon/logout?ReturnTo=https:%5c%5cmalicious.example.org/
mod_auth_mellon will assume that it is a relative URL and allow the
request to pass through, while the browsers will use it as an absolute
url and redirect to https://malicious.example.org/ .
This patch fixes this issue by rejecting all redirect URLs with
backslashes.
---
auth_mellon_util.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/auth_mellon_util.c b/auth_mellon_util.c
index 0fab309..fd442f9 100644
--- a/auth_mellon_util.c
+++ b/auth_mellon_util.c
@@ -927,6 +927,13 @@ int am_check_url(request_rec *r, const char *url)
"Control character detected in URL.");
return HTTP_BAD_REQUEST;
}
+ if (*i == '\\') {
+ /* Reject backslash character, as it can be used to bypass
+ * redirect URL validation. */
+ AM_LOG_RERROR(APLOG_MARK, APLOG_ERR, HTTP_BAD_REQUEST, r,
+ "Backslash character detected in URL.");
+ return HTTP_BAD_REQUEST;
+ }
}
return OK;
--
2.19.2

View file

@ -55,9 +55,9 @@ echo
umask 0077
TEMPLATEFILE="$(mktemp -t mellon_create_sp.XXXXXXXXXX)"
ERRORFILE="$(mktemp -t mellon_create_err.XXXXXXXXXX)"
cat >"$TEMPLATEFILE" <<EOF
RANDFILE = /dev/urandom
[req]
default_bits = 2048
default_keyfile = privkey.pem
@ -68,9 +68,14 @@ policy = policy_anything
commonName = $HOST
EOF
openssl req -utf8 -batch -config "$TEMPLATEFILE" -new -x509 -days 3652 -nodes -out "$OUTFILE.cert" -keyout "$OUTFILE.key" 2>/dev/null
openssl req -utf8 -batch -config "$TEMPLATEFILE" -new -x509 -days 3652 -nodes -out "$OUTFILE.cert" -keyout "$OUTFILE.key" 2>"$ERRORFILE" || (
echo "Failed to generate certificate!" >&2
cat "$ERRORFILE" >&2;
rm -f "$TEMPLATEFILE" "$ERRORFILE"
exit 1
)
rm -f "$TEMPLATEFILE"
rm -f "$TEMPLATEFILE" "$ERRORFILE"
CERT="$(grep -v '^-----' "$OUTFILE.cert")"

View file

@ -1,29 +1,32 @@
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)}}
Summary: A SAML 2.0 authentication module for the Apache Httpd Server
Name: mod_auth_mellon
Version: 0.14.0
Release: 5%{?dist}
Group: System Environment/Daemons
Source0: https://github.com/UNINETT/mod_auth_mellon/releases/download/v%{version}/%{name}-%{version}.tar.gz
Version: 0.19.1
Release: 1%{?dist}
Source0: https://github.com/latchset/mod_auth_mellon/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: auth_mellon.conf
Source2: 10-auth_mellon.conf
Source3: mod_auth_mellon.conf
Source4: mellon_create_metadata.sh
Source5: README.redhat.rst
License: GPLv2+
BuildRequires: gcc
Patch0: 0000-configure.patch
License: GPL-2.0-or-later
BuildRequires: make
BuildRequires: gcc
BuildRequires: curl-devel
BuildRequires: glib2-devel
BuildRequires: httpd-devel
BuildRequires: lasso-devel >= 2.5.1-13
BuildRequires: openssl-devel
BuildRequires: xmlsec1-devel
BuildRequires: xmlsec1-openssl-devel
BuildRequires: rubygem-asciidoctor
BuildRequires: libtool-ltdl-devel
BuildRequires: systemd-rpm-macros
Requires: httpd-mmn = %{_httpd_mmn}
Requires: lasso >= 2.5.1-13
Url: https://github.com/UNINETT/mod_auth_mellon
Patch0001: 0001-Modify-am_handler-setup-to-run-before-mod_proxy.patch
Patch0002: 0002-Fix-redirect-URL-validation-bypass.patch
Url: https://github.com/latchset/mod_auth_mellon
%description
@ -32,20 +35,19 @@ SAML 2.0 federation protocol. It grants access based on the attributes
received in assertions generated by a IdP server.
%prep
%setup -q -n %{name}-%{version}
%patch0001 -p1
%patch0002 -p1
%autosetup -n %{name}-%{version} -p1
chmod +x configure
%build
export APXS=%{_httpd_apxs}
%configure --enable-diagnostics
make clean
make %{?_smp_mflags}
%{make_build}
cp .libs/%{name}.so %{name}-diagnostics.so
%configure
make clean
make %{?_smp_mflags}
%{make_build}
pushd doc/user_guide
asciidoctor -a data-uri mellon_user_guide.adoc
popd
@ -91,11 +93,7 @@ in the doc directory for instructions on using the diagnostics build.
%{_httpd_moddir}/%{name}-diagnostics.so
%files
%if 0%{?rhel} && 0%{?rhel} < 7
%doc COPYING
%else
%license COPYING
%endif
%doc README.md NEWS ECP.rst
%doc %{_pkgdocdir}/README.redhat.rst
%doc %{_pkgdocdir}/user_guide
@ -107,12 +105,105 @@ in the doc directory for instructions on using the diagnostics build.
%dir /run/%{name}/
%changelog
* Fri Mar 22 2019 Jakub Hrozek <jhrozek@redhat.com> - 0.14.0-5
* Mon Dec 08 2025 Xavier Bachelot <xavier@bachelot.org> - 0.19.1-1
- Update to 0.19.1
- Fix bogus date in changelog
- Drop support for EOL releases
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.19.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.19.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.19.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Jan 25 2024 Tomas Halman <thalman@redhat.com> - 0.19.0-1
- Resolves: rhbz#2258342 - new version is available
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Mar 7 2023 Tomas Halman <thalman@redhat.com> - 0.18.1-3
- migrated to SPDX license
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jan 6 2023 Tomas Halman <thalman@redhat.com> - 0.18.1-1
- Resolves: rhbz#2158456 - new version is available
* Wed Oct 5 2022 Tomas Halman <thalman@redhat.com> - 0.18.0-5
- Resolves: rhbz#1306445 Support HTTP-POST binding for SingleLogoutService
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jun 1 2022 Tomas Halman <thalman@redhat.com> - 0.18.0-2
- Update mellon_create_metadata.sh to work with new openssl
- Resolves: rhbz#2097703 Use of RANDFILE = /dev/urandom in openssl config
break in OpenSSL 3
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Dec 17 2021 Tomas Halman <thalman@redhat.com> - 0.18.0-1
- New upstream version 0.18.0
- Resolves: rhbz#1988235 CVE-2021-3639 mod_auth_mellon: Open Redirect
vulnerability in logout URLs
- Resolves: rhbz#1988664 mod_auth_mellon-0.18.0 is available
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 0.17.0-4
- Rebuilt with OpenSSL 3.0.0
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Sep 16 2020 Jakub Hrozek <jhrozek@redhat.com> - 0.17.0-1
- New upstream version 0.17.0
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Feb 13 2020 Tom Stellard <tstellar@redhat.com> - 0.16.0-2
- Use make_build macro instead of just make
- https://docs.fedoraproject.org/en-US/packaging-guidelines/#_parallel_make
* Mon Feb 3 2020 Jakub Hrozek <jhrozek@redhat.com> - 0.16.0-1
- New upstream version 0.16.0
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Nov 19 2019 Jakub Hrozek <jhrozek@redhat.com> - 0.15.0-1
- New upstream version 0.15.0
- Resolves: rhbz#1725742 - CVE-2019-13038 mod_auth_mellon: an Open Redirect
via the login?ReturnTo= substring which could
facilitate information theft [fedora-all]
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Mar 22 2019 Jakub Hrozek <jhrozek@redhat.com> - 0.14.2-1
- Upgrade to 0.14.2
- Related: rhbz#1691771 - CVE-2019-3877 mod_auth_mellon: open redirect in
logout url when using URLs with backslashes
- Related: rhbz#1691136 - CVE-2019-3878 mod_auth_mellon: authentication
bypass in ECP flow
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

View file

@ -1 +1 @@
SHA512 (mod_auth_mellon-0.14.0.tar.gz) = db1bf70c234fe89914b1bb34fc6afb5b901193a8c8c7e9946485a3e20a7d129c36427717eab53764edf5a5cff5c45dfe412e400cb1f50c49ef24dbbfd6ecbf25
SHA512 (mod_auth_mellon-0.19.1.tar.gz) = d512cf0eb52b91c7f6671e5e9425eb62263e58e0d3c5daea0fab13315e6310e228fd2f736a1793dc67037dbd717727a61908eb87e7b6654d7da4c62434c9301d