GnuTLS | Behavioral PKCS#1 v1.5 decryption oracle (Ok/Err bit) (#1901)

Read-only notification of GnuTLS library development activities <[email protected]> Sun, 07 Jun 2026 07:33:06 +0000
Newsgroups gmane.comp.encryption.gpg.gnutls.devel
Message-ID <[email protected]>
--===============8468145834175320378==
Content-Type: multipart/alternative;
 boundary="--==_mimepart_6a251eb29baa7_371898b42c11855c7";
 charset=UTF-8
Content-Transfer-Encoding: 7bit


----==_mimepart_6a251eb29baa7_371898b42c11855c7
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable



Issue created by Mark Esler: https://gitlab.com/gnutls/gnutls/-/work_item=
s/1901



Hello,

While surveying PKCS#1 v1.5 implementations [0] for the behavioral Bleich=
enbacher oracle [1] I found that GnuTLS exposes the oracle through its ca=
llable decrypt API.

`gnutls_privkey_decrypt_data` / `gnutls_privkey_decrypt_data2` returns `G=
NUTLS_E_DECRYPTION_FAILED` on a non-conforming block and succeeds otherwi=
se =E2=80=94 a distinguishable bit. `_data2` is documented constant-time =
but that is constant-time *explicit* rejection, not implicit rejection; t=
he behavioral bit remains. The oracle is closed inside the TLS key-exchan=
ge path (result discarded) but not for general callers (JOSE / CMS / PKCS=
#11 / direct decrypt). Runtime-confirmed, source-reviewed in `lib/privkey=
.c` and `lib/pk.c`.

The CFRG implementation guidance draft [2] covers remediation: OAEP as th=
e fix, implicit rejection (=C2=A77.2) as the stopgap if v1.5 must stay.

Mark Esler

[0] https://hexproof.dev/datagrams/bleichenbacher-oracle-survey/
[1] https://hexproof.dev/datagrams/ok-err-is-a-padding-oracle/
[2] https://datatracker.ietf.org/doc/draft-irtf-cfrg-rsa-guidance/

-- =

Reply to this email directly or view it on GitLab: https://gitlab.com/gnu=
tls/gnutls/-/work_items/1901
You're receiving this email because of your account on gitlab.com. Unsubs=
cribe from this thread: https://gitlab.com/-/sent_notifications/5-cgo0u1r=
jctmrc5yb71ioqn75l-a84t7/unsubscribe | Manage all notifications: https://=
gitlab.com/-/profile/notifications | Help: https://gitlab.com/help



----==_mimepart_6a251eb29baa7_371898b42c11855c7
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www=
.w3.org/TR/REC-html40/loose.dtd">
<html lang=3D"en" style=3D'--code-editor-font: var(--default-mono-font, "=
GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, =
Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospac=
e;'>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type">=

<title>
GitLab
</title>

<style data-premailer=3D"ignore" type=3D"text/css">
a { color: #1068bf; }
</style>

<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: hsla(0,0%,100%,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Ro=
boto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Colo=
r Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size=
: inherit;
}
</style>
</head>
<body style=3D'font-size: inherit; -webkit-text-shadow: hsla(0,0%,100%,.0=
1) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"=
Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif=
,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji=
";'>
<div class=3D"content">

<p class=3D"details" style=3D"font-style: italic; color: #626168;">
Issue created by <a href=3D"https://gitlab.com/eslerm">Mark Esler</a>: <a=
 href=3D"https://gitlab.com/gnutls/gnutls/-/work_items/1901">#1901</a>
</p>
<div class=3D"md" style=3D"position: relative; z-index: 1; color: #3a383f=
; word-wrap: break-word;">
<p dir=3D"auto" style=3D"color: #3a383f; margin: 0px 0px 1rem;" align=3D"=
initial">Hello,</p>
<p dir=3D"auto" style=3D"color: #3a383f; margin: 0px 0px 1rem;" align=3D"=
initial">While surveying PKCS#1 v1.5 implementations [0] for the behavior=
al Bleichenbacher oracle [1] I found that GnuTLS exposes the oracle throu=
gh its callable decrypt API.</p>
<p dir=3D"auto" style=3D"color: #3a383f; margin: 0px 0px 1rem;" align=3D"=
initial"><code style=3D'font-size: 90%; color: #18171d; word-wrap: break-=
word; background-color: #ececef; border-radius: .25rem; margin-top: 0px; =
font-weight: inherit; overflow-wrap: break-word; white-space: break-space=
s; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mo=
no", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale=
 mono", "lucida console", monospace; font-variant-ligatures: none; word-b=
reak: keep-all; padding: 0.125rem 0.25rem;'>gnutls_privkey_decrypt_data</=
code> / <code style=3D'font-size: 90%; color: #18171d; word-wrap: break-w=
ord; background-color: #ececef; border-radius: .25rem; font-weight: inher=
it; overflow-wrap: break-word; white-space: break-spaces; font-family: "G=
itLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation M=
ono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida co=
nsole", monospace; font-variant-ligatures: none; word-break: keep-all; pa=
dding: 0.125rem 0.25rem;'>gnutls_privkey_decrypt_data2</code> returns <co=
de style=3D'font-size: 90%; color: #18171d; word-wrap: break-word; backgr=
ound-color: #ececef; border-radius: .25rem; font-weight: inherit; overflo=
w-wrap: break-word; white-space: break-spaces; font-family: "GitLab Mono"=
, "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Cons=
olas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", mon=
ospace; font-variant-ligatures: none; word-break: keep-all; padding: 0.12=
5rem 0.25rem;'>GNUTLS_E_DECRYPTION_FAILED</code> on a non-conforming bloc=
k and succeeds otherwise =E2=80=94 a distinguishable bit. <code style=3D'=
font-size: 90%; color: #18171d; word-wrap: break-word; background-color: =
#ececef; border-radius: .25rem; font-weight: inherit; overflow-wrap: brea=
k-word; white-space: break-spaces; font-family: "GitLab Mono", "JetBrains=
 Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubun=
tu Mono", "Courier New", "andale mono", "lucida console", monospace; font=
-variant-ligatures: none; word-break: keep-all; padding: 0.125rem 0.25rem=
;'>_data2</code> is documented constant-time but that is constant-time <e=
m>explicit</em> rejection, not implicit rejection; the behavioral bit rem=
ains. The oracle is closed inside the TLS key-exchange path (result disca=
rded) but not for general callers (JOSE / CMS / PKCS#11 / direct decrypt)=
. Runtime-confirmed, source-reviewed in <code style=3D'font-size: 90%; co=
lor: #18171d; word-wrap: break-word; background-color: #ececef; border-ra=
dius: .25rem; font-weight: inherit; overflow-wrap: break-word; white-spac=
e: break-spaces; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "=
DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier=
 New", "andale mono", "lucida console", monospace; font-variant-ligatures=
: none; word-break: keep-all; padding: 0.125rem 0.25rem;'>lib/privkey.c</=
code> and <code style=3D'font-size: 90%; color: #18171d; word-wrap: break=
-word; background-color: #ececef; border-radius: .25rem; font-weight: inh=
erit; overflow-wrap: break-word; white-space: break-spaces; font-family: =
"GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation=
 Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida =
console", monospace; font-variant-ligatures: none; word-break: keep-all; =
padding: 0.125rem 0.25rem;'>lib/pk.c</code>.</p>
<p dir=3D"auto" style=3D"color: #3a383f; margin: 0px 0px 1rem;" align=3D"=
initial">The CFRG implementation guidance draft [2] covers remediation: O=
AEP as the fix, implicit rejection (=C2=A77.2) as the stopgap if v1.5 mus=
t stay.</p>
<p dir=3D"auto" style=3D"color: #3a383f; margin: 0px 0px 1rem;" align=3D"=
initial">Mark Esler</p>
<p dir=3D"auto" style=3D"color: #3a383f; margin: 0px;" align=3D"initial">=
[0] <a href=3D"https://hexproof.dev/datagrams/bleichenbacher-oracle-surve=
y/" rel=3D"nofollow noreferrer noopener" target=3D"_blank" style=3D"margi=
n-top: 0px;">https://hexproof.dev/datagrams/bleichenbacher-oracle-survey/=
</a>
[1] <a href=3D"https://hexproof.dev/datagrams/ok-err-is-a-padding-oracle/=
" rel=3D"nofollow noreferrer noopener" target=3D"_blank">https://hexproof=
.dev/datagrams/ok-err-is-a-padding-oracle/</a>
[2] <a href=3D"https://datatracker.ietf.org/doc/draft-irtf-cfrg-rsa-guida=
nce/" rel=3D"nofollow noreferrer noopener" target=3D"_blank">https://data=
tracker.ietf.org/doc/draft-irtf-cfrg-rsa-guidance/</a></p>
</div>

</div>
<div class=3D"footer" style=3D"margin-top: 10px;">
<p style=3D"font-size: small; color: #626168;">
=E2=80=94
<br>
Reply to this email directly or <a href=3D"https://gitlab.com/gnutls/gnut=
ls/-/work_items/1901">view it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target=3D"_blan=
k" rel=3D"noopener noreferrer" href=3D"https://gitlab.com">gitlab.com</a>=
. <a href=3D"https://gitlab.com/-/sent_notifications/5-cgo0u1rjctmrc5yb71=
ioqn75l-a84t7/unsubscribe" target=3D"_blank" rel=3D"noopener noreferrer">=
Unsubscribe</a> from this thread =C2=B7 <a href=3D"https://gitlab.com/-/p=
rofile/notifications" target=3D"_blank" rel=3D"noopener noreferrer" class=
=3D"mng-notif-link">Manage all notifications</a> =C2=B7 <a href=3D"https:=
//gitlab.com/help" target=3D"_blank" rel=3D"noopener noreferrer" class=3D=
"help-link">Help</a>
<span style=3D"color: transparent; font-size: 0; display: none; overflow:=
 hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0;">
Notification message regarding https://gitlab.com/gnutls/gnutls/-/work_it=
ems/1901 at 1780817586
</span>
<script type=3D"application/ld+json">{"@context":"http://schema.org","@ty=
pe":"EmailMessage","action":{"@type":"ViewAction","name":"View Work item"=
,"url":"https://gitlab.com/gnutls/gnutls/-/work_items/1901"}}</script>


</p>
</div>
</body>
</html>

----==_mimepart_6a251eb29baa7_371898b42c11855c7--


--===============8468145834175320378==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Gnutls-devel mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel

--===============8468145834175320378==--