Improper Certificate Validation Affecting mellium.im/xmpp/websocket package, versions <0.21.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Not Defined
EPSS
0.09% (41st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-MELLIUMIMXMPPWEBSOCKET-2404809
  • published18 Feb 2022
  • disclosed16 Feb 2022
  • creditTravis Burtrum

Introduced: 16 Feb 2022

CVE-2022-24968  (opens in a new tab)
CWE-295  (opens in a new tab)

How to fix?

Upgrade mellium.im/xmpp/websocket to version 0.21.1 or higher.

Overview

mellium.im/xmpp/websocket is an used to dial and negotiate WebSocket connections.

Affected versions of this package are vulnerable to Improper Certificate Validation. 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 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 the user was attempting to connect. This means that any attacker that can spoof a DNS record could redirect the user to a server of the attacker 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:

CVSS Scores

version 3.1