Skip to content

Commit 90beee7

Browse files
Merge pull request #11995 from rabbitmq/mergify/bp/v3.13.x/pr-11993
Restrict username and password in AMQPLAIN (backport #11986) (backport #11993)
2 parents 79f6507 + 69e1d93 commit 90beee7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deps/rabbit/src/rabbit_auth_mechanism_amqplain.erl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ should_offer(_Sock) ->
3232
init(_Sock) ->
3333
[].
3434

35-
-define(IS_STRING_TYPE(Type), Type =:= longstr orelse Type =:= shortstr).
35+
-define(IS_STRING_TYPE(Type),
36+
Type =:= longstr orelse
37+
Type =:= shortstr orelse
38+
Type =:= binary).
3639

3740
handle_response(Response, _State) ->
3841
LoginTable = rabbit_binary_parser:parse_table(Response),
3942
case {lists:keysearch(<<"LOGIN">>, 1, LoginTable),
4043
lists:keysearch(<<"PASSWORD">>, 1, LoginTable)} of
4144
{{value, {_, UserType, User}},
42-
{value, {_, PassType, Pass}}} when ?IS_STRING_TYPE(UserType);
45+
{value, {_, PassType, Pass}}} when ?IS_STRING_TYPE(UserType) andalso
4346
?IS_STRING_TYPE(PassType) ->
4447
rabbit_access_control:check_user_pass_login(User, Pass);
4548
{{value, {_, _UserType, _User}},

0 commit comments

Comments
 (0)