Skip to content

Commit 87119f4

Browse files
committed
release 2.4.12.2: CVE-2022-23527 prevent open redirect in default setup
i.e. when OIDCRedirectURLsAllowed is not configured, see: GHSA-q6f2-285m-gr53 Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 1fc47e8 commit 87119f4

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
12/13/2022
2+
- CVE-2022-23527: prevent open redirect in default setup when OIDCRedirectURLsAllowed is not configured
3+
see: https://github.com/zmartzone/mod_auth_openidc/security/advisories/GHSA-q6f2-285m-gr53
4+
- release 2.4.12.2
5+
16
12/08/2022
27
- simplify redis context code
38
- bump to 2.4.12.2rc1

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([mod_auth_openidc],[2.4.12.2rc1],[[email protected]])
1+
AC_INIT([mod_auth_openidc],[2.4.12.2],[[email protected]])
22

33
AC_SUBST(NAMEVER, AC_PACKAGE_TARNAME()-AC_PACKAGE_VERSION())
44

src/mod_auth_openidc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,15 +2537,15 @@ apr_byte_t oidc_validate_redirect_url(request_rec *r, oidc_cfg *c,
25372537
oidc_error(r, "%s: %s", *err_str, *err_desc);
25382538
return FALSE;
25392539
}
2540-
2541-
if ((strstr(url, "/%09") != NULL) || (strstr(url, "/%2f") != NULL)
2542-
|| (strstr(url, "/%68") != NULL) || (strstr(url, "/http:") != NULL)
2543-
|| (strstr(url, "/https:") != NULL) || (strstr(url, "/javascript:") != NULL)
2540+
if ( (strstr(url, "/%09") != NULL) || (oidc_util_strcasestr(url, "/%2f") != NULL)
2541+
|| (strstr(url, "/\t") != NULL)
2542+
|| (strstr(url, "/%68") != NULL) || (oidc_util_strcasestr(url, "/http:") != NULL)
2543+
|| (oidc_util_strcasestr(url, "/https:") != NULL) || (oidc_util_strcasestr(url, "/javascript:") != NULL)
25442544
|| (strstr(url, "/〱") != NULL) || (strstr(url, "/〵") != NULL)
25452545
|| (strstr(url, "/ゝ") != NULL) || (strstr(url, "/ー") != NULL)
25462546
|| (strstr(url, "/〱") != NULL) || (strstr(url, "/ー") != NULL)
2547-
|| (strstr(url, "/<") != NULL) || (strstr(url, "%01javascript:") != NULL)
2548-
|| (strstr(url, "/%5c") != NULL)) {
2547+
|| (strstr(url, "/<") != NULL) || (oidc_util_strcasestr(url, "%01javascript:") != NULL)
2548+
|| (strstr(url, "/%5c") != NULL) || (strstr(url, "/\\") != NULL)) {
25492549
*err_str = apr_pstrdup(r->pool, "Invalid URL");
25502550
*err_desc = apr_psprintf(r->pool, "URL value \"%s\" contains illegal character(s)", url);
25512551
oidc_error(r, "%s: %s", *err_str, *err_desc);

src/mod_auth_openidc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ char *oidc_util_http_query_encoded_url(request_rec *r, const char *url, const ap
853853
char *oidc_util_get_full_path(apr_pool_t *pool, const char *abs_or_rel_filename);
854854
apr_byte_t oidc_enabled(request_rec *r);
855855
char *oidc_util_http_form_encoded_data(request_rec *r, const apr_table_t *params);
856+
char* oidc_util_strcasestr(const char *s1, const char *s2);
856857
857858
/* HTTP header constants */
858859
#define OIDC_HTTP_HDR_COOKIE "Cookie"

src/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ char* oidc_util_javascript_escape(apr_pool_t *pool, const char *s) {
434434
return output;
435435
}
436436

437-
static char* oidc_util_strcasestr(const char *s1, const char *s2) {
437+
char* oidc_util_strcasestr(const char *s1, const char *s2) {
438438
const char *s = s1;
439439
const char *p = s2;
440440
do {

test/open-redirect-payload-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/%09/example.com
2+
/ /example.com
23
/%2f%2fexample.com
34
/%2f%2f%2fbing.com%2f%3fwww.omise.co
45
/%2f%5c%2f%67%6f%6f%67%6c%65%2e%63%6f%6d/

0 commit comments

Comments
 (0)