Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/forms/openid_connect_authorize_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def verified_at_requested?
end

def service_provider
return NullServiceProvider.new(issuer: nil) if client_id && client_id.include?("\x00")
@_service_provider ||= ServiceProvider.from_issuer(client_id)
end

Expand Down
9 changes: 9 additions & 0 deletions spec/forms/openid_connect_authorize_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@
end
end

context 'with a client_id containing a null byte' do
let(:client_id) { "not_a_real_client_id\x00" }
it 'has errors' do
expect(valid?).to eq(false)
expect(form.errors[:client_id]).
to include(t('openid_connect.authorization.errors.bad_client_id'))
end
end

context 'nonce' do
context 'without a nonce' do
let(:nonce) { nil }
Expand Down