Skip to content

GHSA-fh66-fcv5-jjfr CVE-2025-61672 PYSEC-2026-1612

Synapse's invalid device keys degrade federation functionality

Medium PyPI
Severity
0.0 / 10
Medium · CVSS 4.0
Exploit chance (EPSS)
0.48%
Chance of exploitation in the next 30 days. Higher than 41.18% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-1287 Improper Validation of Specified Type of Input
Fix
1.138.3
Upgrade matrix-synapse to this version or later

Description

Impact

Lack of validation for device keys in Synapse before 1.138.3 and in Synapse 1.139.0 allow an attacker registered on the victim homeserver to degrade federation functionality, unpredictably breaking outbound federation to other homeservers.

Patches

Patched in Synapse 1.138.3, 1.138.4, 1.139.1, and 1.139.2.

Note that even though 1.138.3 and 1.139.1 fix the vulnerability, they inadvertently introduced an unrelated regression. For this reason, it is recommend to skip these releases and upgrading straight to 1.138.4 and 1.139.2.

Workarounds

The vulnerability can only be exploited by users registered on the victim homeserver.

Affected versions

PyPI

PackageVulnerableFixed in
matrix-synapse
< 1.138.3
1.138.3
matrix-synapse
>= 1.139.0rc2, < 1.139.1
1.139.1
matrix-synapse
< 1.138.3
>= 1.139.0rc2, < 1.139.1
1.138.3
1.139.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

matrix-synapse PyPI → 1.138.3

pip
pip install --upgrade "matrix-synapse>=1.138.3"
poetry
poetry add "matrix-synapse>=1.138.3"
uv
uv add "matrix-synapse>=1.138.3"

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
Low
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
Low
Availability (vulnerable system)
Low
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

Weakness

CWE-1287: Improper Validation of Specified Type of Input

The product receives input that is expected to be of a certain type, but it does not validate or incorrectly validates that the input is actually of the expected type.

How to prevent it
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-6qf2-7x63-mm6v
Synapse pagination Denial of Service
Low Also affects matrix-synapse
GHSA-8q93-326v-3m7g
Synapse CPU starvation (Denial of Service)
Medium Also affects matrix-synapse
GHSA-v56r-hwv5-mxg6
Synapse vulnerable to federation denial of service via malformed events
High Also affects matrix-synapse
GHSA-56w4-5538-8v8h
Synapse Matrix has a partial room state leak via Sliding Sync
Medium Also affects matrix-synapse
GHSA-vp6v-whfm-rv3g
Synapse can be forced to thumbnail unexpected file formats, invoking external, potentially untrustworthy decoders
Critical Also affects matrix-synapse
GHSA-f3r3-h2mq-hx2h
Synapse allows a a malformed invite to break the invitee's `/sync`
Medium Also affects matrix-synapse
GHSA-rfq8-j7rh-8hf2
Synapse allows unsupported content types to lead to memory exhaustion
High Also affects matrix-synapse
GHSA-gjgr-7834-rhxr
Synapse's unauthenticated writes to the media repository allow planting of problematic content
Medium Also affects matrix-synapse
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor