0
$\begingroup$

for a research project, i am currently looking for a way to manipulate the digital signature of a HTTPS TLS message flow. More specifically, i am trying to create a working example for a malicious webserver in order to show a client-side exploit of CVE-2022-21449 ("Psychic Signatures") for a research paper.

In order to do this, i am planning to write a small HTTPS-capable TLS server which will sign the message with a digital ECDSA signature with the parameters r and s set to zero. In theory, this should cause the vulnerable java-based client to regard the malicious payload as a valid response as opposed to throwing an exception. Sadly, i have not been able to find a framework or tool for appending this invalid signature to the payload sent by a standard Java SSLServerSocket. The only option i see is modifying the Java security library directly in order to change how the signature is generated when using the "SHA256withECDSA" (for example) algorithm. I have found this repository showing a PoC for this exact case, but it is written in go. If possible, i would like to write my own server (out of curiosity). I don't care about the language i am writing it in.

Thank you all in advance!

$\endgroup$
7
  • 1
    $\begingroup$ Welcome to Cryptography.se The ethic is not cross-posting. Please delete one copy. see here meta.stackexchange.com/q/64068/403350 $\endgroup$
    – kelalaka
    Oct 19, 2023 at 20:27
  • $\begingroup$ Done. I think this board might be the better place for it. $\endgroup$
    – ndrscodes
    Oct 19, 2023 at 21:05
  • 1
    $\begingroup$ So you have found a PoC written in Go. You don't care a about the language you will use for your own code. So then why not simply look at the PoC you already know and learn from it how to do it. Since it obviously doable in Go you can just do it yourself in Go too. $\endgroup$ Oct 19, 2023 at 22:06
  • $\begingroup$ You can create a provider for Java with an Signature service that supplies ECDSA. Then when the signing happens (possibly with a special key) you can simply return all zeros. Creating a provider is somewhat hard, but Java has always had a tutorial for doing so. Place the provider in front of all the other providers and your uncle may well be called Bob. $\endgroup$
    – Maarten Bodewes
    Oct 20, 2023 at 2:07
  • $\begingroup$ @SteffenUllrich the way it was done in the Go PoC is that the Go Standard Library was copied to the Repo. They simple commented out some Code for verifying Certificates and the „r“ and „s“ Parameters of the ECDSA algorithm. I wanted to create a working example without having to edit Core Library files. $\endgroup$
    – ndrscodes
    Oct 20, 2023 at 6:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.