Skip to content

MSC4029: [WIP] Fixing X-Matrix request authentication#4029

Draft
turt2live wants to merge 5 commits intomainfrom
travis/msc/fix-x-matrix-auth
Draft

MSC4029: [WIP] Fixing X-Matrix request authentication#4029
turt2live wants to merge 5 commits intomainfrom
travis/msc/fix-x-matrix-auth

Conversation

@turt2live turt2live added proposal A matrix spec change proposal s2s Server-to-Server API (federation) security kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Jun 14, 2023
@@ -0,0 +1,137 @@
# MSC4029: Fixing `X-Matrix` request authentication
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,137 @@
# MSC4029: Fixing `X-Matrix` request authentication
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not something that will be encountered with any sensible server, but it is possible to have multiple Authorization headers with the same scheme if different realms are used:

Note that a response can have multiple challenges with the same auth-scheme but with different realms.

So perhaps there could be a note stating that servers should only use the first X-Matrix header they encounter?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, I see this was mentioned.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm no, the RFC says this is the case for a response, so how exactly would multiple X-Matrix keys be available in a request while still following the RFC?

endpoint to fetch that server's keys.

Servers SHOULD NOT [query keys through another server](https://spec.matrix.org/v1.9/server-server-api/#querying-keys-through-another-server)
when validating a request signature. Instead, the server's local cache and direct requests to the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By server's local cache, I assume this would mean cache of the keys obtained directly from the server which the request is from, and not cached keys obtained via POST /_matrix/key/v2/query and/or GET /_matrix/key/v2/query/{serverName} of another server, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However that cache was built, realistically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this was made explicit, since interpretations of the text here can vary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal s2s Server-to-Server API (federation) security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants