Compare commits

...
10 changed files with 50 additions and 31 deletions

No files matched your search

+1 -1
View File
@@ -71,7 +71,7 @@ runs:
- name: Install timelord-cli and git-warp-time
if: steps.check-binaries.outputs.need-install == 'true'
uses: https://github.com/taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 # v2
uses: https://github.com/taiki-e/install-action@ab49d3c64680143e184118bed66a46419fc15519 # v2
with:
tool: git-warp-time,timelord-cli@3.0.1
+8 -3
View File
@@ -23,12 +23,15 @@ to encourage users to stay up-to-date with the latest release, and we have no co
We appreciate the efforts of security researchers and the community in identifying and reporting vulnerabilities. To
ensure that potential vulnerabilities are addressed properly, please follow these guidelines:
1. **Contact members of the team directly** over E2EE private message.
1. **Contact _all_ members of the team** over E2EE private message on Matrix.
Add each contact to the same encrypted room. **Do not message maintainers individually**.
If you cannot reach us from matrix.org, please try [another server][sl] (e.g. continuwuity.rocks).
- [@jade:ellis.link](https://matrix.to/#/@jade:ellis.link)
- [@nex:nexy7574.co.uk](https://matrix.to/#/@nex:nexy7574.co.uk)
- [@ginger:gingershaped.computer](https://matrix.to/#/@ginger:gingershaped.computer)
2. **Email the security team** at [security@continuwuity.org](mailto:security@continuwuity.org). This is not E2EE, so
don't include sensitive details.
don't include sensitive details. Do not ask where to send sensitive details either; that
information is included in this security policy. We may not respond to emails that do this.
3. **Do not disclose the vulnerability publicly** until a fix has been pushed to the main branch.
4. **Provide detailed information** about the vulnerability, including:
- A clear description of the issue
@@ -42,6 +45,8 @@ ensure that potential vulnerabilities are addressed properly, please follow thes
If you have any doubts about a potential security vulnerability, contact us via private channels first! We'd prefer that
you bother us, instead of having a vulnerability disclosed without a fix.
[sl]: https://servers.joinmatrix.org
### Terms for credit
Before reporting a vulnerability, please remember that we are a small team maintaining a large codebase depended upon by
@@ -105,4 +110,4 @@ When security vulnerabilities are identified:
---
This security policy was last updated on May 25, 2025.
This security policy was last updated on November 17th, 2026.
+1
View File
@@ -0,0 +1 @@
Requests waiting on `/_matrix/client/v3/sync` can now be interrupted by the server shutdown, unblocking the 30-second shutdown delay imposed on a quiet server.
+1
View File
@@ -0,0 +1 @@
`/_matrix/client/v3/sync` no longer waits 30 seconds if the `timeout` parameter is omitted or set to zero, correctly reflecting the specification's rule that such requests should return immediately, even if they are empty.
+1
View File
@@ -0,0 +1 @@
The sticky events feature flag is correctly advertised in `/_matrix/client/versions` again after it was accidentally removed in #2517.
+13 -13
View File
@@ -431,9 +431,9 @@
}
},
"node_modules/@rspress/core": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.1.2.tgz",
"integrity": "sha512-3ghPRkZFwbuO3tr2Rb5cxi6QfSFWOcxoZ5p4pv21lbN5DxAzMduITFlfgBMTArIQbehXrfXw3OUXe1l422b0RA==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/@rspress/core/-/core-2.1.3.tgz",
"integrity": "sha512-qKa5c7zHO8cmhxkReURd3dN/ZRfHYnEztdIQ9hMuolaNzhSYo2A36XErUvLvbMf2EUM2AxfPYRQv+4Crfeq6pw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -441,7 +441,7 @@
"@mdx-js/react": "^3.1.1",
"@rsbuild/core": "^2.2.14",
"@rsbuild/plugin-react": "~2.1.1",
"@rspress/shared": "2.1.2",
"@rspress/shared": "2.1.3",
"@shikijs/rehype": "^4.2.0",
"@shikijs/transformers": "^4.2.0",
"@types/mdast": "^4.0.4",
@@ -485,9 +485,9 @@
}
},
"node_modules/@rspress/plugin-client-redirects": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.1.2.tgz",
"integrity": "sha512-kNCC7fffXA277TzTDfKpP+QuCI1X218lJ5JH/2iqYR8PHnLw0Y6ZIwoFmJlE0eKaBdniYyBRGn9zgvT93mCWdg==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/@rspress/plugin-client-redirects/-/plugin-client-redirects-2.1.3.tgz",
"integrity": "sha512-iEqJ8qEFuUxGKRVaS/WMyFi8FiJlogdcEHbGK/UjY8+8Hg8r8aSv4YihmNh3Ev/uIW21hrC8aXMEgVo0H51Q+g==",
"dev": true,
"license": "MIT",
"engines": {
@@ -498,9 +498,9 @@
}
},
"node_modules/@rspress/plugin-sitemap": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@rspress/plugin-sitemap/-/plugin-sitemap-2.1.2.tgz",
"integrity": "sha512-qF9NDLLJORa7MM8QY/etgMlrXM8hlArNaK5ntiFimqtKRoF1YTJQSKPsAfMq2PvYrpQJyEqsSg6wJ+r+lyjNlw==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/@rspress/plugin-sitemap/-/plugin-sitemap-2.1.3.tgz",
"integrity": "sha512-Fqo7/4PfQK1ecHUFoUDMrR/E+Hcu+kIohxSs8QabflMy3dqk+M3ZqzJDOHpVYB+HLLGwKiqkPLT4BK+W93clkw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -511,9 +511,9 @@
}
},
"node_modules/@rspress/shared": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.1.2.tgz",
"integrity": "sha512-W34tT1fdP3PrdbXpZNKqOGZMOw+RYL70Z9vnkbT1HTTbtX4uMIDE+SU7ByihG0S0LYBsT3kPxA2cXj696253Uw==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/@rspress/shared/-/shared-2.1.3.tgz",
"integrity": "sha512-VwJ7kgsTWVqHzSXQVHIUCsdMparmq9b/IDmTa3a6jMPl1zmm5Qg9M0eP4j8JXWoIS9n19XtCkQcZmMTFOPRy3A==",
"dev": true,
"license": "MIT",
"dependencies": {
+15 -7
View File
@@ -3,7 +3,6 @@ mod left;
mod state;
use std::{
cmp::{self},
collections::{BTreeMap, HashMap, HashSet},
time::Duration,
};
@@ -207,7 +206,12 @@ pub(crate) async fn sync_events_route(
let mut wake_receiver = services.sync.subscribe_to_wake(sender_user);
let response = build_sync_events(&services, &body).await?;
if body.body.full_state
let timeout_duration = body.body.timeout.unwrap_or_default();
// If the timeout is zero, request has full_state=true, or there's
// meaningful data to return, do so immediately.
if timeout_duration.is_zero()
|| body.body.full_state
|| !(response.rooms.is_empty()
&& response.presence.is_empty()
&& response.account_data.is_empty()
@@ -217,11 +221,15 @@ pub(crate) async fn sync_events_route(
return Ok(response);
}
// Hang a few seconds so requests are not spammed
// Stop hanging if new info arrives
let default = Duration::from_secs(30);
let duration = cmp::min(body.body.timeout.unwrap_or(default), default);
_ = tokio::time::timeout(duration, wake_receiver.changed()).await;
// Otherwise, wait for a wake signal to rebuild changes. Cap timeout at 30
// seconds (this isn't specced, but a reasonable cap since most clients have
// a 30-second polling interval).
let duration = timeout_duration.min(Duration::from_secs(30));
let mut shutdown_signal = services.server.signal.subscribe();
tokio::select! {
_ = tokio::time::timeout(duration, wake_receiver.changed()) => {},
_ = shutdown_signal.recv() => return Err!(Request(Unknown("Server is shutting down"), SERVICE_UNAVAILABLE)),
};
// Retry returning data
build_sync_events(&services, &body).await
+5 -2
View File
@@ -35,10 +35,10 @@ pub fn versions() -> Vec<String> {
pub fn unstable_features(experiments: &Experiments) -> BTreeMap<String, bool> {
BTreeMap::from_iter([
// MatrixRTC (https://github.com/matrix-org/matrix-spec-proposals/pull/4143)
// Expected for spec v1.20
// Expected for spec v1.20/v2.0
("org.matrix.msc4143".to_owned(), true),
// Simplified Sliding sync (https://github.com/matrix-org/matrix-spec-proposals/pull/4186)
// Expected for spec v1.20
// Expected for spec v1.20/v2.0
("org.matrix.simplified_msc3575".to_owned(), true),
("org.matrix.msc4155".to_owned(), experiments.msc4155.is_enabled()),
// profile change propagation (https://github.com/matrix-org/matrix-spec-proposals/pull/4466)
@@ -48,5 +48,8 @@ pub fn unstable_features(experiments: &Experiments) -> BTreeMap<String, bool> {
("org.continuwuity.msc4484.unstable".to_owned(), experiments.msc4484.is_enabled()),
("org.continuwuity.msc4560".to_owned(), experiments.msc4560.is_enabled()),
("fi.mau.msc2815".to_owned(), experiments.msc2815.is_enabled()),
// Sticky events (https://github.com/matrix-org/matrix-spec-proposals/pull/4354)
// Proposal merged, expected for spec v1.20/v2.0
("org.matrix.msc4354".to_owned(), true),
])
}
+1 -1
View File
@@ -534,7 +534,7 @@ impl Service {
return state;
},
};
if !pdu_fits(&value.clone()) {
if !pdu_fits(&value) {
warn!(
"dropping incoming PDU {event_id} in room {room_id} from room join \
because it exceeds 65535 bytes or is otherwise too large."
+4 -4
View File
@@ -54,7 +54,7 @@ pub fn pdu_fits(owned_obj: &CanonicalJsonObject) -> bool {
}
// Now check the full PDU size
match serde_json::to_string(owned_obj) {
| Ok(s) => s.len() <= 65535,
| Ok(s) => s.len() <= 65536,
| Err(_) => false,
}
}
@@ -305,7 +305,7 @@ impl super::Service {
{
return match e {
| Error::SignatureJson(ruma::signatures::JsonError::PduTooLarge) => {
Err!(Request(TooLarge("Message/PDU is too long (exceeds 65535 bytes)")))
Err!(Request(TooLarge("Message/PDU is too long (exceeds 65536 bytes)")))
},
| _ => Err!(Request(Unknown(warn!("Signing event failed: {e}")))),
};
@@ -330,9 +330,9 @@ impl super::Service {
pdu_json
.insert("event_id".into(), CanonicalJsonValue::String(pdu.event_id.clone().into()));
// Verify that the *full* PDU isn't over 64KiB.
if !pdu_fits(&pdu_json.clone()) {
if !pdu_fits(&pdu_json) {
// feckin huge PDU mate
return Err!(Request(TooLarge("Message/PDU is too long (exceeds 65535 bytes)")));
return Err!(Request(TooLarge("Message/PDU is too long (exceeds 65536 bytes)")));
}
// Check with the policy server