X.509 Policy Constraints Double Locking
Description
If an X.509 certificate contains a malformed policy constraint and policy processing is enabled, then a write lock will be taken twice recursively. On some operating systems (most widely: Windows) this results in a denial of service when the affected process hangs. Policy processing being enabled on a publicly facing server is not considered to be a common setup.
Policy processing is enabled by passing the -policy' argument to the command line utilities or by calling the X509_VERIFY_PARAM_set1_policies()' function.
Update (31 March 2023): The description of the policy processing enablement was corrected based on CVE-2023-0466.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
OpenSSL 3.0.0-3.0.7 has a double-lock bug in X.509 policy processing that can cause a denial of service on Windows systems.
Vulnerability
Description
CVE-2022-3996 is a denial-of-service vulnerability in OpenSSL versions 3.0.0 through 3.0.7. The bug occurs in the X.509 certificate policy constraint handling: when a malformed policy constraint is encountered and policy processing is enabled, the write lock is taken twice recursively [1][3]. This double-locking behavior causes the affected process to hang on certain operating systems, most notably Windows [1][3].
Exploitation
Conditions
Exploitation requires that policy processing is explicitly enabled by the server or application. This is done by passing the -policy argument to command-line utilities or by calling the X509_VERIFY_PARAM_set1_policies() function in code [1][3]. The OpenSSL advisory notes that enabling policy processing on a publicly facing server is not considered a common setup, which reduces the attack surface [3]. The attacker would need to present a crafted X.509 certificate containing a malformed policy constraint to trigger the vulnerability [1].
Impact
When successfully triggered, the double lock causes the process to hang, resulting in a denial of service. The advisory states that this issue predominantly affects Windows systems, though the vulnerability exists in the code regardless of platform [1][3]. No evidence of exploitation in the wild was known at the time of the advisory [3].
Mitigation
The vulnerability was fixed in OpenSSL 3.0.8, which was released after the advisory [3]. The fix, introduced in commit 7725e7bfe, removes the redundant flag setting that caused the double lock [4]. OpenSSL 1.1.1 and 1.0.2 are not affected [3]. Users of OpenSSL 3.0.0-3.0.7 should upgrade to 3.0.8 or apply the patch from the referenced commit [3][4].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
openssl-srccrates.io | >= 300.0.0, < 300.0.12 | 300.0.12 |
Affected products
39- osv-coords38 versionspkg:apk/chainguard/libcrypto3pkg:apk/chainguard/libssl3pkg:apk/chainguard/opensslpkg:apk/chainguard/openssl-configpkg:apk/chainguard/openssl-dbgpkg:apk/chainguard/openssl-devpkg:apk/chainguard/openssl-docpkg:apk/chainguard/openssl-engine-afalgpkg:apk/chainguard/openssl-engine-capipkg:apk/chainguard/openssl-engine-loader-atticpkg:apk/chainguard/openssl-engine-padlockpkg:apk/chainguard/openssl-provider-fipspkg:apk/chainguard/openssl-provider-legacypkg:apk/chainguard/ruby-3.1pkg:apk/chainguard/ruby-3.1-basepkg:apk/chainguard/ruby-3.1-base-devpkg:apk/chainguard/ruby-3.1-devpkg:apk/chainguard/ruby-3.1-docpkg:apk/wolfi/libcrypto3pkg:apk/wolfi/libssl3pkg:apk/wolfi/opensslpkg:apk/wolfi/openssl-configpkg:apk/wolfi/openssl-dbgpkg:apk/wolfi/openssl-devpkg:apk/wolfi/openssl-docpkg:apk/wolfi/openssl-engine-afalgpkg:apk/wolfi/openssl-engine-capipkg:apk/wolfi/openssl-engine-loader-atticpkg:apk/wolfi/openssl-engine-padlockpkg:apk/wolfi/openssl-provider-legacypkg:apk/wolfi/ruby-3.1pkg:apk/wolfi/ruby-3.1-basepkg:apk/wolfi/ruby-3.1-base-devpkg:apk/wolfi/ruby-3.1-devpkg:apk/wolfi/ruby-3.1-docpkg:cargo/openssl-srcpkg:rpm/opensuse/openssl-3&distro=openSUSE%20Leap%2015.4pkg:rpm/suse/openssl-3&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4
< 3.0.7-r1+ 37 more
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.8-r0
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 3.0.7-r1
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: >= 300.0.0, < 300.0.12
- (no CPE)range: < 3.0.1-150400.4.14.1
- (no CPE)range: < 3.0.1-150400.4.14.1
- Range: 3.0.0
Patches
17725e7bfe6f2x509: fix double locking problem
1 file changed · +0 −4
crypto/x509/pcy_map.c+0 −4 modified@@ -73,10 +73,6 @@ int ossl_policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps) ret = 1; bad_mapping: - if (ret == -1 && CRYPTO_THREAD_write_lock(x->lock)) { - x->ex_flags |= EXFLAG_INVALID_POLICY; - CRYPTO_THREAD_unlock(x->lock); - } sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free); return ret;
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/openssl/openssl/commit/7725e7bfe6f2ce8146b6552b44e0d226be7638e7ghsapatchWEB
- github.com/advisories/GHSA-vr8j-hgmm-jh9rghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-3996ghsaADVISORY
- www.openssl.org/news/secadv/20221213.txtghsavendor-advisoryWEB
News mentions
0No linked articles in our index yet.