Skip to content

Commit b59b8ad

Browse files
committed
release 2.4.16.11: fix OIDCProviderAuthRequestMethod POST
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent f0966d4 commit b59b8ad

File tree

7 files changed

+29
-10
lines changed

7 files changed

+29
-10
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
04/02/2025
2+
- fix protected content leakage when using OIDCProviderAuthRequestMethod POST, see:
3+
https://github.com/OpenIDC/mod_auth_openidc/security/advisories/GHSA-59jp-rwph-878r
4+
- allow for regular Apache processing (e.g. setting response headers) when using OIDCProviderAuthRequestMethod POST
5+
- release 2.4.16.11
6+
17
03/21/2025
28
- core: complete case-insensitive protocol/hostname/domain-name comparisons
39
- release 2.4.16.10

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.16.10],[[email protected]])
1+
AC_INIT([mod_auth_openidc],[2.4.16.11],[[email protected]])
22

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

src/handle/content.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,18 @@ int oidc_content_handler(request_rec *r) {
118118
/* discovery may result in a 200 HTML page or a redirect to an external URL */
119119
rc = oidc_discovery_request(r, c);
120120

121-
} else if (oidc_request_state_get(r, OIDC_REQUEST_STATE_KEY_AUTHN) != NULL) {
121+
} else if (oidc_request_state_get(r, OIDC_REQUEST_STATE_KEY_AUTHN_POST) != NULL) {
122122

123+
/* sending POST authentication request */
124+
OIDC_METRICS_COUNTER_INC(r, c, OM_CONTENT_REQUEST_AUTHN_POST);
125+
126+
rc = OK;
127+
128+
} else if (oidc_request_state_get(r, OIDC_REQUEST_STATE_KEY_AUTHN_PRESERVE) != NULL) {
129+
130+
/* sending POST preserve request */
123131
OIDC_METRICS_COUNTER_INC(r, c, OM_CONTENT_REQUEST_POST_PRESERVE);
124132

125-
/* sending POST preserve */
126133
rc = OK;
127134

128135
} /* else: an authenticated request for which content is produced downstream */

src/metrics.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ const oidc_metrics_counter_info_t _oidc_metrics_counters_info[] = {
159159
{ OM_CLASS_CONTENT, "request.jwks", "JWKs requests to the content handler" },
160160
{ OM_CLASS_CONTENT, "request.discovery", "discovery requests to the content handler" },
161161
{ OM_CLASS_CONTENT, "request.post-preserve", "HTTP POST preservation requests to the content handler" },
162+
{ OM_CLASS_CONTENT, "request.authn-post", "HTTP POST authentication requests to the content handler" },
162163
{ OM_CLASS_CONTENT, "request.unknown", "unknown requests to the content handler" },
163164

164165
// KEEP THIS: end-of-counters

src/metrics.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ typedef enum {
185185
OM_CONTENT_REQUEST_JWKS,
186186
OM_CONTENT_REQUEST_DISCOVERY,
187187
OM_CONTENT_REQUEST_POST_PRESERVE,
188+
OM_CONTENT_REQUEST_AUTHN_POST,
188189
OM_CONTENT_REQUEST_UNKNOWN,
189190

190191
} oidc_metrics_counter_type_t;

src/mod_auth_openidc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
#define OIDC_REQUEST_STATE_KEY_IDTOKEN "i"
5757
#define OIDC_REQUEST_STATE_KEY_CLAIMS "c"
5858
#define OIDC_REQUEST_STATE_KEY_DISCOVERY "d"
59-
#define OIDC_REQUEST_STATE_KEY_AUTHN "a"
59+
#define OIDC_REQUEST_STATE_KEY_AUTHN_POST "a"
60+
#define OIDC_REQUEST_STATE_KEY_AUTHN_PRESERVE "p"
6061
#define OIDC_REQUEST_STATE_KEY_SAVE "s"
6162
#define OIDC_REQUEST_STATE_TRACE_ID "t"
6263

src/proto/request.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static int oidc_proto_request_form_post_param_add(void *rec, const char *key, co
157157
/*
158158
* make the browser POST parameters through Javascript auto-submit
159159
*/
160-
static int oidc_proto_request_html_post(request_rec *r, const char *url, apr_table_t *params) {
160+
static void oidc_proto_request_html_post(request_rec *r, const char *url, apr_table_t *params) {
161161

162162
oidc_debug(r, "enter");
163163

@@ -174,7 +174,7 @@ static int oidc_proto_request_html_post(request_rec *r, const char *url, apr_tab
174174
" </p>\n"
175175
" </form>\n");
176176

177-
return oidc_util_html_send(r, "Submitting...", NULL, "document.forms[0].submit", html_body, OK);
177+
oidc_util_html_send(r, "Submitting...", NULL, "document.forms[0].submit", html_body, OK);
178178
}
179179

180180
#define OIDC_REQUEST_OJBECT_COPY_FROM_REQUEST "copy_from_request"
@@ -688,8 +688,12 @@ int oidc_proto_request_auth(request_rec *r, struct oidc_provider_t *provider, co
688688
if (oidc_proto_profile_auth_request_method_get(provider) == OIDC_AUTH_REQUEST_METHOD_POST) {
689689

690690
/* construct a HTML POST auto-submit page with the authorization request parameters */
691-
rv =
692-
oidc_proto_request_html_post(r, oidc_cfg_provider_authorization_endpoint_url_get(provider), params);
691+
oidc_proto_request_html_post(r, oidc_cfg_provider_authorization_endpoint_url_get(provider), params);
692+
693+
/* signal this to the content handler */
694+
oidc_request_state_set(r, OIDC_REQUEST_STATE_KEY_AUTHN_POST, "");
695+
r->user = "";
696+
rv = OK;
693697

694698
} else if (oidc_proto_profile_auth_request_method_get(provider) == OIDC_AUTH_REQUEST_METHOD_PAR) {
695699

@@ -701,7 +705,6 @@ int oidc_proto_request_auth(request_rec *r, struct oidc_provider_t *provider, co
701705
authorization_request =
702706
oidc_http_query_encoded_url(r, oidc_cfg_provider_authorization_endpoint_url_get(provider), params);
703707

704-
// TODO: should also enable this when using the POST binding for the auth request
705708
/* see if we need to preserve POST parameters through Javascript/HTML5 storage */
706709
if (oidc_response_post_preserve_javascript(r, authorization_request, NULL, NULL) == FALSE) {
707710

@@ -714,7 +717,7 @@ int oidc_proto_request_auth(request_rec *r, struct oidc_provider_t *provider, co
714717
} else {
715718

716719
/* signal this to the content handler */
717-
oidc_request_state_set(r, OIDC_REQUEST_STATE_KEY_AUTHN, "");
720+
oidc_request_state_set(r, OIDC_REQUEST_STATE_KEY_AUTHN_PRESERVE, "");
718721
r->user = "";
719722
rv = OK;
720723
}

0 commit comments

Comments
 (0)