Skip to content

Improper Validation of Certificate with Host Mismatch in mellium.im/xmpp/websocket

Moderate severity GitHub Reviewed Published Feb 16, 2022 in mellium/xmpp • Updated May 20, 2024

Package

gomod mellium.im/xmpp (Go)

Affected versions

>= 0.18.0, < 0.21.1

Patched versions

0.21.1

Description

Impact

If no TLS configuration is provided by the user, the websocket package constructs its own TLS configuration using recommended defaults. When looking up a WSS endpoint using the DNS TXT record method described in XEP-0156: Discovering Alternative XMPP Connection Methods the ServerName field was incorrectly being set to the name of the server returned by the TXT record request, not the name of the initial server we were attempting to connect to. This means that any attacker that can spoof a DNS record (ie. in the absence of DNSSEC, DNS-over-TLS, DNS-over-HTTPS, or similar technologies) could redirect the user to a server of their choosing and as long as it had a valid TLS certificate for itself the connection would succeed, resulting in a MITM situation.

Patches

All users should upgrade to v0.21.1.

Workarounds

To work around the issue, manually specify a TLS configuration with the correct hostname.

References

For more information

If you have any questions or comments about this advisory:

References

@SamWhited SamWhited published to mellium/xmpp Feb 16, 2022
Published to the GitHub Advisory Database Feb 16, 2022
Reviewed Feb 16, 2022
Last updated May 20, 2024

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

EPSS score

0.079%
(35th percentile)

Weaknesses

CVE ID

CVE-2022-24968

GHSA ID

GHSA-h289-x5wc-xcv8

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.