Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_matrix_gw_s2s: Failed authentication request on non the first vhost #4313

Open
catap opened this issue Nov 16, 2024 · 0 comments
Open

mod_matrix_gw_s2s: Failed authentication request on non the first vhost #4313

catap opened this issue Nov 16, 2024 · 0 comments
Assignees

Comments

@catap
Copy link

catap commented Nov 16, 2024

Environment

  • ejabberd version: 24.10
  • Erlang version: Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 14.2.5.3
  • OS: OpenBSD 7.6
  • Installed from: source

Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml

hosts:
  - kcry.pt
  - korins.ky
...
listen:
...
  -
    port: 8448
    ip: "0.0.0.0"
    module: ejabberd_http
    tls: true
    request_handlers:
      "/_matrix": mod_matrix_gw
  -
    port: 8448
    ip: "::"
    module: ejabberd_http
    tls: true
    request_handlers:
      "/_matrix": mod_matrix_gw
s2s_use_starttls: optional
s2s_access: s2s # to allow Matrix federation
...
access_rules:
  local:
    allow: local
  c2s:
    deny: blocked
    allow: all
  s2s:
    - allow # to allow Matrix federation
...
modules:
...
  mod_matrix_gw:
    key_name: "REDACTED"
    key: "REDACTED"
...

Errors from error.log/crash.log

2024-11-16 18:25:30.169607+01:00 [warning] <0.1051.0>@mod_matrix_gw_s2s:check_auth/5:162 Failed authentication: #{<<"destination">> => <<"kcry.pt">>,
                         <<"method">> => <<"GET">>,
                         <<"origin">> => <<"matrix.org">>,
                         <<"signatures">> =>
                             #{<<"matrix.org">> =>
                                   #{<<"ed25519:a_RXGa">> =>
                                         <<"7oCcYGQHfeMv9mr9MmyCyVUnkozbUGbwrs/zPVsoqWA2ZadlLzQ4It5ZCBYQ/b1LdCHBcXLsGZRNKGYlbEosDQ">>}},
                         <<"uri">> =>
                             <<"/_matrix/federation/v1/query/profile?user_id=%40test%3Akorins.ky&field=displayname">>}

Bug description

When I try to start a new conversation with some suer on my server via https://app.cinny.in/ it says that such user doesn't exist and logs contains "failed authentication". It always pass for the first virtual host, but always fails on the least.

So, as soon as I reorder host list, I was able to discover an account via cinny.

@alexeyshch alexeyshch self-assigned this Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants