Closed lialon closed 2 months ago
When creating a signature, you can always choose a different algorithm than rsaes_pkcs1v15, e.g.: rsaes_oaep (endesive/email/encrypt.py line 41) When reading/verifying a signature, you can't freely choose an algorithm, you have to use the right one.
This is not a bug in the library, but an intended action. You can choose what you want, not what the author thought was right.
Description:
In the "endesive/endesive/email/decrypt.py", "endesive/examples/pdf-verify-rsa_sha1.py", "endesive/endesive/email/encrypt.py" and "endesive/endesive/signer.py", I have identified a security vulnerabilities about insecure cryptographic algorithm. PKCS1v1.5 is vulnerable to the chosen-ciphertext attack.
Location:
https://github.com/m32/endesive/blob/master/endesive/email/decrypt.py#L51
https://github.com/m32/endesive/blob/master/endesive/email/decrypt.py#L71
https://github.com/m32/endesive/blob/master/endesive/email/encrypt.py#L68
https://github.com/m32/endesive/blob/master/endesive/signer.py#L347
https://github.com/m32/endesive/blob/master/endesive/signer.py#L368
https://github.com/m32/endesive/blob/master/endesive/verifier.py#L104
https://github.com/m32/endesive/blob/master/examples/cert-info-p12.py#L31
https://github.com/m32/endesive/blob/master/examples/pdf-verify-rsa_sha1.py#L69
Reference
Recommendations:
Try using other padding(OAEP) instead of PKCS1v1.5.