Skip to content

Commit 6bed627

Browse files
authored
Merge pull request from GHSA-5g4r-2qhx-vqfm
Verify exact length of auth_data_len
2 parents 7057f36 + e3e866e commit 6bed627

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

contrib/ruby/Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
trilogy (2.1.0)
4+
trilogy (2.1.1)
55

66
GEM
77
remote: https://rubygems.org/

contrib/ruby/lib/trilogy/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class Trilogy
2-
VERSION = "2.1.0"
2+
VERSION = "2.1.1"
33
end

src/protocol.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ int trilogy_parse_handshake_packet(const uint8_t *buff, size_t len, trilogy_hand
275275
if (out_packet->capabilities & TRILOGY_CAPABILITIES_SECURE_CONNECTION && auth_data_len > 8) {
276276
uint8_t remaining_auth_data_len = auth_data_len - 8;
277277

278-
if (remaining_auth_data_len > 13) {
279-
remaining_auth_data_len = 13;
278+
// The auth plugins we support all provide exactly 21 bytes of
279+
// auth_data. Reject any other values for auth_data_len.
280+
if (SCRAMBLE_LEN + 1 != auth_data_len) {
281+
return TRILOGY_PROTOCOL_VIOLATION;
280282
}
281283

282284
CHECKED(trilogy_reader_copy_buffer(&reader, remaining_auth_data_len, out_packet->scramble + 8));

0 commit comments

Comments
 (0)