Skip to content

Commit 02b6211

Browse files
committed
Do not send back URI arguments to prevent XSS
1 parent 6cd01e5 commit 02b6211

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/resty/openidc.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ local function openidc_authorization_response(opts, session)
10571057

10581058
-- check that the state returned in the response against the session; prevents CSRF
10591059
if args.state ~= session.data.state then
1060-
err = "state from argument: " .. (args.state and args.state or "nil") .. " does not match state restored from session: " .. (session.data.state and session.data.state or "nil")
1060+
err = "state from argument does not match state restored from session"
10611061
log(ERROR, err)
10621062
return nil, err, session.data.original_url, session
10631063
end
@@ -1069,14 +1069,14 @@ local function openidc_authorization_response(opts, session)
10691069

10701070
-- check the iss if returned from the OP
10711071
if args.iss and args.iss ~= opts.discovery.issuer then
1072-
err = "iss from argument: " .. args.iss .. " does not match expected issuer: " .. opts.discovery.issuer
1072+
err = "iss from argument does not match expected issuer"
10731073
log(ERROR, err)
10741074
return nil, err, session.data.original_url, session
10751075
end
10761076

10771077
-- check the client_id if returned from the OP
10781078
if args.client_id and args.client_id ~= opts.client_id then
1079-
err = "client_id from argument: " .. args.client_id .. " does not match expected client_id: " .. opts.client_id
1079+
err = "client_id from argument does not match expected client_id"
10801080
log(ERROR, err)
10811081
return nil, err, session.data.original_url, session
10821082
end

0 commit comments

Comments
 (0)