sdk-reforge 1.11.1 → 1.11.2

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: 035df48e2bfb88f49415f5bac3cc8472c1941d7aa75b2d5adeaaa9b181249566
4
- data.tar.gz: 40bcb2f2d07df80308082a732852a1f3c3aca0a6e978d0fe80c022a7cd030c79
3
+ metadata.gz: de9767c4803726a6881d27e59b026d4a1e23d5592effae2f72908f44aed56e23
4
+ data.tar.gz: 16ab3c79d14b20136bb15cafd76b641f3dcced86c160a16681cf7666a564ec41
5
5
  SHA512:
6
- metadata.gz: bcea0460ea869dfc1f82563c531425d63191a929dab7558d47093802a03d7d07e752c7750b308848c64e9facc1e8e6afcbff53748585604bbc5e77f72432ae14
7
- data.tar.gz: 381cae539cebf7e540af04be3d332c20af0256d27b42cabbab7698297f4a96e1d56dc3f3aae99aba50636b80ba323f2d2327cdcf7ab87cce27a30f6394f09925
6
+ metadata.gz: c5e8a05f5f01014d9605c68648de26784d9190fdb3ab61d2c3ea55687a35feea851c5f50fbe86a3d21dfd8a0795df4644a656db04098988f8f3e7e030b117ae8
7
+ data.tar.gz: fe44f02ea0fffa0982732a4c581b50440ce174e2cd3798208820ca96b4ee2cfebe90e866d8566588c2d795b39bd505234bbd56340a2155869f740cdc60b8b15f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.11.2 - 2025-10-07
4
+
5
+ - Address OpenSSL issue with vulnerability to truncation attack
6
+
3
7
  ## 1.11.1 - 2025-10-06
4
8
 
5
9
  - quiet logging for SSE reconnections
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.11.1
1
+ 1.11.2
@@ -4,6 +4,7 @@ module Reforge
4
4
  class Encryption
5
5
  CIPHER_TYPE = "aes-256-gcm" # 32/12
6
6
  SEPARATOR = "--"
7
+ AUTH_TAG_LENGTH = 16
7
8
 
8
9
  # Hexadecimal format ensures that generated keys are representable with
9
10
  # plain text
@@ -32,22 +33,30 @@ module Reforge
32
33
  encrypted = cipher.update(clear_text)
33
34
  encrypted << cipher.final
34
35
  tag = cipher.auth_tag
35
-
36
+
36
37
  # pack and join
37
38
  [encrypted, iv, tag].map { |p| p.unpack("H*")[0] }.join(SEPARATOR)
38
39
  end
39
40
 
40
41
  def decrypt(encrypted_string)
41
- unpacked_parts = encrypted_string.split(SEPARATOR).map { |p| [p].pack("H*") }
42
+ encrypted_data, iv, auth_tag = encrypted_string.split(SEPARATOR).map { |p| [p].pack("H*") }
43
+
44
+ # Currently the OpenSSL bindings do not raise an error if auth_tag is
45
+ # truncated, which would allow an attacker to easily forge it. See
46
+ # https://github.com/ruby/openssl/issues/63
47
+ if auth_tag.bytesize != AUTH_TAG_LENGTH
48
+ raise "truncated auth_tag"
49
+ end
42
50
 
43
51
  cipher = OpenSSL::Cipher.new(CIPHER_TYPE)
44
52
  cipher.decrypt
45
53
  cipher.key = @key
46
- cipher.iv = unpacked_parts[1]
47
- cipher.auth_tag = unpacked_parts[2]
48
-
54
+ cipher.iv = iv
55
+
56
+ cipher.auth_tag = auth_tag
57
+
49
58
  # and decrypt it
50
- decrypted = cipher.update(unpacked_parts[0])
59
+ decrypted = cipher.update(encrypted_data)
51
60
  decrypted << cipher.final
52
61
  decrypted
53
62
  end
data/sdk-reforge.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: sdk-reforge 1.11.1 ruby lib
5
+ # stub: sdk-reforge 1.11.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "sdk-reforge".freeze
9
- s.version = "1.11.1"
9
+ s.version = "1.11.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2025-10-06"
14
+ s.date = "2025-10-07"
15
15
  s.description = "Feature Flags, Live Config as a service".freeze
16
16
  s.email = "jeff.dwyer@reforge.com.cloud".freeze
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdk-reforge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-06 00:00:00.000000000 Z
10
+ date: 2025-10-07 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: concurrent-ruby