Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1oMjg5LXg1d2MteGN2OM0scA

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

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:

Permalink: https://github.com/advisories/GHSA-h289-x5wc-xcv8
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1oMjg5LXg1d2MteGN2OM0scA
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 2 years ago
Updated: about 1 year ago


Identifiers: GHSA-h289-x5wc-xcv8
References: Repository: https://github.com/mellium/xmpp
Blast Radius: 0.0

Affected Packages

go:mellium.im/xmpp
Dependent packages: 17
Dependent repositories: 13
Downloads:
Affected Version Ranges: >= 0.18.0, < 0.21.1
Fixed in: 0.21.1
All affected versions: 0.18.0, 0.19.0, 0.20.0, 0.21.0
All unaffected versions: 0.0.1, 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.11.1, 0.12.0, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.17.0, 0.17.1, 0.21.1, 0.21.2, 0.21.3, 0.21.4