Skip to content

Commit

Permalink
Merge pull request from GHSA-49r3-2549-3633
Browse files Browse the repository at this point in the history
Use only verified email address to prevent fake email address
  • Loading branch information
nhosoya authored Dec 3, 2020
2 parents 45cf13d + 71c5db4 commit 98542c0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## [Unreleased]

## [1.0.1] - 2020-12-xx

### Security

- Use only verified email address to prevent fake email address

## [1.0.0] - 2020-06-26

### Added
Expand Down Expand Up @@ -33,3 +39,4 @@

[Unreleased]: https://github.com/nhosoya/omniauth-apple/compare/v1.0.0...master
[1.0.0]: https://github.com/nhosoya/omniauth-apple/compare/v0.0.3...v1.0.0
[1.0.1]: https://github.com/nhosoya/omniauth-apple/compare/v1.0.0...v1.0.1
2 changes: 1 addition & 1 deletion lib/omniauth/apple/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module OmniAuth
module Apple
VERSION = "1.0.0"
VERSION = "1.0.1"
end
end
2 changes: 1 addition & 1 deletion lib/omniauth/strategies/apple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def user_info
end

def email
user_info['email'] || id_info['email']
id_info['email']
end

def first_name
Expand Down
15 changes: 15 additions & 0 deletions spec/omniauth/strategies/apple_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,21 @@
end
end

context 'with a spoofed email in the user payload' do
before do
request.params['user'] = {
name: {
firstName: 'first',
lastName: 'last'
},
email: "[email protected]"
}.to_json
end

it 'should return the true email' do
expect(subject.info[:email]).to eq('[email protected]')
end
end
end

describe '#extra' do
Expand Down

0 comments on commit 98542c0

Please sign in to comment.