CVE-2022-24968: Mellium.im/xmpp Improper Validation Of Certificate With Vulnerability
MODERATECVE-2022-24968 is a MODERATE (CVSS 5.9) improper validation of certificate with vulnerability (CWE-295: Improper Certificate Validation) affecting Mellium.im/xmpp libraries in the Go ecosystem. The issue involves improper validation of certificate with host mismatch in mellium.im/xmpp/websocket. Remediation is available by upgrading affected packages to version 0.21.1.
CVE-2022-24968 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2022-24968
To remediate this vulnerability, upgrade all affected Mellium.im/xmpp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade mellium.im/xmpp to 0.21.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for mellium.im/xmpp
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-24968, inspect your project dependencies for Mellium.im/xmpp:
inspect dependencies for mellium.im/xmpp
Analyze the terminal output to locate any version of Mellium.im/xmpp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. In Mellium.im/xmpp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-24968 Affected Mellium.im/xmpp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mellium.im/xmpp
|
Go |
≥ 0.18.0
< 0.21.1
|
0.21.1
|
References
Frequently Asked Questions
What is CVE-2022-24968?
Which Mellium.im/xmpp versions are affected?
What version fixes CVE-2022-24968?
Is mellium.im/xmpp affected?
What is the CVSS score of CVE-2022-24968?
What CWE is associated with CVE-2022-24968?
How can I check Go dependencies for CVE-2022-24968?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h289-x5wc-xcv8",
"modified" : "2024-05-20T21:13:34Z",
"published" : "2022-02-16T22:56:21Z",
"aliases" : [ "CVE-2022-24968" ],
"summary" : "Improper Validation of Certificate with Host Mismatch in mellium.im/xmpp/websocket",
"details" : "### Impact\n\nIf 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](https://xmpp.org/extensions/xep-0156.html) 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.\n\n### Patches\n\nAll users should upgrade to v0.21.1.\n\n### Workarounds\n\nTo work around the issue, manually specify a TLS configuration with the correct hostname.\n\n### References\n\n- https://mellium.im/cve/cve-2022-24968/\n- https://nvd.nist.gov/vuln/detail/CVE-2022-24968\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Reach out on XMPP to [sam@samwhited.com](xmpp:sam@samwhited.com?msg)\n* Email us at [sam@samwhited.com](mailto:sam@samwhited.com)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "mellium.im/xmpp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.18.0"
}, {
"fixed" : "0.21.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mellium/xmpp/security/advisories/GHSA-h289-x5wc-xcv8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24968"
}, {
"type" : "WEB",
"url" : "https://github.com/mellium/xmpp/pull/260"
}, {
"type" : "WEB",
"url" : "https://github.com/mellium/xmpp/commit/0d92aa486da69b71f2f4a30e62aa722c711b98ac"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mellium/xmpp"
}, {
"type" : "WEB",
"url" : "https://mellium.im/cve/cve-2022-24968"
}, {
"type" : "WEB",
"url" : "https://mellium.im/issue/259"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2022-0370"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-295" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-02-16T22:56:21Z",
"nvd_published_at" : null
}
}