Skip to content
Memory corruption Write-up Advanced

The OpenSSL punycode vulnerability (CVE20223602): Overview, detection, exploitation, and remediation

A memory corruption bug in OpenSSL's punycode decoding function could be triggered when a client or server validates a specially crafted X.509 certificate containing a malicious email address, potentially causing a denial of service or remote code execution. The researchers demonstrated a crash on Windows but found Linux deployments likely not exploitable.

securitylabs.datadoghq.com

Published on securitylabs.datadoghq.com

Senior Security Researcher](https://securitylabs.datadoghq.com/articles/?author=FredericBaguelin) [{{media:1}}

Frederic Baguelin, Jeremy Fox, Nick Frichette, Eslam Salem, on securitylabs.datadoghq.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely an off-by-one error in a loop termination condition in the punycode decoding function, causing a 4-byte out-of-bounds write.

Impact

An attacker could cause a denial of service or potentially achieve remote code execution, though Linux deployments may not be exploitable and exploitation requires specific application usage.

What the attacker needed

Vulnerable OpenSSL 3.0.0-3.0.6; client or server verifies X.509 cert; attacker supplies malicious certificate

The fix

The vulnerability was fixed in OpenSSL version 3.0.7.

How it was found

  1. Compile OpenSSL 3.0.6 from source on Windows.
  2. Examine the unit test added in the patch to understand the vulnerability.
  3. Run the test to observe a 4-byte out-of-bounds write on the stack buffer.
  4. Modify the test to cause an actual buffer overrun and crash.
  5. Use a larger buffer in ossl_a2ulabel to trigger a stack cookie overwrite and crash.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

OpenSSL is a widely used library that handles secure connections. A bug in how it decoded certain international domain names could let an attacker crash the program or possibly run their own code by sending a malicious certificate. The attacker needs the victim's software to check an email address inside that certificate.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.