fix: re-enable PKCS#1 v1.5 padding for signatures#103
fix: re-enable PKCS#1 v1.5 padding for signatures#103atoomic merged 2 commits intocpan-authors:mainfrom
Conversation
|
@toddr-bot rebase |
PR Review — fix: re-enable PKCS#1 v1.5 padding for signaturesThe PR correctly re-enables PKCS#1 v1.5 for signatures while keeping it blocked for encryption. The core logic is sound: the Marvin attack only affects decryption padding oracles, not signatures. The implementation places the encryption croak before memory allocation (no leak), and the sign/verify paths on OpenSSL 3.x properly pass through PKCS1 padding instead of forcing PSS. Documentation updates are accurate and thorough. The suggestions are non-blocking improvements. Merge-ready. 🟡 Important1. Marvin croak blocks private_encrypt/public_decrypt with PKCS1 ( If this is intentional (steering users to The current croak message says "Use use_pkcs1_oaep_padding() for encryption, or use_pkcs1_padding() with sign()/verify()" which is good guidance but doesn't acknowledge the 🟢 Suggestions1. rsa_crypt still forces OAEP for non-NO_PADDING on 3.x ( 2. pkcs1 pad value 11 is meaningless for sign-only padding ( 3. Missing test: encrypt() with PKCS1 should croak ( Consider adding an explicit test like: eval { $rsa->use_pkcs1_padding; $rsa->encrypt($plaintext); };
like($@, qr/Marvin/, 'encrypt with PKCS1 croaks with Marvin warning');This would directly validate the security invariant. Checklist
SummaryThe PR correctly re-enables PKCS#1 v1.5 for signatures while keeping it blocked for encryption. The core logic is sound: the Marvin attack only affects decryption padding oracles, not signatures. The implementation places the encryption croak before memory allocation (no leak), and the sign/verify paths on OpenSSL 3.x properly pass through PKCS1 padding instead of forcing PSS. Documentation updates are accurate and thorough. The suggestions are non-blocking improvements. Merge-ready. Automated review by Kōan |
…s#61) The Marvin attack (CVE-2023-6129) targets PKCS#1 v1.5 *decryption* padding oracles, not signatures. Version 0.35 disabled use_pkcs1_padding() entirely, breaking every CPAN module that signs with RSASSA-PKCS1-v1.5 (RS256): Net::ACME2, Google::SAML::Response, Crypt::LE, JSON::WebToken, and others. This commit: - Re-enables use_pkcs1_padding() to set RSA_PKCS1_PADDING - Respects PKCS#1 v1.5 in sign()/verify() on OpenSSL 3.x instead of forcing PSS for all non-NO_PADDING modes - Blocks PKCS#1 v1.5 for encrypt()/decrypt() with a clear error message about the Marvin attack (all OpenSSL versions) - Updates documentation and tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rebase: fix: re-enable PKCS#1 v1.5 padding for signaturesBranch Diff: 4 files changed, 68 insertions(+), 56 deletions(-) Review feedback was analyzed and applied. Actions
Automated by Kōan |
baddf44 to
790297b
Compare
What
Re-enables
use_pkcs1_padding()forsign()/verify()while keeping it blocked for encryption. Closes #61.Why
v0.35 disabled PKCS#1 v1.5 entirely to mitigate the Marvin attack, but Marvin only affects decryption padding oracles — not signatures. This broke every CPAN module using RSASSA-PKCS1-v1.5 (RS256): Net::ACME2, Google::SAML::Response, Crypt::LE, JSON::WebToken, WWW::LetsEncrypt.
How
use_pkcs1_padding()setsRSA_PKCS1_PADDINGagain instead of croakingsign()/verify()on OpenSSL 3.x respect the padding mode (RSA_PKCS1_PADDINGpasses through instead of being forced to PSS)encrypt()/decrypt()croak with a clear Marvin attack message on all OpenSSL versions (moved before the#ifblock)RSA_PKCS1_PSS_PADDINGis setTesting
encrypt()with PKCS#1 v1.5 padding🤖 Generated with Claude Code
Quality Report
Changes: 4 files changed, 54 insertions(+), 46 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline