Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. mellium.im/xmpp
  4. ›
  5. GMS-2022-9467

GMS-2022-9467: Improper Validation of Certificate with Host Mismatch in mellium.im/xmpp/websocket

February 16, 2022 (updated February 17, 2023)

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

  • https://mellium.im/cve/cve-2022-24968/
  • https://nvd.nist.gov/vuln/detail/CVE-2022-24968

For more information

If you have any questions or comments about this advisory:

  • Reach out on XMPP to sam@samwhited.com
  • Email us at sam@samwhited.com

References

  • github.com/advisories/GHSA-h289-x5wc-xcv8
  • github.com/mellium/xmpp/commit/0d92aa486da69b71f2f4a30e62aa722c711b98ac
  • github.com/mellium/xmpp/pull/260
  • github.com/mellium/xmpp/security/advisories/GHSA-h289-x5wc-xcv8
  • mellium.im/cve/cve-2022-24968/
  • mellium.im/issue/259
  • pkg.go.dev/vuln/GO-2022-0370

Code Behaviors & Features

Detect and mitigate GMS-2022-9467 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.18.0 before 0.21.1

Fixed versions

  • 0.21.1

Solution

Upgrade to version 0.21.1 or above.

Source file

go/mellium.im/xmpp/GMS-2022-9467.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:40 +0000.