-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Acceptable characters for MXC opaque identifiers should be more clearly described #503
Comments
This is mentioned under #174, and an attempt to answer it is in the as-yet-unimplemented MSC1597: https://github.com/matrix-org/matrix-doc/blob/rav/proposals/id_grammar/proposals/1597-id-grammar.md#opaque-ids. |
Whoops, my bad - I didn't realize that that included MXC identifiers as well. I guess this one can be closed, then? |
It's probably useful to keep it open as a specific place to discuss media ids |
matrix-org/matrix-spec-proposals#1597 (a.k.a. matrix-org/matrix-spec-proposals#1598) was merged as an MSC, so really this is just a spec-pr-missing |
as noted over on matrix-org/matrix-spec-proposals#1598, the merge of that MSC dates to a time where MSCs could be merged before implementation, so although matrix-org/matrix-spec-proposals#1597 presents a proposal which seems to have some support, it's never been adopted by the ecosystem. |
some notes on this while I'm in the area:
|
for additional context:
|
@neilalexander reports that Dendrite's media ids are
Which I assume means that they consist of the characters It'd be interesting to confirm what other media repo impls (eg Conduit) use for their media IDs, but I'd be a bit surprised if they fell outside the range proposed by MSC1597, which, for the record, is:
I wonder what we can do to progress this, or what's actually blocking us fixing it.
|
AIUI, enforcement might imply that homeservers reject requests to download media with a non-compliant id. That would make the particular media unreachable through normal means but at least clients would be exempted from checking for stray Ideally, of course, the grammar should be enforced when uploading media; but I have no good ideas here except client applications nagging users to bug homeserver owners if what the client app received for a media id is not compliant. |
per matrix-org/matrix-spec-proposals#1597 (comment), I think allowing |
oh, and ftr mmr's IPFS media ID is |
It appears Ruma discovered the text in the spec well before we did: https://spec.matrix.org/v1.9/client-server-api/#security-considerations-5
Therefore, this is a clarification issue imo. In practice, Synapse clearly does not apply this sanitization, but aside from edge cases where folks are using Extending the character set requires an MSC. |
For the record, original PR and jira issue here: also: element-hq/synapse#1323 |
From the spec:
However, it is not specified anywhere (as far as I can tell) what the valid character range is for these opaque
media-id
s. In particular, it doesn't specify whether themedia-id
may contain slashes - a detail that's quite semantically important for a lot of HTTP request routing implementations, which often treat a "URL parameter" as a string of any characters other than a slash, eg. as in/media/:id
where/media/foo/bar
would not match.The text was updated successfully, but these errors were encountered: