|
| 1 | +# MSC0000: Reporting User Profiles over Federation |
| 2 | + |
| 3 | +*This proposal extends [MSC3843](https://github.com/matrix-org/matrix-spec-proposals/pull/3843) to |
| 4 | +allow reporting user profiles over federation. Clients can offer a user interface feature, such as |
| 5 | +a button at the bottom of a user's profile, enabling users to report another user's profile to the |
| 6 | +administrators of the server from which the profile was accessed.* |
| 7 | + |
| 8 | +## Proposal |
| 9 | + |
| 10 | +Building upon the reporting mechanism proposed in |
| 11 | +[MSC3843](https://github.com/matrix-org/matrix-spec-proposals/pull/3843) and the user profile |
| 12 | +information introduced in [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133), |
| 13 | +this MSC proposes modifying the reporting endpoint to allow the use of a Matrix User ID (MXID) in |
| 14 | +place of an event ID. This enables users to report user profiles directly to the homeserver of the |
| 15 | +reported user. |
| 16 | + |
| 17 | +### Extended Federation Endpoint |
| 18 | + |
| 19 | +The existing federation endpoint for reporting events is: |
| 20 | + |
| 21 | +``` |
| 22 | +POST /_matrix/federation/v1/rooms/{roomId}/report/{eventId} |
| 23 | +``` |
| 24 | + |
| 25 | +This MSC proposes extending this endpoint to allow reporting user profiles by accepting a user ID |
| 26 | +in the `eventId` position, identified by the `@` prefix: |
| 27 | + |
| 28 | +``` |
| 29 | +POST /_matrix/federation/v1/rooms/{roomId}/report/{userId} |
| 30 | +``` |
| 31 | + |
| 32 | +Where `userId` is a Matrix User ID in the format `@user:domain`. |
| 33 | + |
| 34 | +#### Example Request |
| 35 | + |
| 36 | +Reporting a user's profile: |
| 37 | + |
| 38 | +``` |
| 39 | +POST /_matrix/federation/v1/rooms/!roomid:example.org/report/@baduser:badserver.com |
| 40 | +{ |
| 41 | + "reason": "Inappropriate profile content: mxc://example.org/abcd1234" |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +### Request Body Parameters |
| 46 | + |
| 47 | +The request body includes the following parameters: |
| 48 | + |
| 49 | +- `reason` (string, **required**): A description explaining why the profile is being reported. |
| 50 | + This cannot be blank. It is *strongly* recommended that clients include the MXC URI of a |
| 51 | + screenshot of the problematic profile content, clearly showing as much of the profile as possible |
| 52 | + (especially the MXID) to ensure the user's identity is unmistakable. Homeservers are free to log |
| 53 | + profile changes as they see fit, however this snapshot may assist investigating the report. |
| 54 | + |
| 55 | +### Behaviour |
| 56 | + |
| 57 | +When a homeserver receives a profile report, it SHOULD handle it similarly to how it handles event |
| 58 | +reports: |
| 59 | + |
| 60 | +- If the reported `userId` belongs to the receiving homeserver, it SHOULD process the report and |
| 61 | + take appropriate action as per its moderation policies. |
| 62 | +- If the reported `userId` does not belong to the receiving homeserver, it MAY choose to ignore |
| 63 | + the report and respond with an `M_UNACTIONABLE` error code and an HTTP `400` status. |
| 64 | + |
| 65 | +### Error Responses |
| 66 | + |
| 67 | +- `400 M_UNACTIONABLE`: The server cannot act on the reported content. This may be because the |
| 68 | + reported user is not hosted on the server, or the server does not support profile reporting. |
| 69 | + |
| 70 | +#### Example Error Response |
| 71 | + |
| 72 | +```json |
| 73 | +{ |
| 74 | + "errcode": "M_UNACTIONABLE", |
| 75 | + "error": "Cannot act on the reported user." |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +### Rate Limiting |
| 80 | + |
| 81 | +Homeservers are strongly encouraged to rate limit incoming profile reports to prevent abuse. |
| 82 | +An example limit might be 10 reports per minute from a single server. |
| 83 | + |
| 84 | +## Client Behaviour |
| 85 | + |
| 86 | +Clients SHOULD offer a user interface element in user profiles (e.g., a "Report User" button) that |
| 87 | +allows users to report problematic profiles. When reporting a profile: |
| 88 | + |
| 89 | +- Clients SHOULD use the extended federation endpoint to send the report to the reported user's |
| 90 | + homeserver. |
| 91 | +- Clients SHOULD include a `reason` for the report, provided by the user. |
| 92 | +- Clients SHOULD include an MXC URI of the offending profile to aid in the investigation. |
| 93 | + |
| 94 | +## Security Considerations |
| 95 | + |
| 96 | +- **Anonymity**: The original reporter's identity is not included in the report sent over |
| 97 | + federation. However, since the report is sent from the reporter's homeserver, it may still be |
| 98 | + possible to infer their identity, especially if the homeserver has a small user base. |
| 99 | + |
| 100 | +- **Abuse**: This mechanism could be abused to send spam reports. Homeservers SHOULD implement rate |
| 101 | + limiting and MAY require additional verification steps before acting on reports. |
| 102 | + |
| 103 | +- **Privacy**: Including screenshots may expose personal data. Clients SHOULD inform users that |
| 104 | + any attached images will be sent to the remote server and ensure users consent to this. |
| 105 | + |
| 106 | +- **Validity**: Homeservers SHOULD verify that the `userId` is a valid Matrix User ID and handle |
| 107 | + reports appropriately. They SHOULD also ensure that they do not process reports for users not |
| 108 | + hosted on their server unless they choose to do so. |
| 109 | + |
| 110 | +## Potential Issues |
| 111 | + |
| 112 | +- **Spam Reports**: Servers may receive a high volume of unnecessary or malicious reports. Rate |
| 113 | + limiting and appropriate error responses can help mitigate this issue. |
| 114 | +- **Cross-Domain Trust**: Servers need to decide how much trust to place in reports received from |
| 115 | + other homeservers. Policies may vary between servers. |
| 116 | + |
| 117 | +## Alternatives |
| 118 | + |
| 119 | +- **New Endpoint**: Define a new federation endpoint specifically for reporting user profiles. |
| 120 | + However, reusing the existing endpoint simplifies implementation and leverages existing mechanisms. |
| 121 | +- **Policy Rooms**: As mentioned in MSC3843, servers could negotiate shared policy rooms to handle |
| 122 | + reports. This adds complexity and is beyond the scope of this MSC. |
| 123 | + |
| 124 | +## Unstable Prefix |
| 125 | + |
| 126 | +While this MSC is not yet stable, implementations SHOULD use the following endpoint: |
| 127 | + |
| 128 | +``` |
| 129 | +POST /_matrix/federation/unstable/uk.tcpipuk.msc0000/rooms/{roomId}/report/{userId} |
| 130 | +``` |
| 131 | + |
| 132 | +## Dependencies |
| 133 | + |
| 134 | +- [MSC3843](https://github.com/matrix-org/matrix-spec-proposals/pull/3843): Reporting content over |
| 135 | + federation |
0 commit comments