Skip to content

pyca/cryptography is vulnerable to Bleichenbacher attacks on PKCS#1 v1.5 decryption #200

@tomato42

Description

@tomato42

As far as I can tell, python-jose supports PKCS#1 v1.5 for key transport:
https://github.com/mpdavis/python-jose/blob/99ec142374a6eb98e32be5b8cdfd72508fd404d4/docs/jwe/index.rst#supported-key-management-algorithms
and:

expected_header = {u"alg": u"RSA1_5", u"enc": u"A128CBC-HS256"}
jwe_str = "eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0." \
"UGhIOguC7IuEvf_NPVaXsGMoLOmwvc1GyqlIKOK1nN94nHPoltGRhWhw7" \
"Zx0-kFm1NJn8LE9XShH59_i8J0PH5ZZyNfGy2xGdULU7sHNF6Gp2vPLgN" \
"Z__deLKxGHZ7PcHALUzoOegEI-8E66jX2E4zyJKx-YxzZIItRzC5hlRir" \
"b6Y5Cl_p-ko3YvkkysZIFNPccxRU7qve1WYPxqbb2Yw8kZqa2rMWI5ng8" \
"OtvzlV7elprCbuPhcCdZ6XDP0_F8rkXds2vE4X-ncOIM8hAYHHi29NX0m" \
"cKiRaD0-D-ljQTP-cFPgwCp6X-nZZd9OHBv-B3oWh2TbqmScqXMR4gp_A" \
"." \
"AxY8DCtDaGlsbGljb3RoZQ." \
"KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY." \
"9hH0vgRfYgPnAHOd8stkvw"
actual_header = jwe.get_unverified_header(jwe_str)
assert expected_header == actual_header

at the same time, pyca/cryptography doesn't guarantee side-channel safety of their decryption API:
pyca/cryptography#5510
pyca/cryptography#5600
pyca/cryptography@1ac4759

which means that python-jose with PKCS#1 v1.5 is insecure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions