Commit Graph

438 Commits

Author SHA1 Message Date
Christophe Siraut 58cd65ea41 debian/control: remove obsolete substitution variable 2020-02-18 10:29:47 +01:00
Christophe Siraut d929ade2d9 debian/control: Build-Depends on apache2-dev 2020-02-18 10:29:47 +01:00
Benjamin Dauvergne c20a2e3c99 Bundle git-version-gen in the tarball 2020-02-18 10:29:46 +01:00
Benjamin Dauvergne 0531f058d6 Add a .tarball-version file to tarballs 2020-02-18 10:29:30 +01:00
Benjamin Dauvergne fec1f4ae26 Compute version using git tags 2020-02-18 10:29:10 +01:00
Benjamin Dauvergne 157273d29b debian/docs: remove TODO 2020-02-18 10:28:40 +01:00
Benjamin Dauvergne 857aa2690f autogen.sh: all configure at the end 2020-02-18 10:28:40 +01:00
Benjamin Dauvergne 06c1857ba1 Makefile.in: add a dist-bzip2 target 2020-02-18 10:28:40 +01:00
Benjamin Dauvergne c0f8c431da Add automake and autotols to build depends 2020-02-18 10:28:40 +01:00
Benjamin Dauvergne cab0a0fac4 Add debian directory 2020-02-18 10:28:40 +01:00
Olav Morken 5c290287f0
Merge pull request #219 from Uninett/travis-cleanups
Cleanups for Travis CI build
2019-08-15 08:20:34 +02:00
Olav Morken 6016d38608 Travis CI: Make script more readable
Instead of listing all commands to run in a single line, split it into
multiple steps. This makes it easier to read the build script, and
also makes the output more readable.
2019-08-15 08:11:54 +02:00
Olav Morken abdea2f7f0 Travis CI: Switch to installing packages using the APT addon
Now that we no longer need to conditionally install a package, we can
use the APT addon for Travis CI to install the required packages.

See:

* https://docs.travis-ci.com/user/installing-dependencies/#installing-packages-with-the-apt-addon
  (Installing Packages with the APT Addon)
2019-08-15 08:07:42 +02:00
Olav Morken 5388c77743
Merge pull request #218 from Uninett/update-build-environment
Switch to Ubuntu 18.04 (Bionic) for Travis CI build
2019-08-15 08:05:38 +02:00
Olav Morken e6229f968b
Merge pull request #215 from strangeglyph/patch-2
Fix misspelled config options in the user guide
2019-08-15 07:58:00 +02:00
Olav Morken afe6d844db
Merge pull request #217 from Uninett/fix-travis
Fix build on Travis CI
2019-08-15 07:43:39 +02:00
Olav Morken 841c59333e Switch to Ubuntu 18.04 (Bionic) for Travis CI build
This patch updates the Travis CI build configuration to use Ubuntu
18.04 (Bionic).

Since Ubuntu 18.04 no longer has separate packages for the different
Apache Multi-Processing Modules, we no longer need to build with both
apache2-prefork-dev and apache2-threaded-dev. We simply need to build
against apache2-dev.
2019-08-15 07:42:53 +02:00
Olav Morken 6df1811d9c Fix build on Travis CI
Travis CI recently changed the default distribution from Ubuntu 14.04
(Trusty) to Ubuntu 18.04 (Xenial):

  https://blog.travis-ci.com/2019-04-15-xenial-default-build-environment

This was a slow rollout, and does not appear to have reached this
project until the last couple of weeks.

This patch simply pins the distribution used for tests to Ubuntu 14.04
(Trusty), to ensure that we always use a consistent build environment.

A later patch will update it to a more recent distribution.
2019-08-15 07:33:29 +02:00
strangeglyph 73ed6609d6
Fix misspelled config options in the user guide
Compare https://github.com/Uninett/mod_auth_mellon/blob/master/auth_mellon_config.c#L1306
2019-08-14 14:36:17 +00:00
Olav Morken 08712ef59a
Merge pull request #212 from siemens/feat/gitignore
feat: add a .gitignore
2019-07-23 13:22:21 +02:00
Olav Morken 31e324d15c
Merge pull request #211 from siemens/feat/authn-context-comparision-type
feat: add MellonAuthnContextComparisonType option
2019-07-23 13:19:31 +02:00
Roger Meier 59648dda65 feat: add MellonAuthnContextComparisonType option 2019-07-19 16:55:33 +02:00
Roger Meier e7760cda1d feat: add a .gitignore 2019-07-08 06:53:44 +02:00
Olav Morken 6b66c3b31f
Merge pull request #208 from vit4/master
Fix implicit function declaration: rindex on Solaris
2019-06-07 10:47:11 +02:00
Vita Batrla f9b925f21c Fix implicit function declaration: rindex on Solaris
Compilation on reports warning:

"auth_mellon_diagnostics.c", line 188: warning: implicit function declaration: rindex
"auth_mellon_diagnostics.c", line 188: warning: improper pointer/integer combination: op "="

And binary dumps core, because rindex() is assumed to be integer type, so
compiler sign extends its return value and then uses the number as pointer:

am_diag_cond_str+0x154:      call   -0x1e119 <PLT=libc.so.1`rindex>
am_diag_cond_str+0x159:      movslq %eax,%rax
am_diag_cond_str+0x15c:      testq  %rax,%rax
am_diag_cond_str+0x15f:      je     +0x7     <am_diag_cond_str+0x168>
am_diag_cond_str+0x161:      movb   $0x5d,(%rax)  <- SIGSEGV

Fixes issue #207.
2019-06-07 10:28:14 +02:00
Olav Morken 8949b0e3d9
Merge pull request #200 from jhrozek/conf_prefix
Make the environment variable prefix configurable
2019-04-30 09:34:31 +02:00
Jakub Hrozek caea8d78dd Make the environment variable prefix configurable
mellon passes on every attribute received in a SAML assertion as an
Apache variable. By default, the variable is prefixed with "MELLON_".

In some cases, for example when migrating from a different SP to mellon
it might be beneficial to change the prefix. And while using
MellonSetEnvNoPrefix is an option as well, the MellonSetEnvNoPrefix has
to be specified for each variable independently.
2019-04-12 14:38:41 +02:00
Olav Morken ef60270745
Merge pull request #201 from jcpunk/attribute-map
Add mellon-attribute-map.xsl to convert shibboleth:2.0:attribute-map
2019-04-11 09:15:20 +02:00
Pat Riehecky f03fb14214 Add mellon-attribute-map.xsl to convert urn:mace:shibboleth:2.0:attribute-map 2019-04-10 11:46:43 -05:00
Olav Morken 7d681177cb Bump version to 0.14.2 2019-03-21 14:58:35 +01:00
Olav Morken 62e0f423ac Add changelog for 0.14.2 2019-03-21 14:58:27 +01:00
Olav Morken 62041428a3 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.
2019-03-20 08:29:16 +01:00
Olav Morken 7bc436760d
Merge pull request #196 from jhrozek/am_handler_except_proxy
Modify am_handler setup to run before mod_proxy
2019-03-19 12:46:45 +01:00
John Dennis e09a28a30e 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.
2019-03-19 12:41:26 +01:00
Olav Morken 881d11cafd Bump version to 0.14.1 2019-02-11 08:26:56 +01:00
Olav Morken e9771dc9b2 Add changes for 0.14.1
This patch addes the changelog for version 0.14.1.
2019-02-11 08:26:11 +01:00
Olav Morken 599e2b4de6
Merge pull request #193 from dnmvisser/dnmvisser-readme-syntaxhighlight
Highlight syntax
2019-01-31 13:30:48 +01:00
Dick Visser 157cfd17c8
Highlight syntax
Github supports this https://github.com/github/linguist/blob/master/lib/linguist/languages.yml#L240, it makes things more readable, especially in the large configfile with a lot of comment lines.
2019-01-31 11:27:28 +01:00
Olav Morken 71cf0c9889 Fix trailing semi-colon in Set-Cookie header
A trailing semi-colon in the Set-Cookie header confuses the AWS
Elastic Load Balancer. This patch fixes the code that generates the
Set-Cookie header so that it no longer ends with a semi-colon.

Fixes issue #190
2018-11-30 08:33:43 +01:00
Olav Morken 32a3dd423c
Merge pull request #180 from orimanabu/fix_host_regexp
Exclude ':PORT' from  when endopint URL contains port number.
2018-09-04 14:20:48 +02:00
Manabu Ori 2370b4199b Exclude ':PORT' from when endopint URL contains port number. 2018-09-04 17:36:47 +09:00
Olav Morken 6358a51697 Fix incorrect header used for detecting AJAX requests
The code was looking for "X-Request-With", but the header is actually
"X-Requested-With". As far as I can tell, it has always been the
latter, at least in the jQuery source code.

Fixes issue #174.
2018-07-25 12:19:39 +02:00
Olav Morken c5d4159031
Merge pull request #172 from thijskh/master
Ship mellon_create_metadata.sh in release tarball.
2018-06-11 09:03:10 +02:00
Thijs Kinkhorst ae926cd679 Ship mellon_create_metadata.sh in release tarball. 2018-05-30 18:16:04 +00:00
Olav Morken faec7a0392
Merge pull request #167 from thrillhouse82/fix-env-refs
Fix usage of environment variables in MellonCond
2018-04-18 12:15:05 +02:00
Markus Hosch 6c191bfc0f Fix usage of environment variables in MellonCond
Using Apache environment variables in MellonCond expressions didn't
work for various reasons:
* The substitution was never executed if no backrefs were present.
* Only the OS environment was queried without checking the Apache
  internal variable stores.
* The output string after substitution was set to an empty string.

Fixing these issues makes %{ENV:...} work properly.
2018-04-17 15:01:54 +02:00
Olav Morken 83f817920d
Merge pull request #165 from TimoL/TimoL-typo-fixes
Fix some minor typos
2018-04-16 08:57:39 +02:00
Timo Lotterbach f3065d4f8d
Fix some minor typos
Trivial fixes in the text.
2018-04-13 20:28:30 +02:00
Olav Morken 29d2872f9b Bump version to 0.14.0. 2018-03-16 08:21:38 +01:00
Olav Morken 21f78ab060 Add release notes for version 0.14.0. 2018-03-16 08:21:38 +01:00