aws-sdk-sns 1.124.0 → 1.124.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebc66c7b9e4b0f43e01c45db095f2a8c03f2271c165495cf31d0b51ef7349740
4
- data.tar.gz: 6913600447c8a3e53e23d21585e7163224799240c6cdba9f31dadb2e00233fce
3
+ metadata.gz: 350723b85a653546a5a98dbe7f577f11daa1e25e655386d50d8bb50da2ea5491
4
+ data.tar.gz: 5dd7a46c16b649dd60674ed6ed2e55323d5f6145d2ae04c12b58d20d724caa35
5
5
  SHA512:
6
- metadata.gz: 8a16b65324c7f6b90a9df62f0e9fdb51d60fd66e98d0976d89a855bc1b9f40e941c4d22e694b6acd0f92f1522cabf43d1e3700a0656e596fb34ef840dbe51071
7
- data.tar.gz: d4d0ce3df3c4e8751efddb5dd223693fdeaeea1a2f09126ec7d94e6152c4a54e46662e0515945ac6983fce206c8092ab30bd6e77e12628b380fb965e3339934f
6
+ metadata.gz: c6b19873cfd6576f3b461d5decb370ee6a906a39c422528fa8418ab672cec6de2e12158636fb97ce15cdaf1c5c012e67de66b2288c8bb8bc2d75353be7070039
7
+ data.tar.gz: 30b7f6360670515c3e748bf29c30f1c2de38e76bbd17bc296a2332132aed17f63220ba2032e1d528c6105af015d55fe5f2df697e511837801cd051026db23830
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.124.1 (2026-10-26)
5
+ ------------------
6
+
7
+ * Issue - Fix `MessageVerifier#authentic?` to return false, rather than raise, for messages that are not JSON objects or have malformed signing fields.
8
+
4
9
  1.124.0 (2026-10-21)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.124.0
1
+ 1.124.1
@@ -3256,7 +3256,7 @@ module Aws::SNS
3256
3256
  tracer: tracer
3257
3257
  )
3258
3258
  context[:gem_name] = 'aws-sdk-sns'
3259
- context[:gem_version] = '1.124.0'
3259
+ context[:gem_version] = '1.124.1'
3260
3260
  Seahorse::Client::Request.new(handlers, context)
3261
3261
  end
3262
3262
 
@@ -63,8 +63,9 @@ module Aws
63
63
  # @raise [VerificationError] Raised when the given message has failed
64
64
  # verification.
65
65
  def authenticate!(message_body)
66
- msg = Json.load(message_body)
66
+ msg = parse(message_body)
67
67
  msg = convert_lambda_msg(msg) if is_from_lambda(msg)
68
+ verify_signing_fields!(msg)
68
69
 
69
70
  case msg['SignatureVersion']
70
71
  when '1'
@@ -79,6 +80,21 @@ module Aws
79
80
 
80
81
  private
81
82
 
83
+ def parse(message_body)
84
+ msg = Json.load(message_body)
85
+ raise VerificationError, 'the message must be a JSON object' unless msg.is_a?(Hash)
86
+
87
+ msg
88
+ rescue Json::ParseError
89
+ raise VerificationError, 'the message is not valid JSON'
90
+ end
91
+
92
+ def verify_signing_fields!(msg)
93
+ unless msg['Signature'].is_a?(String) && msg['SigningCertURL'].is_a?(String)
94
+ raise VerificationError, 'the Signature and SigningCertURL must be strings'
95
+ end
96
+ end
97
+
82
98
  def is_from_lambda(message)
83
99
  message.key? 'SigningCertUrl'
84
100
  end
@@ -125,7 +141,11 @@ module Aws
125
141
  end
126
142
 
127
143
  def public_key(message)
128
- x509_url = URI.parse(message['SigningCertURL'])
144
+ x509_url = begin
145
+ URI.parse(message['SigningCertURL'])
146
+ rescue URI::InvalidURIError
147
+ raise VerificationError, 'the SigningCertURL is not a valid URI'
148
+ end
129
149
  x509 = OpenSSL::X509::Certificate.new(pem(x509_url))
130
150
  OpenSSL::PKey::RSA.new(x509.public_key)
131
151
  end
data/lib/aws-sdk-sns.rb CHANGED
@@ -58,7 +58,7 @@ module Aws::SNS
58
58
  autoload :Subscription, 'aws-sdk-sns/subscription'
59
59
  autoload :Topic, 'aws-sdk-sns/topic'
60
60
 
61
- GEM_VERSION = '1.124.0'
61
+ GEM_VERSION = '1.124.1'
62
62
 
63
63
  end
64
64
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-sns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.124.0
4
+ version: 1.124.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services